From c72d1a7f2b11ca35d860c141e9262aeade6b3ed5 Mon Sep 17 00:00:00 2001 From: Philip Roche Date: Fri, 1 Sep 2023 11:15:12 +0100 Subject: [PATCH 1/4] fix: Ensure any created .filelist is symlinked with expected prefix and correct permissions (LP: #2033751) If a .filelist is present, use it as the filelist for the image by symlinking with expected name and updating permissions --- live-build/auto/build | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/live-build/auto/build b/live-build/auto/build index d67e5d0e..836dd957 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -597,6 +597,14 @@ if [ -e "binary/$INITFS/filesystem.packages" ]; then ln "binary/$INITFS/filesystem.packages" "$PREFIX.manifest" chmod 644 "$PREFIX.manifest" fi + +# If a .filelist is present, use it as the filelist for the image by +# symlinking with expected name and updating permissions +if [ -e "binary/$INITFS/filesystem.filelist" ]; then + ln "binary/$INITFS/filesystem.filelist" "$PREFIX.filelist" + chmod 644 "$PREFIX.filelist" +fi + if [ -e "binary/$INITFS/filesystem.packages-remove" ]; then # Not a typo, empty manifest-remove has a single LF in it. :/ if [ $(cat binary/$INITFS/filesystem.packages-remove | wc -c) -gt 1 ]; then From 7dd9b1bd84bc3055f433faa49855995e1ea427e7 Mon Sep 17 00:00:00 2001 From: Philip Roche Date: Fri, 1 Sep 2023 12:12:42 +0100 Subject: [PATCH 2/4] fix: Create .filelist in ubuntu-cpc project binary hooks that do not use create_manifest shared function (LP: #2033751) ubuntu-cpc project binary hooks were not all producing .filelist files as they were not using the create_manifest shared function. This commit ensures the disk-image-uefi, disk-image-ppc64el and disk-image-uefi-non-cloud hooks create a filelist during build. --- live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary | 5 +++++ .../ubuntu-cpc/hooks.d/base/disk-image-uefi-non-cloud.binary | 4 ++++ live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary index b5b7cffc..e02c6338 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image-ppc64el.binary @@ -75,6 +75,11 @@ make_ext4_partition "${rootfs_dev_mapper}" mkdir mountpoint mount "${rootfs_dev_mapper}" mountpoint cp -a chroot/* mountpoint/ + +# the image has been modified from its disk-image-uefi base so the manifest and filelist should be regenerated +chroot mountpoint dpkg-query -W > binary/boot/filesystem.packages +(cd mountpoint && find -xdev) | sort > binary/boot/filesystem.filelist + umount mountpoint rmdir mountpoint diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi-non-cloud.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi-non-cloud.binary index 781419cf..47b79673 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi-non-cloud.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi-non-cloud.binary @@ -431,6 +431,10 @@ EOF rm mountpoint/tmp/device.map umount mountpoint/boot/efi mount + + # create sorted filelist as the very last step before unmounting + (cd mountpoint && find -xdev) | sort > binary/boot/filesystem.filelist + umount_partition mountpoint rmdir mountpoint } diff --git a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary index 020dd33f..3bdc2d6d 100755 --- a/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary +++ b/live-build/ubuntu-cpc/hooks.d/base/disk-image-uefi.binary @@ -151,6 +151,10 @@ install_grub() { rm mountpoint/tmp/device.map umount mountpoint/boot/efi mount + + # create sorted filelist as the very last step before unmounting + (cd mountpoint && find -xdev) | sort > binary/boot/filesystem.filelist + umount_partition mountpoint rmdir mountpoint } From 57153243a6b7cfffbb491362e8236d188544cb48 Mon Sep 17 00:00:00 2001 From: Philip Roche Date: Fri, 1 Sep 2023 12:13:44 +0100 Subject: [PATCH 3/4] fix: disk-image-non-cloud ubuntu-cpc build target now provides manifest and filelist (LP: #2033751) These were being created so now they can be downloaded post launchpad image build --- live-build/ubuntu-cpc/hooks.d/base/series/disk-image-non-cloud | 2 ++ 1 file changed, 2 insertions(+) diff --git a/live-build/ubuntu-cpc/hooks.d/base/series/disk-image-non-cloud b/live-build/ubuntu-cpc/hooks.d/base/series/disk-image-non-cloud index 2bd97f77..9647eae1 100644 --- a/live-build/ubuntu-cpc/hooks.d/base/series/disk-image-non-cloud +++ b/live-build/ubuntu-cpc/hooks.d/base/series/disk-image-non-cloud @@ -2,3 +2,5 @@ base/disk-image-uefi-non-cloud.binary base/disk-image.binary base/disk1-img-xz.binary provides livecd.ubuntu-cpc.disk1.img.xz +provides livecd.ubuntu-cpc.manifest +provides livecd.ubuntu-cpc.filelist \ No newline at end of file From ad7ac10fba0559a314c5fc00adaa428942d3c004 Mon Sep 17 00:00:00 2001 From: Philip Roche Date: Fri, 1 Sep 2023 12:24:59 +0100 Subject: [PATCH 4/4] Update changelog for livecd-rootfs 23.10.31 (LP: #2033751) --- debian/changelog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index e758dae4..250a0674 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +livecd-rootfs (23.10.31) mantic; urgency=medium + + * fix: Create .filelist in ubuntu-cpc project binary hooks that do not use create_manifest shared function (LP: #2033751) + * fix: Ensure any created .filelist is symlinked with expected prefix and correct permissions + * fix: disk-image-non-cloud ubuntu-cpc build target now provides manifest and filelist + + -- Philip Roche Fri, 01 Sep 2023 12:22:15 +0100 + livecd-rootfs (23.10.30) mantic; urgency=medium * fix: Sort filelists creating when building ubuntu-cpc images (LP: #2033677)