summaryrefslogtreecommitdiffstats
path: root/system-boot/components/9990-netboot.sh
diff options
context:
space:
mode:
Diffstat (limited to 'system-boot/components/9990-netboot.sh')
-rwxr-xr-xsystem-boot/components/9990-netboot.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/system-boot/components/9990-netboot.sh b/system-boot/components/9990-netboot.sh
new file mode 100755
index 0000000..5054fb8
--- /dev/null
+++ b/system-boot/components/9990-netboot.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+#set -e
+
+do_netmount()
+{
+ do_netsetup
+
+ if [ "${NFSROOT}" = "auto" ]
+ then
+ NFSROOT=${ROOTSERVER}:${ROOTPATH}
+ fi
+
+ rc=1
+
+ if ( [ -n "${FETCH}" ] || [ -n "${HTTPFS}" ] || [ -n "${FTPFS}" ] )
+ then
+ do_httpmount
+ return $?
+ fi
+
+ if [ "${NFSROOT#*:}" = "${NFSROOT}" ] && [ "$NETBOOT" != "cifs" ]
+ then
+ NFSROOT=${ROOTSERVER}:${NFSROOT}
+ fi
+
+ log_begin_msg "Trying netboot from ${NFSROOT}"
+
+ if [ "${NETBOOT}" != "nfs" ] && do_cifsmount
+ then
+ rc=0
+ elif do_nfsmount
+ then
+ NETBOOT="nfs"
+ export NETBOOT
+ rc=0
+ fi
+
+ log_end_msg
+ return ${rc}
+}