File: 9990-netboot.sh

package info (click to toggle)
live-boot 1:20160511~bpo8+1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 732 kB
  • sloc: sh: 3,196; makefile: 152
file content (41 lines) | stat: -rwxr-xr-x 560 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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}
}