6 # Where to mount the real root partition
7 export NEW_ROOT
=/new_root
10 echo "Starting the recovery shell ..."
16 if [ ! -d "$NEW_ROOT" ]; then
17 echo "WARNING: trying to remount / RW and create $NEW_ROOT ..."
23 echo "Setting up /var directories ..."
24 mount_tmpfs tmpfs
/var
25 mkdir
/var
/db
/var
/empty
/var
/home
/var
/run
/var
/tmp
27 echo "Starting udevd for LVM ..."
30 echo "Executing additional rc scripts ..."
31 for rcs
in /etc
/rc.
*; do
32 if [ -x "$rcs" ]; then
37 echo "Mounting real root partition at $NEW_ROOT ..."
40 REAL_ROOT
=$
(sysctl
-n vfs.real_root
)
42 echo "ERROR: vfs.real_root sysctl no exist. The kernel is too old."
45 if [ -z "${REAL_ROOT}" ]; then
46 echo "ERROR: vfs.real_root sysctl not set."
53 if [ "$TYPE" = "local" ]; then
55 MOUNTFROM
="/dev/${3#/dev/}"
56 echo "Executing: mount -t $FSTYPE $4 $MOUNTFROM $NEW_ROOT"
57 mount
-o ro
-t $FSTYPE $4 $MOUNTFROM $NEW_ROOT ||
59 elif [ -x "/etc/rcmount_${TYPE}" ]; then
60 .
/etc
/rcmount_
${TYPE} "$@" ||
63 echo "ERROR: Unsupported root filesystem type: $TYPE."
67 echo "Stopping udevd ..."
68 kill $
(cat /var
/run
/udevd.pid
)
70 echo "Cleaning up and umounting /var ..."
74 echo "Mounting devfs on real root ..."
75 #mount_devfs $NEW_ROOT/dev
76 mount_null
/dev
$NEW_ROOT/dev