Skip to content

Commit

Permalink
detach bonding slaves if WWPOSTNETDOWN is set
Browse files Browse the repository at this point in the history
  • Loading branch information
beinvisible committed Apr 23, 2019
1 parent d4c4c3c commit 8246bf6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions provision/initramfs/init
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ bondup() {
# If we have gotten here, give up for this device, and bring device down
# just in case its present.
ip link set dev $DEVICE down >/dev/null 2>&1
ifenslave --detach $DEVICE $BONDDEVS >/dev/null
return 255
}

Expand Down Expand Up @@ -533,10 +534,12 @@ if [ -x "$NEWROOT/sbin/init" -o -h "$NEWROOT/sbin/init" ]; then
else
wwfailure
fi

if [ -n "$WWPOSTNETDOWN" ]; then
NETDEV=`cat /tmp/wwdev`
if [ -f "/tmp/ifcfg-$WWNETDEV" ]; then
. /tmp/ifcfg-$WWNETDEV

if [ -n "$IPADDR" -a -n "$NETMASK" ]; then
wwlogger "Deleting network interface address $NETDEV:$IPADDR/$NETMASK ($WWNETDEV)"
msg_white "Deleting network interface address $NETDEV:$IPADDR/$NETMASK ($WWNETDEV)"
Expand All @@ -558,6 +561,11 @@ if [ -x "$NEWROOT/sbin/init" -o -h "$NEWROOT/sbin/init" ]; then

wwlogger "Shutting down network interface $NETDEV ($WWNETDEV)"
msg_white "Shutting down network interface $NETDEV ($WWNETDEV): "
if [ -n "$WWBONDDEVS" ]; then
BONDDEVS=`echo "$WWBONDDEVS" | sed -e "s/,/ /g"`
ifenslave --detach $WWNETDEV $BONDDEVS >/dev/null
fi

if ip link set dev $NETDEV down; then
wwsuccess
else
Expand Down

0 comments on commit 8246bf6

Please sign in to comment.