public inbox for gentoo-catalyst@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Andreas K. Hüttel" <dilfridge@gentoo.org>
To: gentoo-catalyst@lists.gentoo.org
Cc: "Andreas K. Hüttel" <dilfridge@gentoo.org>
Subject: [gentoo-catalyst] [PATCH 1/2] Call systemd-tmpfiles when the chroot is set up
Date: Mon, 17 Jan 2022 15:43:54 +0100	[thread overview]
Message-ID: <20220117144355.1292840-1-dilfridge@gentoo.org> (raw)

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
---
 targets/support/chroot-functions.sh | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/targets/support/chroot-functions.sh b/targets/support/chroot-functions.sh
index d8472d46..51908195 100755
--- a/targets/support/chroot-functions.sh
+++ b/targets/support/chroot-functions.sh
@@ -227,6 +227,14 @@ update_env_settings(){
 	[ -f /tmp/envscript ] && source /tmp/envscript
 }
 
+update_tmpfiles() {
+	# if ROOT is unset, make sure it becomes "/"
+	[ -x /bin/systemd-tmpfiles ] && \
+		echo "Setting up tmpfiles in ${ROOT:-/} ..." && \
+		/bin/systemd-tmpfiles --remove --create --boot "--root=${ROOT:-/}" \
+			--exclude-prefix=/dev --exclude-prefix=/proc --exclude-prefix=/sys
+}
+
 die() {
 	echo "$1"
 	exit 1
@@ -290,6 +298,7 @@ C.UTF8 UTF-8
 if [[ ${RUN_DEFAULT_FUNCS} != no ]]
 then
 	update_env_settings
+	update_tmpfiles
 	setup_features
 	show_debug
 fi
-- 
2.34.1



             reply	other threads:[~2022-01-17 14:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-17 14:43 Andreas K. Hüttel [this message]
2022-01-17 14:43 ` [gentoo-catalyst] [PATCH 2/2] Make a proper /run (and more) also in stage1 /tmp/stage1root Andreas K. Hüttel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220117144355.1292840-1-dilfridge@gentoo.org \
    --to=dilfridge@gentoo.org \
    --cc=gentoo-catalyst@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox