2 # boot from the hard disk partition "$1" (which
3 # must be given) using options from the rest of
6 # Use the standard init path (see /etc/init.d/rcS)
7 export PATH
=/sbin
:/bin
:/usr
/sbin
:/usr
/bin
9 # Mount required fileystems if necessary
10 [ -e /proc
/cpuinfo
] || mount
-t proc proc
/proc
11 [ -e /sys
/class
] || mount
-t sysfs sysfs
/sys
13 # Load the helper functions
14 .
/etc
/default
/functions
15 .
/etc
/default
/modulefunctions
23 # load USB & SCSI storage modules (/proc required!)
24 echo "boot: loading modules required for disk boot"
27 if test "$sleep" -gt 0
29 echo "boot: waiting $sleep seconds for disk"
32 # Attempt to assemble the RAID if necessary
33 if (echo $device |
grep -q "^/dev/md")
37 echo "boot: assembling RAID array (UUID)"
38 mdadm
-Acpartitions --auto=md
--uuid="$MDUUID" $device
40 echo "boot: assembling RAID array (config file)"
41 mdadm
-As --auto=md
$device
46 echo "boot: rootfs: mount $* $device [$UUID]"
48 # Mount read-write because before exec'ing init
49 # If a UUID is given (in the environment) this
50 # is used in preference to the device, but if
51 # the UUID mount fails a standard device mount
54 mount
"$@" UUID
="$UUID" /mnt ||
55 mount
"$@" "$device" /mnt
57 # checkmount checks for sh, chroot, init, /dev
58 # and /mnt (i.e. /mnt/mnt in this case).
59 # minimaldevnodes checks (and creates if required)
60 # a few mandatory /dev nodes we may need.
61 if checkmount
/mnt
&& minimaldevnodes
/mnt
63 # pivot to /initrd if available, else /mnt
65 if test -d /mnt
/initrd
73 # Failure: unmount the partition
75 # Remount /proc and /sys if necessary
76 [ -e /proc
/cpuinfo
] || mount
-t proc proc
/proc
77 [ -e /sys
/class
] || mount
-t sysfs sysfs
/sys
81 # fallback - use the flash boot
82 leds beep
-f 1000 -r 2