diff options
author | Daniil Baturin <daniil@vyos.io> | 2022-10-06 12:08:40 -0400 |
---|---|---|
committer | Daniil Baturin <daniil@vyos.io> | 2022-10-06 17:55:01 -0400 |
commit | 3979b25dcf137600b6ba7ccd361ae78515c012e8 (patch) | |
tree | 2480bb35911dbb09557be01869d71c782e882e5e /data | |
parent | 7149a2aa2e51abe6ffb2d81db4ff58da825f0da8 (diff) | |
download | vyos-build-3979b25dcf137600b6ba7ccd361ae78515c012e8.tar.gz vyos-build-3979b25dcf137600b6ba7ccd361ae78515c012e8.zip |
T3664: initial implementation of the build flavor system
Diffstat (limited to 'data')
-rw-r--r-- | data/architectures/amd64.toml | 10 | ||||
-rw-r--r-- | data/architectures/arm64.toml | 2 | ||||
-rw-r--r-- | data/architectures/armhf.toml | 2 | ||||
-rw-r--r-- | data/build-flavors/README.md | 76 | ||||
-rw-r--r-- | data/build-flavors/azure-iso.toml | 5 | ||||
-rw-r--r-- | data/build-flavors/edgecore.toml | 46 | ||||
-rw-r--r-- | data/build-flavors/iso.toml | 14 | ||||
-rw-r--r-- | data/build-flavors/xcpng.toml | 6 | ||||
-rw-r--r-- | data/build-types/development.toml | 8 | ||||
-rw-r--r-- | data/build-types/release.toml | 0 | ||||
-rw-r--r-- | data/defaults.json | 17 | ||||
-rw-r--r-- | data/defaults.toml | 21 | ||||
-rw-r--r-- | data/generic-arm64.json | 10 | ||||
-rw-r--r-- | data/package-lists/vyos-arm.list.chroot | 1 | ||||
-rw-r--r-- | data/package-lists/vyos-dev.list.chroot | 6 | ||||
-rw-r--r-- | data/package-lists/vyos-x86.list.chroot | 8 |
16 files changed, 190 insertions, 42 deletions
diff --git a/data/architectures/amd64.toml b/data/architectures/amd64.toml new file mode 100644 index 00000000..02027aa6 --- /dev/null +++ b/data/architectures/amd64.toml @@ -0,0 +1,10 @@ +# Packages added to images for x86 by default +packages = [ + "grub2", + "grub-pc", + "vyos-linux-firmware", + "vyos-intel-qat", + "telegraf" +] + +kernel_flavor = "amd64-vyos" diff --git a/data/architectures/arm64.toml b/data/architectures/arm64.toml new file mode 100644 index 00000000..fbd30008 --- /dev/null +++ b/data/architectures/arm64.toml @@ -0,0 +1,2 @@ +# Packages included in ARM64 images by default +packages = ["grub-efi-arm"] diff --git a/data/architectures/armhf.toml b/data/architectures/armhf.toml new file mode 100644 index 00000000..252c85d4 --- /dev/null +++ b/data/architectures/armhf.toml @@ -0,0 +1,2 @@ +# Packages included in armhf images by default +packages = ["grub-efi-arm"] diff --git a/data/build-flavors/README.md b/data/build-flavors/README.md new file mode 100644 index 00000000..19716255 --- /dev/null +++ b/data/build-flavors/README.md @@ -0,0 +1,76 @@ +# VyOS build flavors + +VyOS supports multiple different hardware and virtual platforms. +Those platforms often need custom packages and may require custom +configs. To make maintenance of existing flavors simpler +and to allow everyone to make and maintain their own flavors, +the build scripts support storing flavor configuration in [TOML](https://toml.io) files. + +Flavor files must be in `data/build-flavors`. Here's an example: + +```toml +# Generic (aka "universal") ISO image + +image_format = "iso" + +# Include these packages in the image regardless of the architecture +packages = [ + # QEMU and Xen guest tools exist for multiple architectures + "qemu-guest-agent", + "vyos-xe-guest-utilities", +] + +[architectures.amd64] + # Hyper-V and VMware guest tools are x86-only + packages = ["hyperv-daemons", "vyos-1x-vmware"] +``` + +## Image format + +The `image_format` option specifies the default format to build. + +```toml +image_format = "iso" +``` + +**Note:** currently, ISO is the only supported format, +support for different flavors is in progress. + +## Including custom packages + +If you want the build scripts to include custom packages from repositories +in the image, you can list them in the `packages` field. + +For example, this is how to include the GNU Hello package: + +```toml +packages = ['hello'] +``` + +It's possible to include packages only in images with certain build architectures +by placing them in a subtable. + +If you want to include GNU Hello only in AMD64 images, do this: + +```toml +[architectures.amd64] + packages = ['hello'] +``` + +## Including custom files + +You can include files inside the SquashFS filesystem by adding entries +to the `includes_chroot` array. + +```toml +[[includes_chroot]] + path = "etc/question.txt" + data = ''' +Can you guess how this file ended up in the image? + ''' + + path = "etc/answer.txt" + data = ''' +It was in the flavor file! + ''' +``` diff --git a/data/build-flavors/azure-iso.toml b/data/build-flavors/azure-iso.toml new file mode 100644 index 00000000..b4774483 --- /dev/null +++ b/data/build-flavors/azure-iso.toml @@ -0,0 +1,5 @@ +image_format = "iso" + +packages = ["waagent"] + + diff --git a/data/build-flavors/edgecore.toml b/data/build-flavors/edgecore.toml new file mode 100644 index 00000000..efea4863 --- /dev/null +++ b/data/build-flavors/edgecore.toml @@ -0,0 +1,46 @@ +# ISO image for EdgeCore routers + +image_format = "iso" + +# udev rules for correct ordering of onboard NICs +[[includes_chroot]] + path = "lib/udev/rules.d/64-vyos-SAF51015I-net.rules" + data = ''' +ATTR{[dmi/id]board_name}!="SAF51015I-0318-EC", GOTO="end_ec_nic" + +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:02:00.0", ENV{VYOS_IFNAME}="eth1" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:03:00.0", ENV{VYOS_IFNAME}="eth2" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:04:00.0", ENV{VYOS_IFNAME}="eth3" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:05:00.0", ENV{VYOS_IFNAME}="eth4" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:06:00.0", ENV{VYOS_IFNAME}="eth5" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:06:00.1", ENV{VYOS_IFNAME}="eth6" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:06:00.2", ENV{VYOS_IFNAME}="eth7" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:06:00.3", ENV{VYOS_IFNAME}="eth8" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:0a:00.0", ENV{VYOS_IFNAME}="eth9" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:0a:00.1", ENV{VYOS_IFNAME}="eth10" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:0b:00.0", ENV{VYOS_IFNAME}="eth11" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:0b:00.1", ENV{VYOS_IFNAME}="eth12" + +LABEL="end_ec_nic" + +''' + +[[includes_chroot]] + path = "lib/udev/rules.d/64-vyos-SAF51003I-net.rules" + data = ''' +ATTR{[dmi/id]board_name}!="SAF51003I", GOTO="end_ec_nic" + +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:02:00.0", ENV{VYOS_IFNAME}="eth1", ATTR{ifalias}="LAN1" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:02:00.1", ENV{VYOS_IFNAME}="eth2", ATTR{ifalias}="LAN2" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:02:00.2", ENV{VYOS_IFNAME}="eth3", ATTR{ifalias}="LAN3" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:02:00.3", ENV{VYOS_IFNAME}="eth4", ATTR{ifalias}="LAN4" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:05:00.0", ENV{VYOS_IFNAME}="eth5", ATTR{ifalias}="LAN5" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:05:00.1", ENV{VYOS_IFNAME}="eth6", ATTR{ifalias}="LAN6" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:05:00.2", ENV{VYOS_IFNAME}="eth7", ATTR{ifalias}="LAN7" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:05:00.3", ENV{VYOS_IFNAME}="eth8", ATTR{ifalias}="LAN8" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:08:00.0", ENV{VYOS_IFNAME}="eth9", ATTR{ifalias}="DMZ" +ACTION=="add", SUBSYSTEM=="net", KERNELS=="0000:08:00.1", ENV{VYOS_IFNAME}="eth10", ATTR{ifalias}="WAN" + +LABEL="end_ec_nic" + +''' diff --git a/data/build-flavors/iso.toml b/data/build-flavors/iso.toml new file mode 100644 index 00000000..9bf7044d --- /dev/null +++ b/data/build-flavors/iso.toml @@ -0,0 +1,14 @@ +# Generic (aka "universal") ISO image + +image_format = "iso" + +# Include these packages in the image regardless of the architecture +packages = [ + # QEMU and Xen guest tools exist for multiple architectures + "qemu-guest-agent", + "vyos-xe-guest-utilities", +] + +[architectures.amd64] + # Hyper-V and VMware guest tools are x86-only + packages = ["hyperv-daemons", "vyos-1x-vmware"] diff --git a/data/build-flavors/xcpng.toml b/data/build-flavors/xcpng.toml new file mode 100644 index 00000000..81689b5e --- /dev/null +++ b/data/build-flavors/xcpng.toml @@ -0,0 +1,6 @@ +# Installation ISO for the XCP-ng virtualization platform + +image_formats = "iso" + +# Include these packages in the image +packages = ["xe-guest-utilities"] diff --git a/data/build-types/development.toml b/data/build-types/development.toml new file mode 100644 index 00000000..f0207a6a --- /dev/null +++ b/data/build-types/development.toml @@ -0,0 +1,8 @@ +packages = [ + "gdb", + "strace", + "apt-rdepends", + "tshark", + "vim", + "vyos-1x-smoketest" +] diff --git a/data/build-types/release.toml b/data/build-types/release.toml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/data/build-types/release.toml diff --git a/data/defaults.json b/data/defaults.json deleted file mode 100644 index 674eba8b..00000000 --- a/data/defaults.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "architecture": "amd64", - "debian_mirror": "http://deb.debian.org/debian", - "debian_security_mirror": "http://deb.debian.org/debian", - "debian_distribution": "bullseye", - "vyos_mirror": "http://dev.packages.vyos.net/repositories/current", - "vyos_branch": "current", - "kernel_version": "5.15.72", - "kernel_flavor": "amd64-vyos", - "release_train": "sagitta", - "bootloaders": "syslinux,grub-efi", - "additional_repositories": [ - "deb [arch=amd64] https://repo.saltproject.io/py3/debian/11/amd64/3004 bullseye main", - "deb [arch=amd64] http://repo.powerdns.com/debian bullseye-rec-47 main" - ], - "custom_packages": [] -} diff --git a/data/defaults.toml b/data/defaults.toml new file mode 100644 index 00000000..8710f0ca --- /dev/null +++ b/data/defaults.toml @@ -0,0 +1,21 @@ +build_type = "development" + +architecture = "amd64" + +debian_distribution = "bullseye" + +debian_mirror = "http://deb.debian.org/debian" +debian_security_mirror = "http://deb.debian.org/debian-security" + +vyos_mirror = "http://dev.packages.vyos.net/repositories/current" + +vyos_branch = "current" +release_train = "current" + +kernel_version = "5.15.72" + +additional_repositories = [ + "deb [arch=amd64] https://repo.saltproject.io/py3/debian/11/amd64/3004 bullseye main", + "deb [arch=amd64] http://repo.powerdns.com/debian bullseye-rec-45 main" +] + diff --git a/data/generic-arm64.json b/data/generic-arm64.json deleted file mode 100644 index 6a32b7c0..00000000 --- a/data/generic-arm64.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "inherit_from": "data/defaults.json", - "architecture": "arm64", - "kernel_flavor": "v8-arm64-vyos", - "bootloaders": "grub-efi", - "additional_repositories": [ - "deb [arch=arm64] http://repo.powerdns.com/debian bullseye-rec-45 main", - "deb [arch=arm64] https://repos.influxdata.com/debian bullseye stable" - ] -} diff --git a/data/package-lists/vyos-arm.list.chroot b/data/package-lists/vyos-arm.list.chroot deleted file mode 100644 index 41fcddf8..00000000 --- a/data/package-lists/vyos-arm.list.chroot +++ /dev/null @@ -1 +0,0 @@ -grub-efi-arm diff --git a/data/package-lists/vyos-dev.list.chroot b/data/package-lists/vyos-dev.list.chroot deleted file mode 100644 index 40926aa1..00000000 --- a/data/package-lists/vyos-dev.list.chroot +++ /dev/null @@ -1,6 +0,0 @@ -gdb -strace -apt-rdepends -tshark -vim -vyos-1x-smoketest diff --git a/data/package-lists/vyos-x86.list.chroot b/data/package-lists/vyos-x86.list.chroot deleted file mode 100644 index 4fba090a..00000000 --- a/data/package-lists/vyos-x86.list.chroot +++ /dev/null @@ -1,8 +0,0 @@ -grub2 -grub-pc -qemu-guest-agent -hyperv-daemons -vyos-xe-guest-utilities -vyos-1x-vmware -vyos-linux-firmware -vyos-intel-qat |