diff options
Diffstat (limited to 'packages/slugos-init/files/boot')
-rw-r--r-- | packages/slugos-init/files/boot/disk | 10 | ||||
-rw-r--r-- | packages/slugos-init/files/boot/kexec | 5 | ||||
-rw-r--r-- | packages/slugos-init/files/boot/network | 12 | ||||
-rw-r--r-- | packages/slugos-init/files/boot/ram | 5 |
4 files changed, 21 insertions, 11 deletions
diff --git a/packages/slugos-init/files/boot/disk b/packages/slugos-init/files/boot/disk index a991bc50ac..63370ce340 100644 --- a/packages/slugos-init/files/boot/disk +++ b/packages/slugos-init/files/boot/disk @@ -37,12 +37,14 @@ then # the UUID mount fails a standard device mount # is attempted. if test -n "$UUID" && - mount "$@" -U "$UUID" /mnt || + mount "$@" UUID="$UUID" /mnt || mount "$@" "$device" /mnt then - # checkmount checks for sh, chroot, init - # and /mnt (i.e. /mnt/mnt in this case) - if checkmount /mnt + # checkmount checks for sh, chroot, init, /dev + # and /mnt (i.e. /mnt/mnt in this case). + # minimaldevnodes checks (and creates if required) + # a few mandatory /dev nodes we may need. + if checkmount /mnt && minimaldevnodes /mnt then # pivot to /initrd if available, else /mnt cd / diff --git a/packages/slugos-init/files/boot/kexec b/packages/slugos-init/files/boot/kexec index 8973d20bfe..a60be03142 100644 --- a/packages/slugos-init/files/boot/kexec +++ b/packages/slugos-init/files/boot/kexec @@ -91,7 +91,6 @@ if [ -n "$1" -a -n "$2" ] ; then t=`basename "$kpath"` kexec_image="/mnt/$t" fi - umount /sys fi ;; @@ -105,7 +104,6 @@ if [ -n "$1" -a -n "$2" ] ; then t=`basename "$kpath"` kexec_image="/mnt/$t" fi - umount /sys fi ;; @@ -126,7 +124,7 @@ if [ -n "$1" -a -n "$2" ] ; then sleep "$sleep" if [ -n "$UUID" ] ; then echo "mounting partition UUID \"$UUID\"..." - if mount -o ro -U "$UUID" /mnt ; then + if mount -o ro UUID="$UUID" /mnt ; then need_umount=1 kexec_image="/mnt/$kpath" fi @@ -143,7 +141,6 @@ if [ -n "$1" -a -n "$2" ] ; then echo "Loading kexec kernel using tftp \"$kpath\"..." tftp -g -l "$kexec_image" -r "${kpath#*:}" "${kpath%%:*}" fi - umount /sys fi ;; diff --git a/packages/slugos-init/files/boot/network b/packages/slugos-init/files/boot/network index 8124f19ab2..48aa9dd7d5 100644 --- a/packages/slugos-init/files/boot/network +++ b/packages/slugos-init/files/boot/network @@ -24,8 +24,12 @@ ifconfig lo 127.0.0.1 up iface="$(config iface)" test -z "$iface" && exit 1 # -# Fire up a process in the background to load the firmware if necessary -sysf="/sys/class/firmware/firmware-$iface" +# Fire up a process in the background to load the firmware if necessary. +# If this system doesn't require the NPE-B firmware, no problem, the +# background process will simply go away in two seconds. If it requires +# some other firmware, then modification will be required. We probably +# should replace this with mdev or some other hotplug-based technique... +sysf="/sys/class/firmware/$iface" ( # Wait for the firware to be requested, if required [ -f $sysf/loading ] || sleep 1 @@ -39,5 +43,9 @@ sysf="/sys/class/firmware/firmware-$iface" # Trigger the firmware load proactively ifconfig "$iface" up # +# Unmount /sys and /proc before we leave +umount /sys +umount /proc +# ifup "$iface" # exit code is true only if the interface config has succeeded diff --git a/packages/slugos-init/files/boot/ram b/packages/slugos-init/files/boot/ram index a7c78b39ac..2583edf852 100644 --- a/packages/slugos-init/files/boot/ram +++ b/packages/slugos-init/files/boot/ram @@ -28,9 +28,12 @@ then # filter out boot (with zimage), linuxrc and anything # below /var, keep dev or the boot will fail (note that # nothing is mounted this early in the bootstrap). - find . -mount -print | + find . -xdev -print | sed '\@^./boot/@d;\@^./boot$@d;\@^./linuxrc@d;\@^./var/@d' | cpio -p -d -m -u /mnt + # busybox find with -xdev will not print the name of the + # mountpoint, so create the empty dir manually if required. + test -d /mnt/mnt || mkdir /mnt/mnt # checkmount checks for sh, init and no .recovery plus # either mnt or initrd, mnt must exist! if checkmount /mnt |