From 7dd9b1bd84bc3055f433faa49855995e1ea427e7 Mon Sep 17 00:00:00 2001 From: Philip Roche Date: Fri, 1 Sep 2023 12:12:42 +0100 Subject: [PATCH] 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 }