Fix for bug 86487. Allowing a subdirectory of a block device to be chrooted from...
authorEric Edgar <rocket@gentoo.org>
Wed, 22 Jun 2005 15:12:43 +0000 (15:12 +0000)
committerEric Edgar <rocket@gentoo.org>
Wed, 22 Jun 2005 15:12:43 +0000 (15:12 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@218 67a159dc-881f-0410-a524-ba9dfbe2cb84

generic/linuxrc

index 1d89f3016c4680e5389b061e4bf4e7fe21f06c3b..718e24bdd3e71683b7c11059f9121c3734c84d23 100644 (file)
@@ -45,6 +45,9 @@ do
       real_root\=*)
          REAL_ROOT=`parse_opt "${x}"`
          ;;
+      subdir\=*)
+         SUBDIR=`parse_opt "${x}"`
+         ;;
       real_init\=*)
          REAL_INIT=`parse_opt "${x}"`
          ;;
@@ -461,6 +464,12 @@ else
        mkdir -p ${NEW_ROOT}/tmp/.initrd
 fi
 
+if [ "${SUBDIR}" != '' -a -e "${CHROOT}/${SUBDIR}" ]
+then
+    good_msg"Entering ${SUBDIR} to boot"
+    CHROOT=${CHROOT}/${SUBDIR}
+fi
+
 if [ "$0" = '/linuxrc' ]
 then
        [ ! -e ${CHROOT}/dev/console ] && mknod ${CHROOT}/dev/console c 5 1