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