Add a check after mounting NEW_ROOT to see if /dev exists and /sbin/init is executabl...
authorAndrew Gaffney <agaffney@gentoo.org>
Thu, 13 Mar 2008 17:10:30 +0000 (17:10 +0000)
committerAndrew Gaffney <agaffney@gentoo.org>
Thu, 13 Mar 2008 17:10:30 +0000 (17:10 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@645 67a159dc-881f-0410-a524-ba9dfbe2cb84

ChangeLog
generic/linuxrc

index d44922ae2cf7c1fcd9ef432188803c19c23cd2e7..6179b1d7333de3e36c08c5f14da0672adc5021ff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,10 @@
 # Copyright 2006-2008 Gentoo Foundation; Distributed under the GPL v2
 # $Header: $
 
+  13 Mar 2008; Andrew Gaffney <agaffney@gentoo.org> 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 <agaffney@gentoo.org> gen_initramfs.sh:
   Change the location we copy the intiramfs to for integrated initramfs
 
index 768e2ce8c924ec273464055ed9c9db42ebc7c834..2af1d75c4400fb1c57db8d1caf7f3a42fd200a99 100644 (file)
@@ -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