Build VyOS with custom packages

vyos, podman

This is just a shorter version of this blog entry, but building on equuleus instead of crux.

podman pull vyos/vyos-build:equuleus
git clone -b equuleus --single-branch
cd vyos-build
sudo podman run --rm -it --privileged -v $(pwd):/vyos -w /vyos vyos/vyos-build:equuleus bash

./configure --architecture amd64 --build-by "" --build-type release --version 1.3.2 --custom-package "mosh ripgrep"

sudo make iso

ls -lah build/vyos-1.3.2-amd64.iso
-rw-r--r-- 1 root root 321M Sep 10 02:06 build/vyos-1.3.2-amd64.iso

I'm not sure why the container needs to be run as privileged, but I have been too lazy to test what happens if it's not. :-) The build took approx. 10 minutes on my fairly old Skylake CPU.

It might be worth noting that the version number specified in the configuration above is nothing magical – it's just telling the build script what it should be called. I built in the latest commit which today just happened to be the right commit (7ce865118886358efde71a5d3782d21063b01a22) for 1.3.2. If I'd been more picky I'd checked out the right tag for this branch, which can be found here:

Install it, I first copied (scp) my iso to /tmp/vyos-1.3.2-amd64.iso:

$ add system image /tmp/vyos-1.3.2-amd64.iso
Checking SHA256 checksums of files on the ISO image... OK.
What would you like to name this image? [1.3.2]:
OK.  This image will be named: 1.3.2
Installing "1.3.2" image.
Copying new release files...
Would you like to save the current configuration
directory and config file? (Yes/No) [Yes]:
Copying current configuration...
Would you like to save the SSH host keys from your
current configuration? (Yes/No) [Yes]:
Copying SSH keys...
Running post-install script...
Setting up grub configuration...

A reboot later:

$ show version

Version:          VyOS 1.3.2
Release train:    equuleus

Built by:
Built on:         Fri 09 Sep 2022 23:54 UTC
Build UUID:       9703c2e7-8ea5-4586-a0a9-674a0c5a6473
Build commit ID:  7ce86511888635

Architecture:     x86_64
Boot via:         installed image
System type:      bare metal

Hardware vendor:  FUJITSU
Hardware model:   FUTRO S920
Hardware S/N:
Hardware UUID:

Copyright:        VyOS maintainers and contributors