summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2019-12-10 12:29:38 +0100
committerJonathan Bauer2019-12-10 12:29:38 +0100
commit75e1d6670055c43c092fb13451eec61a553f7e62 (patch)
tree4947bea0b44d972be86b9faebace39b81e47bb48
parent[conf-tgz] use new variable name everywhere... (diff)
downloadsystemd-init-75e1d6670055c43c092fb13451eec61a553f7e62.tar.gz
systemd-init-75e1d6670055c43c092fb13451eec61a553f7e62.tar.xz
systemd-init-75e1d6670055c43c092fb13451eec61a553f7e62.zip
[slx-network] explicitely request hostname
+ minor formatting
-rwxr-xr-xbuilder/modules.d/slx-network/scripts/setup-bootif-network.stage318
-rwxr-xr-xbuilder/modules.d/slx-network/scripts/setup-bootif-network.stage41
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")