Skip to content

Commit

Permalink
tmpfiles: Move root bash files copy to tmpfiles.d
Browse files Browse the repository at this point in the history
Fixes #136
  • Loading branch information
HuijingHei committed Aug 24, 2023
1 parent 3537f6e commit a887741
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 4 additions & 5 deletions overlay.d/05core/usr/lib/tmpfiles.d/root-bash.conf
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a887741

Please sign in to comment.