aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2019-07-15 17:30:39 +0200
committerThomas Deutschmann <whissi@gentoo.org>2019-07-15 17:30:39 +0200
commit76a837bc21ffd8a7d350cd3c648947f45e6a07a7 (patch)
tree25945010757f1c535b989637758107b84bd02831
parentgen_funcs.sh: trap_cleanup(): Log received signal (diff)
downloadgenkernel-76a837bc21ffd8a7d350cd3c648947f45e6a07a7.tar.gz
genkernel-76a837bc21ffd8a7d350cd3c648947f45e6a07a7.tar.bz2
genkernel-76a837bc21ffd8a7d350cd3c648947f45e6a07a7.zip
linuxrc: Relax NEWROOT validation
If the root device specified by the user is invalid then all we are going to lose is the possibility to ask for a new root device in a nice way. So no need to be smart here. Closes: https://bugs.gentoo.org/479730 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
-rw-r--r--defaults/linuxrc4
1 files changed, 3 insertions, 1 deletions
diff --git a/defaults/linuxrc b/defaults/linuxrc
index 2d87c41..01f8328 100644
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -790,7 +790,9 @@ do
# else not a good root and start over.
if [ "${mountret}" = '0' ]
then
- if [ -d ${NEW_ROOT}/dev -a -x "${NEW_ROOT}${REAL_INIT:-/sbin/init}" ] || [ "${REAL_ROOT}" = "/dev/nfs" ]
+ if [ -x "${NEW_ROOT}${REAL_INIT:-/sbin/init}" ] \
+ || [ -L "${NEW_ROOT}${REAL_INIT:-/sbin/init}" -o -x "${NEW_ROOT}/bin/sh" ] \
+ || [ "${REAL_ROOT}" = "/dev/nfs" ]
then
break
else