diff options
author | Eric Hameleers <alien@slackware.com> | 2016-04-22 12:38:28 +0200 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2016-04-22 12:38:28 +0200 |
commit | 8fb2720895f0b28e7872c6b887dc29551702382a (patch) | |
tree | 4a744da4244762d5508a93f36a67474585622b88 /liveinit | |
parent | dc3150191a8432ec539a8344f7942a0922352570 (diff) | |
download | liveslak-8fb2720895f0b28e7872c6b887dc29551702382a.tar.gz liveslak-8fb2720895f0b28e7872c6b887dc29551702382a.tar.xz |
liveinit: make the DHCP wait time configurable and set a longer default.
New boot parameter:
dhcpwait=<numseconds>
Maximum wait time for the DHCP client to configure a network interface
(new default: 20 seconds, was 10 seconds).
Diffstat (limited to 'liveinit')
-rwxr-xr-x | liveinit | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -75,6 +75,9 @@ GLAMORACCEL=1 INTERFACE="" NFSHOST="" +# Max wait time for DHCP client to configure an interface: +DHCPWAIT=20 + INITRD=$(cat /initrd-name) WAIT=$(cat /wait-for-root) KEYMAP=$(cat /keymap) @@ -109,6 +112,9 @@ for ARG in $(cat /proc/cmdline); do DEBUG=$(echo $ARG | cut -f2 -d=) DEBUGV="-v" ;; + dhcpwait=*) + DHCPWAIT=$(echo $ARG | cut -f2 -d=) + ;; hostname=*) LIVE_HOSTNAME=$(echo $ARG | cut -f2 -d=) ;; @@ -319,8 +325,6 @@ if [ "$RESCUE" = "" ]; then # Find and configure the network interface for NFS root support. # Assume nothing about the method of network configuration: ENET_MODE="ask" - # Max wait time for DHCP client to configure an interface: - MAXDHCP=10 echo "${MARKER}: Configuring network interface for NFS mount." @@ -360,11 +364,11 @@ if [ "$RESCUE" = "" ]; then continue # skip wireless interfaces fi # If this configures an interface, we're done with dhcpcd afterwards: - /sbin/dhcpcd -L -p -t $MAXDHCP $EDEV & + /sbin/dhcpcd -L -p -t $DHCPWAIT $EDEV & done unset EDEV - # Wait at most MAXDHCP seconds for a DHCP-configured interface to appear: - for ITER in $(seq 0 $MAXDHCP); do + # Wait at most DHCPWAIT seconds for a DHCP-configured interface to appear: + for ITER in $(seq 0 $DHCPWAIT); do if $(ip -f inet -o addr show | grep -v " lo " 1>/dev/null 2>/dev/null) then # Found one! @@ -393,7 +397,7 @@ if [ "$RESCUE" = "" ]; then if [ "$ENET_MODE" = "ask" -o "$ENET_MODE" = "dhcp" ]; then # Invoke dhcpcd only if it was not called yet: if [ ! -s /run/dhcpcd/dhcpcd-${INTERFACE}.pid ]; then - /sbin/dhcpcd -L -p -t $MAXDHCP $INTERFACE + /sbin/dhcpcd -L -p -t $DHCPWAIT $INTERFACE fi else # Kill dhcpcd if we used it to find a statically configured interface: |