[oe-commits] org.oe.dev SlugOS: updated boot scripts to support nfs rootfs with the new network driver.

mwester commit openembedded-commits at lists.openembedded.org
Mon Feb 4 23:35:43 UTC 2008


SlugOS: updated boot scripts to support nfs rootfs with the new network driver.

Author: mwester at openembedded.org
Branch: org.openembedded.dev
Revision: 3828ccf554f5383a7feb13d09fe0f6e67073ef53
ViewMTN: http://monotone.openembedded.org/revision/info/3828ccf554f5383a7feb13d09fe0f6e67073ef53
Files:
1
packages/slugos-init/files/boot/kexec
packages/slugos-init/files/boot/network
packages/slugos-init/files/boot/nfs
packages/slugos-init/files/modulefunctions
Diffs:

#
# mt diff -r29817a260e6a9fe06810b70340557576d2be9f57 -r3828ccf554f5383a7feb13d09fe0f6e67073ef53
#
# 
# 
# patch "packages/slugos-init/files/boot/kexec"
#  from [673016bf05b9aa6cb772a7c6b241caedab27151a]
#    to [b0e2e879f12512f15d3ef86fe627eef2b46a7ed9]
# 
# patch "packages/slugos-init/files/boot/network"
#  from [1998f275fdd6f6ea83d325e7fe519c4357799e70]
#    to [4fe9fe097faa17da41a09d209399c67df115768c]
# 
# patch "packages/slugos-init/files/boot/nfs"
#  from [2dd5b0495bf2f88479a72713be1c9a3de7c9b396]
#    to [772d67b18a86541ab6d0a05f9384e822c82131e0]
# 
# patch "packages/slugos-init/files/modulefunctions"
#  from [4b87b10cbcadb95da00017ee6f9d7f80b767719b]
#    to [7ffd6c95d6a361b24b12da8f5bae1e016237a845]
# 
============================================================
--- packages/slugos-init/files/boot/kexec	673016bf05b9aa6cb772a7c6b241caedab27151a
+++ packages/slugos-init/files/boot/kexec	b0e2e879f12512f15d3ef86fe627eef2b46a7ed9
@@ -91,6 +91,7 @@ if [ -n "$1" -a -n "$2" ] ; then
 			t=`basename "$kpath"`
 			kexec_image="/mnt/$t"
 		    fi
+		    umount /sys
 		fi
 		;;
 
@@ -98,11 +99,13 @@ if [ -n "$1" -a -n "$2" ] ; then
 		if /boot/network ; then
 		    echo "Loading kexec kernel using nfs \"$kpath\"..."
 		    echo "mounting nfs partition..."
+		    loadnfsmods
 		    if mount -o ro,nolock -t nfs `dirname "$kpath"` /mnt ; then
 			need_umount=1
 			t=`basename "$kpath"`
 			kexec_image="/mnt/$t"
 		    fi
+		    umount /sys
 		fi
 		;;
 
@@ -140,6 +143,7 @@ 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
 		;;
 
============================================================
--- packages/slugos-init/files/boot/network	1998f275fdd6f6ea83d325e7fe519c4357799e70
+++ packages/slugos-init/files/boot/network	4fe9fe097faa17da41a09d209399c67df115768c
@@ -8,6 +8,11 @@
 # function!
 . /etc/default/functions
 #
+# /proc is needed for the module loading, and /sys is
+# necessary to load firmware (if required).
+mount -t proc  proc  /proc
+mount -t sysfs sysfs /sys
+#
 # We may need to load the network driver modules here
 . /etc/default/modulefunctions
 loadnetmods
@@ -17,5 +22,22 @@ iface="$(config iface)"
 # file.  Config the loopback and network interfaces.
 ifconfig lo 127.0.0.1 up
 iface="$(config iface)"
-test -n "$iface" && ifup "$iface"
+test -z "$iface" && exit 1 
+#
+# Fire up a process in the background to load the firmware if necessary
+sysf="/sys/class/firmware/$iface"
+(
+	# Wait for the firware to be requested, if required
+	[ -f $sysf/loading ] || sleep 1
+	[ -f $sysf/loading ] || sleep 1
+	if [ -f $sysf/loading ] ; then
+		echo "1" >$sysf/loading
+		cat /lib/firmware/NPE-B >$sysf/data
+		echo "0" >$sysf/loading
+	fi
+) &
+# Trigger the firmware load proactively
+ifconfig "$iface" up
+#
+ifup "$iface"
 # exit code is true only if the interface config has succeeded
============================================================
--- packages/slugos-init/files/boot/nfs	2dd5b0495bf2f88479a72713be1c9a3de7c9b396
+++ packages/slugos-init/files/boot/nfs	772d67b18a86541ab6d0a05f9384e822c82131e0
@@ -7,10 +7,15 @@ export PATH=/sbin:/bin:/usr/sbin:/usr/bi
 export PATH=/sbin:/bin:/usr/sbin:/usr/bin
 #
 . /etc/default/functions
+. /etc/default/modulefunctions
+#
 leds boot system
 #
 if /boot/network
 then
+	# load the nfs kernel module
+	loadnfsmods
+
 	# network is up and running, the NFS mount will
 	# now succeed (possibly), use /boot/disk
 	exec /boot/disk "$@"
============================================================
--- packages/slugos-init/files/modulefunctions	4b87b10cbcadb95da00017ee6f9d7f80b767719b
+++ packages/slugos-init/files/modulefunctions	7ffd6c95d6a361b24b12da8f5bae1e016237a845
@@ -1,5 +1,6 @@
 #!/bin/sh
 # . this file to load the functions for automatically loading modules
+# NB: /proc must be mounted for correct evaluation of "$(machine)".
 
 . /etc/default/functions
 
@@ -34,6 +35,10 @@ loadnetmods(){
 	esac
 }
 
+loadnfsmods(){
+	modprobe nfs
+}
+
 loadmiscmods(){
 	true
 }






More information about the Openembedded-commits mailing list