aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2021-03-14 20:30:53 +0100
committerThomas Deutschmann <whissi@gentoo.org>2021-03-14 20:39:48 +0100
commitc81285f02aaad8bd8161d06976147e9c1aca7a8a (patch)
tree233089e70e893ad2740b08bbf414a288940986e0
parentinitrd.scripts: Add is_userinteraction_allowed() function (diff)
downloadgenkernel-c81285f02aaad8bd8161d06976147e9c1aca7a8a.tar.gz
genkernel-c81285f02aaad8bd8161d06976147e9c1aca7a8a.tar.bz2
genkernel-c81285f02aaad8bd8161d06976147e9c1aca7a8a.zip
initrd.scripts: run_shell(): Exit early when /dev is gone
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
-rw-r--r--defaults/initrd.scripts4
1 files changed, 4 insertions, 0 deletions
diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index 53cb633..ff956b0 100644
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -1072,6 +1072,10 @@ run_shell() {
${SH} --login
fi
+ # Leave function early when /dev/null does not exist anymore,
+ # i.e. after failed switch_root call
+ [ ! -e /dev/null ] && return
+
rm "${GK_SHELL_LOCKFILE}"
echo