From b913dcdf1c411491489becbe3089ed9c9b7c5737 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Wed, 13 Dec 2017 15:42:37 +1300 Subject: [PATCH] gen the initramfs with the right options and repack it with lzma --- debian/changelog | 2 +- .../ubuntu-server/hooks/032-installer-squashfs.binary | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4776a030..8cca7e75 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -livecd-rootfs (2.488~ppa2) bionic; urgency=medium +livecd-rootfs (2.488~ppa4) bionic; urgency=medium * Move casper from filesystem.squashfs to installer.squashfs. diff --git a/live-build/ubuntu-server/hooks/032-installer-squashfs.binary b/live-build/ubuntu-server/hooks/032-installer-squashfs.binary index bbf8f09c..f87fe5e8 100755 --- a/live-build/ubuntu-server/hooks/032-installer-squashfs.binary +++ b/live-build/ubuntu-server/hooks/032-installer-squashfs.binary @@ -41,7 +41,16 @@ chroot $SQUASH_ROOT apt-get update chroot $SQUASH_ROOT apt-get -y install user-setup chroot $SQUASH_ROOT apt-get -y install lupin-casper -mv $SQUASH_ROOT/boot/initrd.img-* livecd.ubuntu-server.initrd-generic +# Installing lupin-casper means we need a new initramfs, so we +# cargo cult stuff from lb_chroot_hacks: +chroot $SQUASH_ROOT CASPER_GENERATE_UUID=1 update-initramfs -k all -t -u +for INITRAMFS in $(find $SQUASH_ROOT/boot -name 'initrd*' -not -type l); do + zcat "${INITRAMFS}" | lzma -c -6 > "${INITRAMFS}.new" + mv "${INITRAMFS}.new" "${INITRAMFS}" +done +# and lb_binary_linux-image: +mv $SQUASH_ROOT/boot/initrd.img-* binary/casper/ +# To replace the previously built one with it. chroot $SQUASH_ROOT apt-get -y install curtin