This file is indexed.

/usr/share/initramfs-tools/scripts/nfs is in initramfs-tools 0.99ubuntu13.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# NFS filesystem mounting			-*- shell-script -*-

# FIXME This needs error checking

retry_nr=0

# parse nfs bootargs and mount nfs
do_nfsmount()
{

	configure_networking

	# get nfs root from dhcp
	if [ "x${NFSROOT}" = "xauto" ]; then
		# check if server ip is part of dhcp root-path
		if [ "${ROOTPATH#*:}" = "${ROOTPATH}" ]; then
			NFSROOT=${ROOTSERVER}:${ROOTPATH}
		else
			NFSROOT=${ROOTPATH}
		fi

	# nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
	elif [ -n "${NFSROOT}" ]; then
		# nfs options are an optional arg
		if [ "${NFSROOT#*,}" != "${NFSROOT}" ]; then
			NFSOPTS="-o ${NFSROOT#*,}"
		fi
		NFSROOT=${NFSROOT%%,*}
		if [ "${NFSROOT#*:}" = "$NFSROOT" ]; then
			NFSROOT=${ROOTSERVER}:${NFSROOT}
		fi
	fi

	if [ -z "${NFSOPTS}" ]; then
		NFSOPTS="-o retrans=10"
	fi

	[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-premount"
	run_scripts /scripts/nfs-premount
	[ "$quiet" != "y" ] && log_end_msg

	if [ ${readonly} = y ]; then
		roflag="-o ro"
	else
		roflag="-o rw"
	fi

	nfsmount -o nolock ${roflag} ${NFSOPTS} ${NFSROOT} ${rootmnt}
}

# NFS root mounting
mountroot()
{
	[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-top"
	run_scripts /scripts/nfs-top
	[ "$quiet" != "y" ] && log_end_msg

	modprobe nfs
	# For DHCP
	modprobe af_packet

	wait_for_udev 10

	# Default delay is around 180s
	delay=${ROOTDELAY:-180}

	# loop until nfsmount succeeds
	do_nfsmount
	while [ ${retry_nr} -lt ${delay} ] && [ ! -e ${rootmnt}${init} ]; do
		[ "$quiet" != "y" ] && log_begin_msg "Retrying nfs mount"
		/bin/sleep 1
		do_nfsmount
		retry_nr=$(( ${retry_nr} + 1 ))
		[ "$quiet" != "y" ] && log_end_msg
	done

	[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-bottom"
	run_scripts /scripts/nfs-bottom
	[ "$quiet" != "y" ] && log_end_msg
}