diff options
author | Thomas Deutschmann <whissi@gentoo.org> | 2021-02-08 02:25:50 +0100 |
---|---|---|
committer | Thomas Deutschmann <whissi@gentoo.org> | 2021-02-08 22:20:28 +0100 |
commit | ab6d73225f21be7d55649363ceb460d91270638d (patch) | |
tree | 9b653f50497464c7cafc04620f431e1c5bb66b43 /defaults/linuxrc | |
parent | linuxrc: add kernel command-line argument to allow user to pass additional op... (diff) | |
download | genkernel-ab6d73225f21be7d55649363ceb460d91270638d.tar.gz genkernel-ab6d73225f21be7d55649363ceb460d91270638d.tar.bz2 genkernel-ab6d73225f21be7d55649363ceb460d91270638d.zip |
linuxrc: Add gk.preserverun.disabled
When this boolean option is set and enabled, genkernel initramfs will unmount /run
before calling switch_root.
This can help in SELinux context for example where labeling is required which is
not supported by genkernel.
Bug: https://bugs.gentoo.org/739424
Bug: https://bugs.gentoo.org/740576
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'defaults/linuxrc')
-rw-r--r-- | defaults/linuxrc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/defaults/linuxrc b/defaults/linuxrc index e33576d..d8fee73 100644 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -372,6 +372,15 @@ do fi unset tmp_disabled ;; + gk.preserverun.disabled=*) + tmp_disabled=${x#*=} + if is_true "${tmp_disabled}" + then + warn_msg "gk.preserverun.disabled is set; /run will not be moved to newroot!" + GK_PRESERVE_RUN=0 + fi + unset tmp_disabled + ;; gk.prompt.timeout=*) tmp_timeout=${x#*=} if is_int "${tmp_timeout}" @@ -1336,6 +1345,12 @@ fi # Run debug shell if requested rundebugshell "before entering switch_root" +if [ "${GK_PRESERVE_RUN}" = '0' ] +then + GK_INIT_LOG= + run umount /run +fi + # init_opts is set in the environment by the kernel when it parses the command line init=${REAL_INIT:-/sbin/init} if ! mountpoint "${CHROOT}" 1>/dev/null 2>&1 |