support normal nfs root definition syntax
parent
280117d934
commit
d4244cb25b
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -x
|
set -x
|
||||||
|
if [ "$root" = "dhcp" ]; then
|
||||||
for dev in /net.*.dhcpopts; do
|
for dev in /net.*.dhcpopts; do
|
||||||
if [ -f "$dev" ]; then
|
if [ -f "$dev" ]; then
|
||||||
. "$dev"
|
. "$dev"
|
||||||
[ -n "$new_root_path" ] && nfsroot="$new_root_path"
|
[ -n "$new_root_path" ] && nfsroot="$new_root_path"
|
||||||
|
@ -9,13 +9,21 @@ for dev in /net.*.dhcpopts; do
|
||||||
if [ "${nfsroot#nfs://}" != "$nfsroot" ]; then
|
if [ "${nfsroot#nfs://}" != "$nfsroot" ]; then
|
||||||
nfsroot="${nfsroot#nfs://}"
|
nfsroot="${nfsroot#nfs://}"
|
||||||
nfsroot="${nfsroot/\//:/}"
|
nfsroot="${nfsroot/\//:/}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${root#/dev/}" = "$root" -a "${root/:\///}" != "$root" ]; then
|
||||||
|
nfsroot="$root"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [ -n "$nfsroot" ]; then
|
||||||
#
|
#
|
||||||
#modprobe nfs
|
# modprobe nfs
|
||||||
#
|
#
|
||||||
# start rpc.statd ??
|
# start rpc.statd ??
|
||||||
mount -t nfs "$nfsroot" -o nolock "$NEWROOT" && ROOTFS_MOUNTED=yes
|
mount -t nfs "$nfsroot" -o nolock "$NEWROOT" && ROOTFS_MOUNTED=yes
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ EOF
|
||||||
expand-hosts
|
expand-hosts
|
||||||
domain=test.net
|
domain=test.net
|
||||||
dhcp-range=192.168.1.100,192.168.1.150,168h
|
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
|
EOF
|
||||||
)
|
)
|
||||||
inst /etc/nsswitch.conf /etc/nsswitch.conf
|
inst /etc/nsswitch.conf /etc/nsswitch.conf
|
||||||
|
|
Loading…
Reference in New Issue