diff --git a/debian/changelog b/debian/changelog index 884e0fd2..47b9b26c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ livecd-rootfs (2.765) UNRELEASED; urgency=medium * auto/config: preserve germinate-output directory when removing config to speed up local iteration. * auto/config: Emit error message to stderr in _sanitize_passes. + * Produce a tarball of artifacts for netbooting during live-server build. -- Michael Hudson-Doyle Tue, 24 May 2022 12:42:10 +1200 diff --git a/live-build/auto/config b/live-build/auto/config index 2cf02e95..dd9fa173 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -874,6 +874,18 @@ case $PROJECT in add_package ubuntu-server-minimal.ubuntu-server.installer.$flavor $kernel_metapkg LIVE_PASSES="${LIVE_PASSES:+$LIVE_PASSES }ubuntu-server-minimal.ubuntu-server.installer.$flavor" done + case $ARCH in + amd64) + add_package ubuntu-server-minimal.ubuntu-server.installer.generic.netboot grub-pc shim-signed pxelinux + ;; + arm64) + add_package ubuntu-server-minimal.ubuntu-server.installer.generic.netboot shim-signed + ;; + *) + add_package ubuntu-server-minimal.ubuntu-server.installer.generic.netboot + ;; + esac + NO_SQUASHFS_PASSES=ubuntu-server-minimal.ubuntu-server.installer.generic.netboot /usr/share/livecd-rootfs/checkout-translations-branch \ https://git.launchpad.net/subiquity po config/catalog-translations diff --git a/live-build/ubuntu-server/hooks/03-kernel-metapkg.chroot_early b/live-build/ubuntu-server/hooks/03-kernel-metapkg.chroot_early index 864d4c4c..ec02cc3c 100755 --- a/live-build/ubuntu-server/hooks/03-kernel-metapkg.chroot_early +++ b/live-build/ubuntu-server/hooks/03-kernel-metapkg.chroot_early @@ -2,6 +2,9 @@ # vi: ts=4 noexpandtab case $PASS in + ubuntu-server-minimal.ubuntu-server.installer.*.*) + exit 0 + ;; ubuntu-server-minimal.ubuntu-server.installer.*) flavor=${PASS##*.} if [ "$flavor" = "generic" ]; then diff --git a/live-build/ubuntu-server/hooks/04-kernel-bits.binary b/live-build/ubuntu-server/hooks/04-kernel-bits.binary index c0b2e3d7..a5d64a12 100755 --- a/live-build/ubuntu-server/hooks/04-kernel-bits.binary +++ b/live-build/ubuntu-server/hooks/04-kernel-bits.binary @@ -2,6 +2,9 @@ # vi: ts=4 noexpandtab case $PASS in + ubuntu-server-minimal.ubuntu-server.installer.*.*) + exit 0 + ;; ubuntu-server-minimal.ubuntu-server.installer.*) flavor=${PASS##*.} ;; diff --git a/live-build/ubuntu-server/hooks/05-netboot-tarball.binary b/live-build/ubuntu-server/hooks/05-netboot-tarball.binary new file mode 100755 index 00000000..60cd2506 --- /dev/null +++ b/live-build/ubuntu-server/hooks/05-netboot-tarball.binary @@ -0,0 +1,117 @@ +#!/bin/sh + +case $PASS in + ubuntu-server-minimal.ubuntu-server.installer.generic.netboot) + ;; + *) + exit 0 + ;; +esac + +set -eux + +flavor=generic + +KERNEL=${PWD}/livecd.${PROJECT}.kernel-$flavor +INITRD=${PWD}/livecd.${PROJECT}.initrd-$flavor + +mkdir -p tarball/$ARCH + +case $ARCH in + s390x) + cp $INITRD tarball/$ARCH/initrd.ubuntu + cp $KERNEL tarball/$ARCH/kernel.ubuntu + ;; + + *) + cp $INITRD tarball/$ARCH/initrd + cp $KERNEL tarball/$ARCH/kernel + ;; +esac + +case $ARCH in + amd64) + mv chroot/usr/lib/PXELINUX/pxelinux.0 tarball/pxelinux.0 + mv chroot/usr/lib/syslinux/modules/bios/ldlinux.c32 tarball/ldlinux.c32 + mv chroot/usr/lib/shim/shimx64.efi tarball/bootx64.efi + mv chroot/usr/lib/grub/x86_64-efi-signed/grubnetx64.efi.signed tarball/grubx64.efi + + mkdir tarball/x86_64-efi tarball/pxelinux.cfg + cat > tarball/x86_64-efi/grub.cfg.in < tarball/pxelinux.cfg/default.in < tarball/arm64-efi/grub.cfg.in < tarball/s390x/ubuntu.exec < tarball/s390x/ubuntu.ins < tarball/s390x/parmfile.ubuntu.in < tarball/s390x/initrd.off + perl -e "print pack('N', -s 'tarball/s390x/initrd.ubuntu')" > tarball/s390x/initrd.siz + cat > tarball/s390x-kvm.cfg.in < tarball/dpm.cfg.in <