* [gentoo-catalyst] [PATCH 2/2] Make a proper /run (and more) also in stage1 /tmp/stage1root
2022-01-17 14:43 [gentoo-catalyst] [PATCH 1/2] Call systemd-tmpfiles when the chroot is set up (stable branch) Andreas K. Hüttel
@ 2022-01-17 14:43 ` Andreas K. Hüttel
0 siblings, 0 replies; 3+ messages in thread
From: Andreas K. Hüttel @ 2022-01-17 14:43 UTC (permalink / raw
To: gentoo-catalyst; +Cc: Andreas K. Hüttel
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
---
targets/stage1/stage1-chroot.sh | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/targets/stage1/stage1-chroot.sh b/targets/stage1/stage1-chroot.sh
index 99539886..27389620 100755
--- a/targets/stage1/stage1-chroot.sh
+++ b/targets/stage1/stage1-chroot.sh
@@ -52,6 +52,11 @@ fi
[ -e ${clst_make_conf} ] && ${clst_sed} -i -e "/^USE=\"${BINDIST} ${USE}\"/d" ${clst_make_conf}
make_destpath /tmp/stage1root
+# Set up /run and its contents inside stage1root, see bug 816303
+make_destpath /tmp/stage1root/run
+mount -t tmpfs stage1run /tmp/stage1root/run || die
+ROOT=/tmp/stage1root update_tmpfiles
+
## START BUILD
# First, we drop in a known-good baselayout
[ -e ${clst_make_conf} ] && echo "USE=\"${USE} -build\"" >> ${clst_make_conf}
@@ -97,3 +102,6 @@ done
# Clear USE
[ -e ${clst_make_conf} ] && ${clst_sed} -i -e "/^CATALYST_USE/d" ${clst_make_conf}
[ -e ${clst_make_conf} ] && ${clst_sed} -i -e "/^USE=\"/s/\${CATALYST_USE} ${USE} ${BOOTSTRAP_USE}//" ${clst_make_conf}
+
+# Remove run tmpfs again, bug 816303
+umount /tmp/stage1root/run || die
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-catalyst] [PATCH 1/2] Call systemd-tmpfiles when the chroot is set up
@ 2022-01-17 14:43 Andreas K. Hüttel
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
0 siblings, 1 reply; 3+ messages in thread
From: Andreas K. Hüttel @ 2022-01-17 14:43 UTC (permalink / raw
To: gentoo-catalyst; +Cc: Andreas K. Hüttel
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-catalyst] [PATCH 2/2] Make a proper /run (and more) also in stage1 /tmp/stage1root
2022-01-17 14:43 [gentoo-catalyst] [PATCH 1/2] Call systemd-tmpfiles when the chroot is set up Andreas K. Hüttel
@ 2022-01-17 14:43 ` Andreas K. Hüttel
0 siblings, 0 replies; 3+ messages in thread
From: Andreas K. Hüttel @ 2022-01-17 14:43 UTC (permalink / raw
To: gentoo-catalyst; +Cc: Andreas K. Hüttel
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
---
targets/stage1/chroot.sh | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/targets/stage1/chroot.sh b/targets/stage1/chroot.sh
index 08b9da46..67b06986 100755
--- a/targets/stage1/chroot.sh
+++ b/targets/stage1/chroot.sh
@@ -59,6 +59,11 @@ fi
export ROOT="${clst_root_path}"
mkdir -p "$ROOT"
+# Set up /run and its contents inside stage1root, see bug 816303
+mkdir "${ROOT}/run"
+mount -t tmpfs stage1run "${ROOT}/run" || die
+update_tmpfiles
+
## START BUILD
# First, we drop in a known-good baselayout
[ -e ${clst_make_conf} ] && echo "USE=\"${USE} -build\"" >> ${clst_make_conf}
@@ -104,3 +109,6 @@ done
# Clear USE
[ -e ${clst_make_conf} ] && sed -i -e "/^CATALYST_USE/d" ${clst_make_conf}
[ -e ${clst_make_conf} ] && sed -i -e "/^USE=\"/s/\${CATALYST_USE} ${USE} ${BOOTSTRAP_USE}//" ${clst_make_conf}
+
+# Remove run tmpfs again, bug 816303
+umount "${ROOT}/run" || die
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-01-17 14:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-17 14:43 [gentoo-catalyst] [PATCH 1/2] Call systemd-tmpfiles when the chroot is set up Andreas K. Hüttel
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
-- strict thread matches above, loose matches on Subject: below --
2022-01-17 14:43 [gentoo-catalyst] [PATCH 1/2] Call systemd-tmpfiles when the chroot is set up (stable branch) Andreas K. Hüttel
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox