summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2019-08-27 12:54:43 +0200
committerJonathan Bauer2019-08-27 12:54:43 +0200
commitf8f055661deb14d6bf67d652dbea633eb21d1e51 (patch)
tree95e6607eddaa7fcc6c2f3e44ee86fe2f37141ad8
parent[slx-network] add comment sections (diff)
downloadsystemd-init-f8f055661deb14d6bf67d652dbea633eb21d1e51.tar.gz
systemd-init-f8f055661deb14d6bf67d652dbea633eb21d1e51.tar.xz
systemd-init-f8f055661deb14d6bf67d652dbea633eb21d1e51.zip
[slx-network] support for hostname via KCL
-rwxr-xr-xbuilder/modules.d/slx-network/scripts/udhcpc-trigger.stage36
1 files changed, 6 insertions, 0 deletions
diff --git a/builder/modules.d/slx-network/scripts/udhcpc-trigger.stage3 b/builder/modules.d/slx-network/scripts/udhcpc-trigger.stage3
index 4760b5f9..ee870873 100755
--- a/builder/modules.d/slx-network/scripts/udhcpc-trigger.stage3
+++ b/builder/modules.d/slx-network/scripts/udhcpc-trigger.stage3
@@ -105,6 +105,12 @@ if [ -n "$ntpsrv" ]; then
fi
# Hostname
+# Ignore it if hostname was forced per KCL
+if [ -n "$SLX_PXE_HOSTNAME" ]; then
+ echo "Hostname set via KCL, ignoring DHCP hostname: '$hostname'"
+ hostname="$SLX_PXE_HOSTNAME"
+fi
+
if [ -z "$hostname" ]; then
# as with domain, if there's no hostname, try to get via DNS
echo "..trying to get hostname via DNS, as DHCP didn't supply one.."