summaryrefslogtreecommitdiff
path: root/packages/initrdscripts
diff options
context:
space:
mode:
authorPaul Sokolovsky <pmiscml@gmail.com>2007-07-17 23:39:10 +0000
committerPaul Sokolovsky <pmiscml@gmail.com>2007-07-17 23:39:10 +0000
commit1d8ccb8276d860a7470943b063533503da72a2a6 (patch)
treee8efa31a376bbadffd654cac483be876e77d98f8 /packages/initrdscripts
parent3c9eb3f614fc9670eacaeb50480d19c676b2cb21 (diff)
initramfs-nfsboot: Add parsing of kernel commandline params, bump version to 0.2
* Untested.
Diffstat (limited to 'packages/initrdscripts')
-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