Clarify some NFS parsing and point out things that need to be fixed.

This commit is contained in:
Warren Togami 2009-06-24 00:34:24 -04:00
parent fb3d8cf7c2
commit 3847431d3d
2 changed files with 5 additions and 3 deletions

View File

@ -63,7 +63,7 @@ netif="$1"
root="$2" root="$2"
NEWROOT="$3" NEWROOT="$3"
# If it's not nfs we don't continue # Continue if nfs prefix
case "${root%%:*}" in case "${root%%:*}" in
nfs|nfs4);; nfs|nfs4);;
*) return;; *) return;;
@ -80,6 +80,7 @@ root_to_var $root
[ -z "$path" ] && root_to_var $nfs:$new_root_path [ -z "$path" ] && root_to_var $nfs:$new_root_path
#Empty path defaults to "/tftpboot/%s" #Empty path defaults to "/tftpboot/%s"
# FIXME: This should happen only in nfsroot.txt legacy mode
[ -z "$path" ] && path="/tftpboot/%s" [ -z "$path" ] && path="/tftpboot/%s"
if [ -z "$server" ] ; then if [ -z "$server" ] ; then

View File

@ -73,6 +73,7 @@ netroot_to_var() {
[ -z "$nfsroot" ] && nfsroot=$(getarg nfsroot=) [ -z "$nfsroot" ] && nfsroot=$(getarg nfsroot=)
# Handle old style <server-ip>:/<path # Handle old style <server-ip>:/<path
# FIXME: root= is not handled by this yet.
case "$netroot" in case "$netroot" in
[0-9]*:/*|[0-9]*\.[0-9]*\.[0-9]*[!:]|/*) [0-9]*:/*|[0-9]*\.[0-9]*\.[0-9]*[!:]|/*)
netroot=nfs:$netroot;; netroot=nfs:$netroot;;
@ -89,7 +90,7 @@ case "${root%%:*}" in
;; ;;
esac esac
# If it's not empty or nfs we don't continue # Continue if nfs or blank prefix
case "${netroot%%:*}" in case "${netroot%%:*}" in
''|nfs|nfs4|/dev/nfs);; ''|nfs|nfs4|/dev/nfs);;
*) return;; *) return;;
@ -107,7 +108,7 @@ if [ -n "$nfsroot" ] ; then
esac esac
fi fi
# If it's not nfs we don't continue # Continue if nfs prefix
case "${netroot%%:*}" in case "${netroot%%:*}" in
nfs|nfs4|/dev/nfs);; nfs|nfs4|/dev/nfs);;
*) return;; *) return;;