From a88774145d944eb3ff45c7d99ef3acf94f0e1d06 Mon Sep 17 00:00:00 2001 From: Huijing Hei Date: Thu, 17 Aug 2023 22:46:42 +0800 Subject: [PATCH] tmpfiles: Move root bash files copy to tmpfiles.d Fixes https://github.com/coreos/fedora-coreos-config/issues/136 --- .../40ignition-ostree/ignition-ostree-populate-var.sh | 8 +------- overlay.d/05core/usr/lib/tmpfiles.d/root-bash.conf | 9 ++++----- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/ignition-ostree-populate-var.sh b/overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/ignition-ostree-populate-var.sh index 01212db7d5..6f4e151c92 100755 --- a/overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/ignition-ostree-populate-var.sh +++ b/overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/ignition-ostree-populate-var.sh @@ -33,13 +33,7 @@ for varsubdir in lib log home roothome opt srv usrlocal mnt media; do mkdir -p /sysroot/var/${varsubdir} else systemd-tmpfiles --create --boot --root=/sysroot --prefix="/var/${varsubdir}" - fi - - if [[ $varsubdir == roothome ]]; then - # TODO move this to tmpfiles.d once systemd-tmpfiles handles C! with --root correctly. - # See https://github.com/coreos/fedora-coreos-config/pull/137 - cp /sysroot/etc/skel/.bash* /sysroot/var/${varsubdir} - fi + fi coreos-relabel "/var/${varsubdir}" done diff --git a/overlay.d/05core/usr/lib/tmpfiles.d/root-bash.conf b/overlay.d/05core/usr/lib/tmpfiles.d/root-bash.conf index d5a2d870c2..d59075ba29 100644 --- a/overlay.d/05core/usr/lib/tmpfiles.d/root-bash.conf +++ b/overlay.d/05core/usr/lib/tmpfiles.d/root-bash.conf @@ -1,5 +1,4 @@ -# This really should be C! instead of L, but https://github.com/systemd/systemd/issues/12467 prevents that. -# TODO: switch to C! when https://github.com/systemd/systemd/pull/12750 makes it into fcos -L /var/roothome/.bashrc - - - - /usr/etc/skel/.bashrc -L /var/roothome/.bash_profile - - - - /usr/etc/skel/.bash_profile -L /var/roothome/.bash_logout - - - - /usr/etc/skel/.bash_logout +# Use C! according to https://github.com/coreos/fedora-coreos-config/pull/137/files#diff-4c7caeddac3f43acdf59b41ffa4e3533bb846d2e3bfa31f885a65e9598a2c4a1R1-R2 +C! /var/roothome/.bashrc - - - - /usr/etc/skel/.bashrc +C! /var/roothome/.bash_profile - - - - /usr/etc/skel/.bash_profile +C! /var/roothome/.bash_logout - - - - /usr/etc/skel/.bash_logout