support normal nfs root definition syntax

master
Harald Hoyer 2009-05-18 19:55:58 +02:00
parent 280117d934
commit d4244cb25b
2 changed files with 25 additions and 17 deletions

View File

@ -1,21 +1,29 @@
#!/bin/sh
set -x

for dev in /net.*.dhcpopts; do
if [ -f "$dev" ]; then
. "$dev"
[ -n "$new_root_path" ] && nfsroot="$new_root_path"
if [ ! -s /.resume -a "$nfsroot" ]; then
if [ "${nfsroot#nfs://}" != "$nfsroot" ]; then
nfsroot="${nfsroot#nfs://}"
nfsroot="${nfsroot/\//:/}"
#
#modprobe nfs
#
# start rpc.statd ??
mount -t nfs "$nfsroot" -o nolock "$NEWROOT" && ROOTFS_MOUNTED=yes
if [ "$root" = "dhcp" ]; then
for dev in /net.*.dhcpopts; do
if [ -f "$dev" ]; then
. "$dev"
[ -n "$new_root_path" ] && nfsroot="$new_root_path"
if [ ! -s /.resume -a "$nfsroot" ]; then
if [ "${nfsroot#nfs://}" != "$nfsroot" ]; then
nfsroot="${nfsroot#nfs://}"
nfsroot="${nfsroot/\//:/}"
fi
fi
fi
fi
done
done
fi

if [ "${root#/dev/}" = "$root" -a "${root/:\///}" != "$root" ]; then
nfsroot="$root"
fi


if [ -n "$nfsroot" ]; then
#
# modprobe nfs
#
# start rpc.statd ??
mount -t nfs "$nfsroot" -o nolock "$NEWROOT" && ROOTFS_MOUNTED=yes
fi

View File

@ -30,7 +30,7 @@ EOF
expand-hosts
domain=test.net
dhcp-range=192.168.1.100,192.168.1.150,168h
dhcp-option=17,"nfs://192.168.1.1/mnt/root"
dhcp-option=17,"192.168.1.1:/mnt/root"
EOF
)
inst /etc/nsswitch.conf /etc/nsswitch.conf