summaryrefslogtreecommitdiff
path: root/packages/initrdscripts/files/80-nfsboot.sh
diff options
context:
space:
mode:
authorHenning Heinold <heinold@inf.fu-berlin.de>2007-11-22 21:15:54 +0000
committerHenning Heinold <heinold@inf.fu-berlin.de>2007-11-22 21:15:54 +0000
commit255eeb9dd1af98857dc30631076bb4fae8da4e0c (patch)
tree2ef554292cd385de37e31f131be8a5ea0d7013fb /packages/initrdscripts/files/80-nfsboot.sh
parentf49bb749b59a2a7bfc9105866019133831bed05c (diff)
parent2f0728d421371638542518906a4ab639198790dc (diff)
merge of '01a1687d6a3a1aa8b8ba912066a682526987fd4f'
and '74f9f9386f21c9cc7120b518b57aa3e7dee84477'
Diffstat (limited to 'packages/initrdscripts/files/80-nfsboot.sh')
-rw-r--r--packages/initrdscripts/files/80-nfsboot.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/packages/initrdscripts/files/80-nfsboot.sh b/packages/initrdscripts/files/80-nfsboot.sh
new file mode 100644
index 0000000000..5129a53ebb
--- /dev/null
+++ b/packages/initrdscripts/files/80-nfsboot.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+if [ "$ROOT_DEVICE" = "/dev/nfs" ]; then
+
+ # These correspond to what kernel itself uses
+ # DO NOT CHANGE!
+ NFS_OPTIONS="-o nfsvers=2,nolock"
+
+ for arg in $CMDLINE; do
+ echo $arg
+ optarg=`expr "x$arg" : 'x[^=]*=\(.*\)'`
+ echo $optarg
+ case $arg in
+ nfsroot=*)
+ nfsroot=$optarg ;;
+ ip=*)
+ ip=$optarg ;;
+ esac
+ done
+
+ echo $ip | (IFS=: read client_ip server_ip gw_ip netmask hostname device autoconf; \
+ echo client_ip=$client_ip;
+ echo server_ip=$server_ip;
+ echo gw_ip=$gw_ip;
+ echo netmask=$netmask;
+ echo hostname=$hostname;
+ echo device=$device;
+ echo autoconf=$autoconf;
+
+ case "$device" in
+ usb*)
+ echo "USB"
+ modprobe g_ether
+ ;;
+ esac
+
+ ifconfig $device $client_ip
+ )
+
+ echo "booting from NFS: $nfsroot"
+ mount -t nfs $NFS_OPTIONS $nfsroot /mnt
+ BOOT_ROOT=/mnt
+fi