summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2019-11-11 15:05:15 +0100
committerJonathan Bauer2019-11-11 15:05:15 +0100
commitafa1dfc1835a8bdbd9774dcb576d27f28f77ef7a (patch)
treecca907c126bf4a8a2105ec6220f72c4359dd4a59
parent[slx-network] tune deps (diff)
downloadsystemd-init-afa1dfc1835a8bdbd9774dcb576d27f28f77ef7a.tar.gz
systemd-init-afa1dfc1835a8bdbd9774dcb576d27f28f77ef7a.tar.xz
systemd-init-afa1dfc1835a8bdbd9774dcb576d27f28f77ef7a.zip
[slx-network] fix args passing to udhcpc
-rwxr-xr-xbuilder/modules.d/slx-network/scripts/setup-bootif-network.stage321
1 files changed, 17 insertions, 4 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 53ad8de9..dad3e84c 100755
--- a/builder/modules.d/slx-network/scripts/setup-bootif-network.stage3
+++ b/builder/modules.d/slx-network/scripts/setup-bootif-network.stage3
@@ -88,17 +88,28 @@ if [ -n "$SLX_PXE_CLIENT_IP" ]; then
dev "$MAIN_NETIF"
fi
-if [ "$USE_DHCP_UUID" = "yes" ] && [ -s "/run/system-uuid" ]; then
- UUID="$(cat /run/system-uuid)"
+ADDOPTS=()
+
+# 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).
+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")
+ fi
+fi
+
+if [ -n "$SLX_PXE_CLIENT_IP" ]; then
+ ADDOPTS+=("-r" "$SLX_PXE_CLIENT_IP")
fi
# 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}" \
- "${SLX_PXE_CLIENT_IP:+-r $SLX_PXE_CLIENT_IP}" \
- "${UUID:+-x 0x3d:$UUID}" \
-O ntpsrv -O domain -O wpad -O search -O nisdomain \
-s "/usr/local/bin/udhcpc-trigger"
# success?
@@ -110,3 +121,5 @@ done
set +x
} &>> "/run/openslx/initramfs-network.log.$$"
+
+