From: Andrew Gaffney Date: Thu, 13 Mar 2008 17:10:30 +0000 (+0000) Subject: Add a check after mounting NEW_ROOT to see if /dev exists and /sbin/init is executabl... X-Git-Tag: v3.4.10.902~107 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=72e8e5d04c9e09757a5f19886dc3a5b9c68f2e10;p=genkernel.git Add a check after mounting NEW_ROOT to see if /dev exists and /sbin/init is executable before moving on git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@645 67a159dc-881f-0410-a524-ba9dfbe2cb84 --- diff --git a/ChangeLog b/ChangeLog index d44922a..6179b1d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,10 @@ # Copyright 2006-2008 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ + 13 Mar 2008; Andrew Gaffney generic/linuxrc: + Add a check after mounting NEW_ROOT to see if /dev exists and /sbin/init is + executable before moving on + 13 Mar 2008; Andrew Gaffney gen_initramfs.sh: Change the location we copy the intiramfs to for integrated initramfs diff --git a/generic/linuxrc b/generic/linuxrc index 768e2ce..2af1d75 100644 --- a/generic/linuxrc +++ b/generic/linuxrc @@ -403,7 +403,14 @@ do # else not a good root and start over. if [ "$?" = '0' ] then - break + if [ -d ${NEW_ROOT}/dev -a -x ${NEW_ROOT}/sbin/init ] + then + break + else + bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" + got_good_root=0 + REAL_ROOT='' + fi else bad_msg "Could not mount specified ROOT, try again" got_good_root=0