From 75e1d6670055c43c092fb13451eec61a553f7e62 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Tue, 10 Dec 2019 12:29:38 +0100 Subject: [slx-network] explicitely request hostname + minor formatting --- .../slx-network/scripts/setup-bootif-network.stage3 | 18 +++++++++++++----- .../slx-network/scripts/setup-bootif-network.stage4 | 1 + 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/builder/modules.d/slx-network/scripts/setup-bootif-network.stage3 b/builder/modules.d/slx-network/scripts/setup-bootif-network.stage3 index dad3e84c..50718894 100755 --- a/builder/modules.d/slx-network/scripts/setup-bootif-network.stage3 +++ b/builder/modules.d/slx-network/scripts/setup-bootif-network.stage3 @@ -88,7 +88,7 @@ if [ -n "$SLX_PXE_CLIENT_IP" ]; then dev "$MAIN_NETIF" fi -ADDOPTS=() +additional_opts=() # we need to send the same UID (without '-') as the PXE firmware did, so use the plain # one read with dmidecode (and not the one by get-system-uuid). @@ -96,21 +96,29 @@ if [ "$USE_DHCP_UUID" = "yes" ]; then UID="$(dmidecode -s system-uuid | sed -r 's/^(..)(..)(..)(..)-(..)(..)-(..)(..)-(....)-/00\4\3\2\1\6\5\8\7\9/')" if [ "${#UID}" = 34 ]; then echo "Using SMBIOS UID for DHCP" - ADDOPTS+=("-x" "0x3d:$UID") + additional_opts+=("-x" "0x3d:$UID") fi fi if [ -n "$SLX_PXE_CLIENT_IP" ]; then - ADDOPTS+=("-r" "$SLX_PXE_CLIENT_IP") + additional_opts+=("-r" "$SLX_PXE_CLIENT_IP") fi +# DHCP options to request +request_opts=("-O" "hostname") +request_opts+=("-O" "ntpsrv") +request_opts+=("-O" "domain") +request_opts+=("-O" "wpad") +request_opts+=("-O" "search") +request_opts+=("-O" "nisdomain") + # udhcpc for i in 1 1 1 fail; do [ "$i" = "fail" ] && emergency_shell "DHCP failed 3 times... cannot continue." udhcpc -t 4 -T 3 -f -n -q \ - "${ADDOPTS[@]}" \ -i "${MAIN_NETIF}" \ - -O ntpsrv -O domain -O wpad -O search -O nisdomain \ + "${request_opts[@]}" \ + "${additional_opts[@]}" \ -s "/usr/local/bin/udhcpc-trigger" # success? [ "$?" -eq 0 ] && break diff --git a/builder/modules.d/slx-network/scripts/setup-bootif-network.stage4 b/builder/modules.d/slx-network/scripts/setup-bootif-network.stage4 index 61f925d0..67b8c9cf 100755 --- a/builder/modules.d/slx-network/scripts/setup-bootif-network.stage4 +++ b/builder/modules.d/slx-network/scripts/setup-bootif-network.stage4 @@ -22,6 +22,7 @@ readonly MAIN_NETIF # set default options declare -a udhcpc_opts udhcpc_opts+=("-t" "8") +udhcpc_opts+=("-O" "hostname") udhcpc_opts+=("-O" "domain") udhcpc_opts+=("-O" "nissrv") udhcpc_opts+=("-O" "nisdomain") -- cgit v1.2.3-55-g7522