Allow site-specific mountroot hosts
Similar to how ifconfig works, you can specify your own hosts that aren't
in a version-controlled KFS file.
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
diff --git a/kern/kfs/mountroot b/kern/kfs/mountroot
index 80e4069..55bad60 100755
--- a/kern/kfs/mountroot
+++ b/kern/kfs/mountroot
@@ -2,12 +2,14 @@
#
# root [[REMOTE_NAME] [SRVNAME]]
#
-# remote name, selects the UFS server from the else-if below
-# srv name: the name of the chan in #s
+# remote name: selects the UFS server/dialstring from your local configs
+# srv name: optional name for the chan in #s
#
-# when run with no args, this will also ifconfig and mount ufs for qemu
+# when run with no args, this will mount ufs for qemu
-REMOTE=qemu
+DIALSTRING='tcp!10.0.2.2!1025'
+
+REMOTE="qemu"
if [ "$#" -ge "1" ]
then
REMOTE=$1
@@ -19,19 +21,20 @@
SRVNAME=$2
fi
-if [ "x$REMOTE" = "xc75" ]
-then
- srv 'tcp!169.229.49.175!1025' $SRVNAME
-elif [ "x$REMOTE" = "xa8" ]
-then
- srv 'tcp!169.229.49.48!1025' $SRVNAME
-elif [ "x$REMOTE" = "xqemu" ]
-then
- srv 'tcp!10.0.2.2!1025' $SRVNAME
-else
- echo "Unknown remote: $REMOTE!"
- exit
-fi
+# Given $REMOTE, override DIALSTRING. Use something like this:
+#
+#if [ "x$REMOTE" = "xqemu" ]
+#then
+# : #nothing
+#elif [ "x$REMOTE" = "xSOMEHOST" ]
+#then
+# DIALSTRING='tcp!SOMEIP!1025'
+#else
+# echo "Unknown remote: $REMOTE!"
+# exit
+#fi
+[[ -f /etc/netmounts ]] && source /etc/netmounts
+
+srv $DIALSTRING $SRVNAME
mount -a -c /srv/$SRVNAME /mnt
-ls /mnt