summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Sokolovsky <pmiscml@gmail.com>2007-07-17 23:41:46 +0000
committerPaul Sokolovsky <pmiscml@gmail.com>2007-07-17 23:41:46 +0000
commitdd5a57d1976a4561006b23e50fec7c7385e6a400 (patch)
tree12b76f0efd78db67825c77c33bc1771c023738bf
parentae7e6e10e33433c3c63a03d32bc260d501d7a04d (diff)
parent1d8ccb8276d860a7470943b063533503da72a2a6 (diff)
merge of '00d41f081f30bcac8a8430efc5e722f474a6aca5'
and '4ffc891bb5558651038564ec75a40ea5c963ecd3'
-rw-r--r--packages/initrdscripts/files/nfsboot.sh44
-rw-r--r--packages/initrdscripts/initramfs-nfsboot_0.2.bb (renamed from packages/initrdscripts/initramfs-nfsboot_0.1.bb)0
2 files changed, 42 insertions, 2 deletions
diff --git a/packages/initrdscripts/files/nfsboot.sh b/packages/initrdscripts/files/nfsboot.sh
index bb689fa3b8..b536c4042b 100644
--- a/packages/initrdscripts/files/nfsboot.sh
+++ b/packages/initrdscripts/files/nfsboot.sh
@@ -3,8 +3,48 @@
echo "Starting initramfs boot..."
mkdir /proc
mount -t proc proc /proc
-ifconfig eth0 192.168.20.230
+
+for arg in `cat /proc/cmdline`; do
+ echo $arg
+ optarg=`expr "x$arg" : 'x[^=]*=\(.*\)'`
+ echo $optarg
+ case $arg in
+ root=*)
+ root=$optarg ;;
+ 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 "x$device" in
+ usb*)
+ echo "USB"
+ modprobe g_ether
+ ;;
+esac
+
+ifconfig $device $client_ip
+)
+
mkdir /mnt
-mount -t nfs 192.168.20.210:/home/nfs/Angstrom-opie-image-test-h4000 /mnt
+if [ "x$root" = "x/dev/nfs" ]; then
+ echo "booting from NFS: $nfsroot"
+ mount -t nfs $nfsroot /mnt
+else
+ echo "booting from: $root"
+ mount $root /mnt
+fi
+
cd /mnt
exec switch_root -c /dev/console /mnt /sbin/init
diff --git a/packages/initrdscripts/initramfs-nfsboot_0.1.bb b/packages/initrdscripts/initramfs-nfsboot_0.2.bb
index 1a4d48813b..1a4d48813b 100644
--- a/packages/initrdscripts/initramfs-nfsboot_0.1.bb
+++ b/packages/initrdscripts/initramfs-nfsboot_0.2.bb