summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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
commit8fb2720895f0b28e7872c6b887dc29551702382a (patch)
tree4a744da4244762d5508a93f36a67474585622b88
parentdc3150191a8432ec539a8344f7942a0922352570 (diff)
downloadliveslak-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).
-rw-r--r--README.txt5
-rwxr-xr-xliveinit16
2 files changed, 14 insertions, 7 deletions
diff --git a/README.txt b/README.txt
index cae5109..c1cf6b5 100644
--- a/README.txt
+++ b/README.txt
@@ -170,7 +170,10 @@ noload=mod1[,mod2[...]] => Prevent loading of one or more
=== Network boot ===
-nfsroot=ip.ad.dr.ess:/path/to/liveslak =>defines the IP address
+dhcpwait=<numseconds> => Maximum wait time for the DHCP client to
+ configure a network interface (default: 20 seconds).
+
+nfsroot=ip.ad.dr.ess:/path/to/liveslak => defines the IP address
of the NFS server, and the path to the extracted content
of Slackware Live Edition.
diff --git a/liveinit b/liveinit
index c78c8a7..f4bda31 100755
--- a/liveinit
+++ b/liveinit
@@ -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: