Commit f4fb06a5 authored by Russ Fish's avatar Russ Fish

Tweaks.

parent 7e51715e
......@@ -272,7 +272,7 @@ sub os_ifconfig_line($$$$$$$;$$)
my $test = qq[getmac /v /fo csv | awk -F, '/^"$iface"/{print \$4}'];
$uplines .= qq{if [ \`$test\` = '"Disconnected"' ]; then\n };
$uplines .= " $DEVCON enable '$dev_map{$iface}'\n ";
$uplines .= qq{ sleep 2\n };
$uplines .= qq{ sleep 5\n };
$uplines .= qq{fi\n };
#
# Configure.
......@@ -286,9 +286,9 @@ sub os_ifconfig_line($$$$$$$;$$)
# Re-do it if not.
$uplines .= qq{ echo " Config failed on $iface, retrying."\n };
$uplines .= " $DEVCON disable '$dev_map{$iface}'\n ";
$uplines .= qq{ sleep 2\n };
$uplines .= qq{ sleep 5\n };
$uplines .= " $DEVCON enable '$dev_map{$iface}'\n ";
$uplines .= qq{ sleep 2\n };
$uplines .= qq{ sleep 5\n };
$uplines .= sprintf($IFCONFIG, $iface, $inet, $mask) . qq{\n };
#
# Re-check.
......@@ -604,9 +604,11 @@ sub os_routing_add_manual($$$$$;$)
# the IP Address Table for the machine.
# Re-doing the command later succeeds.
# Wrap the route command in a loop to make sure it gets done.
$cmd = "while ! ( $ROUTE print | grep -Fq $destip ); do \n
# Don't loop forever.
$cmd = "n=1; while ! ( $ROUTE print | grep -Fq $destip ); do \n
echo $cmd;\n
$cmd\n
let n++; if [[ \$n > 5 ]]; then break; fi
sleep 5\n
done";
......
......@@ -94,17 +94,23 @@ nipc=`wc -l < $icd`
logit "number of interfaces in ipconfig = $nipc"
if [[ $nipc < $nifc ]]; then
# Ignore the ones that are in ipconfig already.
logit "Fixing interface(s): `join -v 2 -t : -2 2 -o 2.2 $icd $dfc`"
logit "Fixing interface(s):"
logit "`join -v 2 -t : -2 2 -o 2.2 $icd $dfc`"
# 'devcon' takes PCI_device_instance_ID args with leading @ signs.
ids=`join -v 2 -t : -2 2 -o 2.1 $icd $dfc | sed 's/^/@/'`
devcon disable $ids
sleep 5
devcon enable $ids
sleep 5
# Should be fixed.
ipconfig /all | tr -d '\r' > $icc
sed -n '/Description/s/.*: //p' $icc | sort > $icd
nipconfig=`wc -l < $icd`
logit "number of interfaces in ipconfig now = $nipconfig"
nipc=`wc -l < $icd`
logit "number of interfaces in ipconfig now = $nipc"
if [[ $nipc < $nifc ]]; then
logit '*** There are still one or more interfaces missing! ***'
fi
fi
# Remember the control net interface MAC address and Local Area Connection name for
......@@ -146,15 +152,18 @@ else
# Disable NICs that won't be used. Addresses, etc for experimental net
# interfaces will be configured by rc.ifc later (generated by rc.ifconfig .)
mim=$bd/mac-id-map umac=$bd/used_macs
mim=$bd/mac-id-map mnm=$bd/mac-name-map umac=$bd/used_macs
# mac-id-map is MAC:PCI_device_instance_ID.
tr -d : < $xim | paste -d: - $xii | sort > $mim
# mac-name-map is MAC:Local Area Connection #
tr -d : < $xim | paste -d: - $xin | sort > $mnm
# Make a list of NIC macs that will be used.
tmcc ifconfig | sed -e 's/.*MAC=//' -e 's/ .*//' | cat $cmac - | sort > $umac
# The others.
unused=`join -v 2 -t : -o 2.1 $umac $mim`
if [ ! -z "$unused" ]; then
logit "Disabling unused interface(s): $unused"
logit "Disabling unused interface(s):"
logit "`join -v 2 -t : -o 2.1 $umac $mnm`"
devcon disable `join -v 2 -t : -o 2.2 $umac $mim`
fi
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment