summaryrefslogtreecommitdiffstats
path: root/core/rootfs/rootfs-stage31/data/inc/setup_network_retry
diff options
context:
space:
mode:
authorSimon Rettberg2020-07-08 16:12:32 +0200
committerSimon Rettberg2020-07-08 16:12:32 +0200
commitc1d6cad0e7653fcad04f27a7827a439827470092 (patch)
tree32578b2e35511271a913ac01bfb9a6b30166e0fd /core/rootfs/rootfs-stage31/data/inc/setup_network_retry
parent[remote-access] Tweak screen splitting (diff)
downloadmltk-c1d6cad0e7653fcad04f27a7827a439827470092.tar.gz
mltk-c1d6cad0e7653fcad04f27a7827a439827470092.tar.xz
mltk-c1d6cad0e7653fcad04f27a7827a439827470092.zip
[init/kexec/] More advanced network setup via KCL, could skip DHCP
If enough information if provided via KCL, we can skip the initial DHCP request in stage 3.1. Currently we require IP address, subnet mask and DNS server to skip DHCP. If we extend the boot server to supply a fallback/default DNS server, we could even do without DNS which would work in almost all cases. kexec-reboot has been extended to make use of this feature, but can be extended even more to provide up to date values from the current system configuration. Currently, some of the values it provides to the new kernel will be cached values from stage 3.1. kexec-reboot also honors the ipxe menu id from the KCL if given, to properly download the matching menu entry, which will take updates to the entry into account (e.g. changed URLs to kernel/init).
Diffstat (limited to 'core/rootfs/rootfs-stage31/data/inc/setup_network_retry')
-rw-r--r--core/rootfs/rootfs-stage31/data/inc/setup_network_retry8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/rootfs/rootfs-stage31/data/inc/setup_network_retry b/core/rootfs/rootfs-stage31/data/inc/setup_network_retry
index c1fff39d..449c0d8f 100644
--- a/core/rootfs/rootfs-stage31/data/inc/setup_network_retry
+++ b/core/rootfs/rootfs-stage31/data/inc/setup_network_retry
@@ -17,11 +17,11 @@ for i in 1 2 3 4 5 6 7 8; do
wait_for_iface "$IFACE" "$(( 15 + i * 2 ))"
retval=$?
ip link set dev "$BRIDGE" up
- if [ "$retval" -eq 0 ] && [ "$i" -ge 4 ] && [ -n "$CLIENTIP" ] && [ -n "$GATEWAY" ]; then
+ if [ "$retval" -eq 0 ] && [ "$i" -ge 4 ] && [ -n "$ip" ] && [ -n "$router" ]; then
echo "....."
usleep 100000
echo "Checking if static IP config works...."
- if ping -c1 -w2 "$GATEWAY" &> /dev/null || ping -c1 -w2 "$SERVERIP" &> /dev/null; then
+ if ping -c1 -w2 "$router" &> /dev/null || ping -c1 -w2 "${SLX_KCL_SERVERS%% *}" &> /dev/null; then
echo "apparently so."
echo "Trying to boot without DHCP config (DNS, Hostname, ...), YMMV!"
sleep 3
@@ -33,8 +33,8 @@ for i in 1 2 3 4 5 6 7 8; do
wait_for_iface "$BRIDGE" 10
usleep 100000
- udhcpc $PARAM -O hostname -O ntpsrv -O domain -O search -t "$(( 2 + i / 2 ))" -T "$(( 4 + i ))" -s "/inc/udhcpc-trigger" -f -n -q -i "$BRIDGE" \
- || udhcpc $PARAM -O hostname -O ntpsrv -O domain -O search -t "$(( 2 + i / 2 ))" -T "$(( 4 + i ))" -s "/inc/udhcpc-trigger" -f -n -q -i "$BRIDGE"
+ udhcpc $PARAM -O hostname -O ntpsrv -O domain -O search -O dns -t "$(( 2 + i / 2 ))" -T "$(( 4 + i ))" -s "/inc/udhcpc-trigger" -f -n -q -i "$BRIDGE" \
+ || udhcpc $PARAM -O hostname -O ntpsrv -O domain -O search -O dns -t "$(( 2 + i / 2 ))" -T "$(( 4 + i ))" -s "/inc/udhcpc-trigger" -f -n -q -i "$BRIDGE"
RET="$?"
if [ "$RET" -eq 0 ]; then