From 46c95969265fff53173a06419db46133c12f42ae Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Fri, 16 Mar 2018 19:30:50 +0000 Subject: Add options to build ONIE images Open Network Install Environment is an open image format used by networking vendor to ship a standardised image for networking white box switches. ONIE hardware takes this image at boot and a script to chain load into the final environment via kexec. We can support Debian and derivatives on such systems by packing an ISO which then gets unpacked, kexec'ed and live-booted. A base ONIE system can be tested in QEMU by building a VM following these instrunctions: https://github.com/opencomputeproject/onie/blob/master/machine/kvm_x86_64/INSTALL Once built, boot onie-recovery-x86_64-kvm_x86_64-r0.iso in QEMU/libvirt and on the console there will be the terminal prompt. Check the IP assigned by libvirt and then scp the live image (ssh access is enabled as root without password...). Then the .bin can be booted with: ONIE-RECOVERY:/ # onie-nos-install /tmp/live.hybrid.iso-ONIE.bin The implementation is inspired by ONIE's own scripts that can be found at: https://github.com/opencomputeproject/onie/blob/master/contrib/debian-iso/cook-bits.sh A new option, --onie (false by default) can be set to true to enable building this new format in addition to an ISO. An additional option, --onie-kernel-cmdline can be used to specify additional options that the ONIE system should use when kexec'ing the final image. Note that only iso or hybrid-iso formats are supported. For more information about the ONIE ecosystem see: http://onie.org Signed-off-by: Erik Ziegenbalg Signed-off-by: Luca Boccassi --- scripts/build/config | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'scripts/build/config') diff --git a/scripts/build/config b/scripts/build/config index cad73b4cd..6c2ab3b7b 100755 --- a/scripts/build/config +++ b/scripts/build/config @@ -105,6 +105,8 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\ \t [--net-cow-path PATH]\n\ \t [--net-cow-server IP|HOSTNAME]\n\ \t [--net-tarball true|false]\n\ +\t [--onie true|false]\n\ +\t [--onie-kernel-cmdline \"OPTION1 OPTION2\"]\n\ \t [--quiet]\n\ \t [--archive-areas ARCHIVE_AREA|\"ARCHIVE_AREAS\"]\n\ \t [--parent-archive-areas ARCHIVE_AREA|\"ARCHIVE_AREAS\"]\n\ @@ -146,7 +148,7 @@ Local_arguments () grub-splash:,isohybrid-options:,hdd-label:,hdd-size:,hdd-partition-start:,iso-application:,iso-preparer:,iso-publisher:, iso-volume:,jffs2-eraseblock:,memtest:,net-root-filesystem:,net-root-mountoptions:, net-root-path:,net-root-server:,net-cow-filesystem:,net-cow-mountoptions:,net-cow-path:, - net-cow-server:,net-tarball:,firmware-binary:,firmware-chroot:,swap-file-path:,swap-file-size:, + net-cow-server:,net-tarball:,onie:,onie-kernel-cmdline:,firmware-binary:,firmware-chroot:,swap-file-path:,swap-file-size:, loadlin:,win32-loader:,source:,source-images:,breakpoints,conffile:,debug,force, help,ignore-system-defaults,quiet,usage,verbose,version,bootstrap-qemu-static:,bootstrap-qemu-arch:, uefi-secure-boot:, @@ -656,6 +658,16 @@ Local_arguments () shift 2 ;; + --onie) + LB_ONIE="${2}" + shift 2 + ;; + + --onie-kernel-cmdline) + LB_ONIE_KERNEL_CMDLINE="${2}" + shift 2 + ;; + --firmware-binary) LB_FIRMWARE_BINARY="${2}" shift 2 @@ -1291,6 +1303,14 @@ LB_NET_COW_SERVER="${LB_NET_COW_SERVER}" # (Default: ${LB_NET_TARBALL}) LB_NET_TARBALL="${LB_NET_TARBALL}" +# \$LB_ONIE: set onie +# (Default: ${LB_ONIE}) +LB_ONIE="${LB_ONIE}" + +# \$LB_ONIE_KERNEL_CMDLINE: set onie additional kernel cmdline options +# (Default: ${LB_ONIE_KERNEL_CMDLINE}) +LB_ONIE_KERNEL_CMDLINE="${LB_ONIE_KERNEL_CMDLINE}" + # \$LB_FIRMWARE_BINARY: include firmware packages in debian-installer # (Default: ${LB_FIRMWARE_BINARY}) LB_FIRMWARE_BINARY="${LB_FIRMWARE_BINARY}" -- cgit v1.2.3