commit:     76a837bc21ffd8a7d350cd3c648947f45e6a07a7
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 15 15:30:39 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Mon Jul 15 15:30:39 2019 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=76a837bc

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 <AT> gentoo.org>

 defaults/linuxrc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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

Reply via email to