From 8d7efb4d151bf0e8b4aa8d83bd173f38f57ef5f0 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Wed, 5 Feb 2025 11:17:11 +1300 Subject: [PATCH] Move configuration of casper in ubuntu-serve:live builds to a "chroot early" hook for the installer layer and remove the now unnecessary update-initramfs from the binary hook that breaks because mkinitramfs now requires that /sys is mounted. (LP: #2097280) --- debian/changelog | 4 ++++ .../hooks/02-installer-bits.chroot_early | 17 +++++++++++++++++ .../hooks/03-kernel-metapkg.chroot_early | 4 ---- .../ubuntu-server/hooks/04-kernel-bits.binary | 3 --- 4 files changed, 21 insertions(+), 7 deletions(-) create mode 100755 live-build/ubuntu-server/hooks/02-installer-bits.chroot_early diff --git a/debian/changelog b/debian/changelog index 5cedf010..2027b79e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,10 @@ livecd-rootfs (25.04.12) UNRELEASED; urgency=medium * Stop producing a rootfs tarball for the ubuntu-mini-iso builds. + * Move configuration of casper in ubuntu-serve:live builds to a "chroot + early" hook for the installer layer and remove the now unnecessary + update-initramfs from the binary hook that breaks because mkinitramfs + now requires that /sys is mounted. (LP: #2097280) -- Michael Hudson-Doyle Wed, 05 Feb 2025 11:20:05 +1300 diff --git a/live-build/ubuntu-server/hooks/02-installer-bits.chroot_early b/live-build/ubuntu-server/hooks/02-installer-bits.chroot_early new file mode 100755 index 00000000..84a3486a --- /dev/null +++ b/live-build/ubuntu-server/hooks/02-installer-bits.chroot_early @@ -0,0 +1,17 @@ +#!/bin/bash -ex +# vi: ts=4 noexpandtab + +case $PASS in + ubuntu-server-minimal.ubuntu-server.installer.*) + exit 0 + ;; + ubuntu-server-minimal.ubuntu-server.installer) + ;; + *) + exit 0 + ;; +esac + +cat < /etc/initramfs-tools/conf.d/casperize.conf +export CASPER_GENERATE_UUID=1 +EOF 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 df94a734..2c7a8878 100755 --- a/live-build/ubuntu-server/hooks/03-kernel-metapkg.chroot_early +++ b/live-build/ubuntu-server/hooks/03-kernel-metapkg.chroot_early @@ -12,10 +12,6 @@ case $PASS in ;; esac -cat < /etc/initramfs-tools/conf.d/casperize.conf -export CASPER_GENERATE_UUID=1 -EOF - cat < /etc/initramfs-tools/conf.d/default-layer.conf LAYERFS_PATH=${PASS}.squashfs EOF diff --git a/live-build/ubuntu-server/hooks/04-kernel-bits.binary b/live-build/ubuntu-server/hooks/04-kernel-bits.binary index 60d76181..551c7a42 100644 --- a/live-build/ubuntu-server/hooks/04-kernel-bits.binary +++ b/live-build/ubuntu-server/hooks/04-kernel-bits.binary @@ -15,9 +15,6 @@ esac PROJECT=$PROJECT${SUBARCH:+-$SUBARCH} -# ensure this initrd is casperized -chroot chroot update-initramfs -u - # Fish out generated kernel image and initrd mv chroot/boot/initrd.img-* ${PWD}/livecd.${PROJECT}.initrd-$flavor mv chroot/boot/vmlinu?-* ${PWD}/livecd.${PROJECT}.kernel-$flavor