summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2018-07-03 09:16:52 +0200
committerJonathan Bauer2018-07-03 09:16:52 +0200
commit7827e344f7dfc2be48272010e1bac349068c2818 (patch)
treebf5b3f1093a74dd2edddbab460890805ef61acee
parent[dnbd3-rootfs] mark the remote configuration variables (diff)
downloadsystemd-init-7827e344f7dfc2be48272010e1bac349068c2818.tar.gz
systemd-init-7827e344f7dfc2be48272010e1bac349068c2818.tar.xz
systemd-init-7827e344f7dfc2be48272010e1bac349068c2818.zip
[systemd-networkd-ext] config var for DHCP in stage4
-rw-r--r--builder/modules.d/systemd-networkd-ext/hooks/configure-dhcp-for-newroot.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/builder/modules.d/systemd-networkd-ext/hooks/configure-dhcp-for-newroot.sh b/builder/modules.d/systemd-networkd-ext/hooks/configure-dhcp-for-newroot.sh
index a5e59371..255b629e 100644
--- a/builder/modules.d/systemd-networkd-ext/hooks/configure-dhcp-for-newroot.sh
+++ b/builder/modules.d/systemd-networkd-ext/hooks/configure-dhcp-for-newroot.sh
@@ -16,9 +16,12 @@ mkdir -p "${NEWROOT}/${NETWORKD_DIR}" # dirname a-la bash
# First, copy over every configuration made so far
cp "${NETWORKD_DIR}/"* "${NEWROOT}/${NETWORKD_DIR}"
+# Workaround: UseHostname seems broken, so manually set the hostname for now...
+[ -n "${SLX_HOSTNAME}" ] && echo "${SLX_HOSTNAME}" > $NEWROOT/etc/hostname
+
# Now determine which network configuration we are running
# VLANs are already configured to DHCP, so nothing to do
-if [ -z "${SLX_VLAN_ID}" ]; then
+if [ -n "${SLX_STAGE4_DHCP}" -o -z "${SLX_VLAN_ID}" ]; then
# In both bridged and non-bridged mode, we need to adjust
# the configuration to DHCP for stage4
MATCH_LINE=
@@ -56,5 +59,3 @@ if [ -z "${SLX_VLAN_ID}" ]; then
EOF
fi
-# Workaround: UseHostname seems broken, so manually set the hostname for now...
-[ -n "${SLX_HOSTNAME}" ] && echo "${SLX_HOSTNAME}" > $NEWROOT/etc/hostname