Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 428604 | Differences between
and this patch

Collapse All | Expand All

(-)a/net/bonding.sh (-9 / +49 lines)
Lines 23-28 bonding_pre_start() Link Here
23
	eval primary="\$primary_${IFVAR}"
23
	eval primary="\$primary_${IFVAR}"
24
	unset primary_${IFVAR}
24
	unset primary_${IFVAR}
25
25
26
	eval subsume="\$subsume_${IFVAR}"
27
	unset subsume_${IFVAR}
28
26
29
27
	[ -z "${slaves}" ] && return 0
30
	[ -z "${slaves}" ] && return 0
28
31
Lines 77-82 bonding_pre_start() Link Here
77
	ebegin "Adding slaves to ${IFACE}"
80
	ebegin "Adding slaves to ${IFACE}"
78
	eindent
81
	eindent
79
	einfo "${slaves}"
82
	einfo "${slaves}"
83
	eoutdent
80
84
81
	# Check that our slaves exist
85
	# Check that our slaves exist
82
	(
86
	(
Lines 84-100 bonding_pre_start() Link Here
84
		_exists true || return 1
88
		_exists true || return 1
85
	done
89
	done
86
90
87
	# Must force the slaves to a particular state before adding them
91
	# Unless we are subsuming an existing interface (NFS root), we down
88
	for IFACE in ${slaves}; do
92
	# slave interfaces to work around bugs supposedly in some chipsets
89
		_delete_addresses
93
	# that cause failure to enslave from other states.
90
		_down
94
	if [ ! -n "${subsume}" ]; then
91
	done
95
		for IFACE in ${slaves}; do
96
			_delete_addresses
97
			_down
98
		done
99
	fi
92
	)
100
	)
93
101
94
	# now force the master to up
102
	# Now force the master to up
95
	_up
103
	#  - First test for interface subsume request (required for NFS root)
96
104
	if [ -n "${subsume}" ]; then
97
	# finally add in slaves
105
                einfo "Subsuming ${subsume} interface characteristics."
106
                eindent
107
                local oiface=${IFACE}
108
                IFACE=${subsume}
109
                local addr="$(_get_inet_address)"
110
                einfo "address: ${addr}"
111
                IFACE=${oiface}
112
                unset oiface
113
                eoutdent
114
                # subsume (presumably kernel auto-)configured IP
115
                /sbin/ifconfig ${IFACE} ${addr} up
116
        else
117
		# warn if root on nfs and no subsume interface supplied
118
		local root_fs_type=$(mountinfo -s /)
119
                if [ ${root_fs_type} == "nfs" ]; then
120
			warn_nfs=1
121
			ewarn "NFS root detected!!!"
122
			ewarn " If your system crashes here, /etc/conf.d/net needs"
123
			ewarn " subsume_${IFACE}=\"<iface>\" ... where <iface> is the"
124
			ewarn " existing, (usually kernel auto-)configured interface."
125
                fi
126
                # up the interface
127
                _up
128
        fi
129
130
131
	# Finally add in slaves
98
	# things needed in the process, and if they are done by ifenslave, openrc, and/or the kernel.
132
	# things needed in the process, and if they are done by ifenslave, openrc, and/or the kernel.
99
	# down new slave interface: ifenslave, openrc
133
	# down new slave interface: ifenslave, openrc
100
	# set mtu: ifenslave, kernel
134
	# set mtu: ifenslave, kernel
Lines 123-128 bonding_pre_start() Link Here
123
	else
157
	else
124
		/sbin/ifenslave "${IFACE}" ${slaves} >/dev/null
158
		/sbin/ifenslave "${IFACE}" ${slaves} >/dev/null
125
	fi
159
	fi
160
161
	# Wipe subsumed interface
162
	if [ -n "${subsume}" ]; then
163
		/sbin/ifconfig ${subsume} 0.0.0.0
164
	fi
165
126
	eend $?
166
	eend $?
127
167
128
	return 0 #important
168
	return 0 #important

Return to bug 428604