fixed NFS mounting
parent
3274a8f98e
commit
ea62f0eb2a
|
|
@ -1,3 +1,4 @@
|
|||
#!/bin/sh
|
||||
inst mount.nfs
|
||||
inst_hook mount 96 "$moddir/nfs-mount-root.sh"
|
||||
inst_hook pre-mount 99 "$moddir/nfs-parse-root-opts.sh"
|
||||
instmods nfs
|
||||
|
|
|
|||
|
|
@ -1,28 +0,0 @@
|
|||
#!/bin/sh
|
||||
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
|
||||
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
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
#!/bin/sh
|
||||
|
||||
# exit if rootfstype is set and not nfs
|
||||
if [ -z "$fstype" -o "$fstype" = "nfs" ]; then
|
||||
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 -n "$nfsroot" ]; then
|
||||
if [ "${nfsroot#nfs://}" != "$nfsroot" ]; then
|
||||
nfsroot="${nfsroot#nfs://}"
|
||||
nfsroot="${nfsroot/\//:/}"
|
||||
fi
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
elif [ "${root#/dev/}" = "$root" -a "${root#*:/}" != "$root" ]; then
|
||||
nfsroot="$root"
|
||||
fi
|
||||
|
||||
# let user force override nfsroot
|
||||
nfsroot_cmdl=$(getarg 'nfsroot=')
|
||||
[ -n "$nfsroot_cmdl" ] && nfsroot="$nfsroot_cmdl"
|
||||
|
||||
if [ -n "$nfsroot" ]; then
|
||||
root="$nfsroot"
|
||||
fstype="-t nfs"
|
||||
|
||||
if rflags="$(getarg rootflags=)"; then
|
||||
getarg rw && rflags="${rflags},rw" || rflags="${rflags},ro"
|
||||
else
|
||||
getarg rw && rflags=rw || rflags=ro
|
||||
fi
|
||||
|
||||
rflags="nolock,$rflags"
|
||||
fi
|
||||
fi
|
||||
Loading…
Reference in New Issue