Merge pull request #698 from flatcar/kai/upcopies

Drop more tmpfiles rules that cause /etc upcopies
This commit is contained in:
Kai Lüke 2023-03-31 09:52:42 +02:00 committed by GitHub
commit 9e411fb6cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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