From 54958b813e33c6103bb00be8b31bd5c44696a196 Mon Sep 17 00:00:00 2001 From: Kai Lueke Date: Thu, 30 Mar 2023 19:15:24 +0900 Subject: [PATCH] Drop more tmpfiles rules that cause /etc upcopies We already drop tmpfile rules that we don't need because we ship the files through our /etc overlay. However, some rules weren't dropped because they used tabs and not spaces (/etc/selinux/, /etc/iscsi and /etc/ssl/*). Drop rule lines for /etc that use tabs. Also rules modifiers like ! to only do it during boot or - to allow failure will be removed but those with + or = will stay as they to explicit recreation. --- build_library/build_image_util.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build_library/build_image_util.sh b/build_library/build_image_util.sh index 15ba0ea45a..b717d80ee9 100755 --- a/build_library/build_image_util.sh +++ b/build_library/build_image_util.sh @@ -801,8 +801,9 @@ EOF done sudo "${root_fs_dir}"/usr/sbin/flatcar-tmpfiles "${root_fs_dir}" # Now that we used the tmpfiles for creating /etc we delete them because - # the L, d, and C entries cause upcopies - sudo sed -i '/^[CLd] *\/etc\//d' "${root_fs_dir}"/usr/lib/tmpfiles.d/* + # the L, d, and C entries cause upcopies. Also filter out rules with ! or - but no other modifiers + # like + or = which explicitly recreate files. + sudo sed -i '/^[CLd]-*!*-*[ \t]*\/etc\//d' "${root_fs_dir}"/usr/lib/tmpfiles.d/* # SELinux: Label the root filesystem for using 'file_contexts'. # The labeling has to be done before moving /etc to /usr/share/flatcar/etc to prevent wrong labels for these files and as