Gentoo Archives: gentoo-catalyst

From: "Andreas K. Hüttel" <dilfridge@g.o>
To: gentoo-catalyst@l.g.o
Cc: "Andreas K. Hüttel" <dilfridge@g.o>
Subject: [gentoo-catalyst] [PATCH 1/2] Call systemd-tmpfiles when the chroot is set up
Date: Mon, 17 Jan 2022 14:44:08
Message-Id: 20220117144355.1292840-1-dilfridge@gentoo.org
1 Signed-off-by: Andreas K. Hüttel <dilfridge@g.o>
2 ---
3 targets/support/chroot-functions.sh | 9 +++++++++
4 1 file changed, 9 insertions(+)
5
6 diff --git a/targets/support/chroot-functions.sh b/targets/support/chroot-functions.sh
7 index d8472d46..51908195 100755
8 --- a/targets/support/chroot-functions.sh
9 +++ b/targets/support/chroot-functions.sh
10 @@ -227,6 +227,14 @@ update_env_settings(){
11 [ -f /tmp/envscript ] && source /tmp/envscript
12 }
13
14 +update_tmpfiles() {
15 + # if ROOT is unset, make sure it becomes "/"
16 + [ -x /bin/systemd-tmpfiles ] && \
17 + echo "Setting up tmpfiles in ${ROOT:-/} ..." && \
18 + /bin/systemd-tmpfiles --remove --create --boot "--root=${ROOT:-/}" \
19 + --exclude-prefix=/dev --exclude-prefix=/proc --exclude-prefix=/sys
20 +}
21 +
22 die() {
23 echo "$1"
24 exit 1
25 @@ -290,6 +298,7 @@ C.UTF8 UTF-8
26 if [[ ${RUN_DEFAULT_FUNCS} != no ]]
27 then
28 update_env_settings
29 + update_tmpfiles
30 setup_features
31 show_debug
32 fi
33 --
34 2.34.1

Replies