View | Details | Raw Unified | Return to bug 15466
Collapse All | Expand All

(-)mkinitrd-3.0.5.orig/init (+3 lines)
Lines 60-65 Link Here
60
	nfsroot=*)
60
	nfsroot=*)
61
		NFSROOT="${x#nfsroot=}"
61
		NFSROOT="${x#nfsroot=}"
62
		;;
62
		;;
63
	nbdhost=*)
64
		NBDHOST="${x#nbdhost=}"
65
		;;
63
	ip=*)
66
	ip=*)
64
		IPOPTS="${x#ip=}"
67
		IPOPTS="${x#ip=}"
65
		;;
68
		;;
(-)mkinitrd-3.0.5.orig/scripts/dhcp (+35 lines)
Line 0 Link Here
1
# parse nbd bootargs + launch ipconfig and nbd-client
2
local DEVICE=${DEVICE:-eth0}
3
4
modprobe -q af_packet
5
# support ip options see linux sources Documentation/nbd.txt
6
case ${IPOPTS} in
7
	none|off)
8
		# Do nothing
9
		;;
10
	""|on|any)
11
		# Bring up device
12
		ipconfig ${DEVICE}
13
		;;
14
	dhcp|bootp|rarp|both)
15
		ipconfig -c ${IPOPTS} -d ${DEVICE}
16
		;;
17
	*)
18
		ipconfig -d $IPOPTS
19
20
		# grab device entry from ip option
21
		NEW_DEVICE=${IPOPTS#*:*:*:*:*:*}
22
		if [ "${NEW_DEVICE}" != "${IPOPTS}" ]; then
23
			NEW_DEVICE=${NEW_DEVICE%:*}
24
		else
25
			# wrong parse, possibly only a partial string
26
			NEW_DEVICE=
27
		fi
28
		if [ -n "${NEW_DEVICE}" ]; then
29
			DEVICE="${NEW_DEVICE}"
30
		fi
31
		;;
32
esac
33
34
# source relevant ipconfig output
35
. /tmp/net-${DEVICE}.conf
(-)mkinitrd-3.0.5.orig/scripts/local-top (+6 lines)
Line 0 Link Here
1
case $ROOT in
2
	/dev/nbd*)
3
		run_scripts /scripts/dhcp
4
		run_scripts /scripts/nbd
5
		;;
6
esac
(-)mkinitrd-3.0.5.orig/scripts/nbd (+22 lines)
Line 0 Link Here
1
# get nbd root from dhcp
2
if [ "x${NBDHOST}" = "xauto" ]; then
3
	NBDPORT=${ROOTPATH#*:}
4
	NBDHOST=${ROOTPATH%:*}
5
# nbdhost=[<server-ip>:][<port>][,<nbd-options>]
6
elif [ -n "${NBDHOST}" ]; then
7
	# nbd options are an optional arg
8
	if [ "${NBDHOST#*,}" != "${NBDHOST}" ]; then
9
		NBDOPTS="${NBDHOST#*,}"
10
	fi
11
	NBDHOST=${NBDHOST%%,*}
12
	if [ "${NBDHOST#*:}" = "$NBDHOST" ]; then
13
		NBDHOST=${ROOTSERVER}
14
		NBDPORT=${NBDHOST}
15
	else
16
		NBDPORT=${NBDHOST#*:}
17
		NBDHOST=${NBDHOST%:*}
18
	fi
19
fi
20
21
modprobe -q nbd ${NBDDEV_NUM:+nbds_max=$NBDDEV_NUM} && /sbin/udevsettle
22
/sbin/nbd-client ${NBDOPTS} ${NBDHOST} ${NBDPORT:-9210} /dev/nbd0
(-)mkinitrd-3.0.5.orig/scripts/nfs (-31 / +1 lines)
Lines 8-44 Link Here
8
# parse nfs bootargs + launch ipconfig and nfsmount
8
# parse nfs bootargs + launch ipconfig and nfsmount
9
do_nfsmount()
9
do_nfsmount()
10
{
10
{
11
	# support ip options see linux sources Documentation/nfsroot.txt
11
	run_scripts /scripts/dhcp
12
	case ${IPOPTS} in
13
		none|off)
14
			# Do nothing
15
			;;
16
		""|on|any)
17
			# Bring up device
18
			ipconfig ${DEVICE}
19
			;;
20
		dhcp|bootp|rarp|both)
21
			ipconfig -c ${IPOPTS} -d ${DEVICE}
22
			;;
23
		*)
24
			ipconfig -d $IPOPTS
25
26
			# grab device entry from ip option
27
			NEW_DEVICE=${IPOPTS#*:*:*:*:*:*}
28
			if [ "${NEW_DEVICE}" != "${IPOPTS}" ]; then
29
				NEW_DEVICE=${NEW_DEVICE%:*}
30
			else
31
				# wrong parse, possibly only a partial string
32
				NEW_DEVICE=
33
			fi
34
			if [ -n "${NEW_DEVICE}" ]; then
35
				DEVICE="${NEW_DEVICE}"
36
			fi
37
			;;
38
	esac
39
40
	# source relevant ipconfig output
41
	. /tmp/net-${DEVICE}.conf
42
12
43
	# get nfs root from dhcp
13
	# get nfs root from dhcp
44
	if [ "x${NFSROOT}" = "xauto" ]; then
14
	if [ "x${NFSROOT}" = "xauto" ]; then

Return to bug 15466