diff --git a/debian/changelog b/debian/changelog index 3a5ecd33..c325aeee 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,9 @@ livecd-rootfs (23.10.52) UNRELEASED; urgency=medium * fix: Sort filelists creating when building ubuntu-cpc images (LP: #2033677) + * 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 Thu, 31 Aug 2023 18:20:23 +0100 diff --git a/live-build/auto/build b/live-build/auto/build index 71761537..479ac5a5 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -616,6 +616,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 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 962f096a..4bf9ad77 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 6d73d004..4edd12ce 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 @@ -179,6 +179,10 @@ install_grub() { rm mountpoint/tmp/device.map umount -R mountpoint/boot 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/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