summaryrefslogtreecommitdiffstats
path: root/builder
diff options
context:
space:
mode:
authorJonathan Bauer2019-07-31 17:42:45 +0200
committerJonathan Bauer2019-07-31 17:42:45 +0200
commitd817221b938a14e1e8af3ce9abe531bce659d70c (patch)
treea46427bbc866fc0ced384063fd272c9a9b507d92 /builder
parent[slx-partitioner] renamed to slx-dmsetup (diff)
downloadsystemd-init-d817221b938a14e1e8af3ce9abe531bce659d70c.tar.gz
systemd-init-d817221b938a14e1e8af3ce9abe531bce659d70c.tar.xz
systemd-init-d817221b938a14e1e8af3ce9abe531bce659d70c.zip
[slx-network] setup network on udev settles
instead of checking in the finished hooks. NOTE: this might still cause problems, if udev finds the main boot interface first, triggers setup-network.sh which starts looping over interfaces before udev had a chance to discover every single one. The bridge creation stuff might be better appropriate in stage4!
Diffstat (limited to 'builder')
-rw-r--r--builder/modules.d/slx-network/parse-ipxe-network-kcl.sh3
-rw-r--r--builder/modules.d/slx-network/setup-network.sh2
-rwxr-xr-xbuilder/modules.d/slx-network/udhcpc-trigger12
3 files changed, 10 insertions, 7 deletions
diff --git a/builder/modules.d/slx-network/parse-ipxe-network-kcl.sh b/builder/modules.d/slx-network/parse-ipxe-network-kcl.sh
index bf5d3540..12d25322 100644
--- a/builder/modules.d/slx-network/parse-ipxe-network-kcl.sh
+++ b/builder/modules.d/slx-network/parse-ipxe-network-kcl.sh
@@ -99,4 +99,5 @@ NETIF=
[ -n "${BRIDGED}" ] && [ -n "${BRIDGE_NAME}" ] && NETIF="${BRIDGE_NAME}"
[ -n "${VLAN}" ] && NETIF="${BOOTIF_NAME}.${VLAN}"
-/sbin/initqueue --finished [ -e "/sys/class/net/${BOOTIF_NAME}" ]
+/sbin/initqueue --settled /usr/bin/setup-network "$BOOTIF_NAME"
+/sbin/initqueue --finished [ -e "/.network" ]
diff --git a/builder/modules.d/slx-network/setup-network.sh b/builder/modules.d/slx-network/setup-network.sh
index a983c05a..6964f503 100644
--- a/builder/modules.d/slx-network/setup-network.sh
+++ b/builder/modules.d/slx-network/setup-network.sh
@@ -93,7 +93,7 @@ fi
# udhcpc
for i in 1 1 1 fail; do
udhcpc -t 4 -T 3 -f -n -q \
- -i "$SLX_BRIDGE" \
+ -i "${SLX_BRIDGE:-${SLX_PXE_NETIF}}" \
"${SLX_PXE_CLIENT_IP:+-r $SLX_PXE_CLIENT_IP}" \
"${UUID:+-x 0x3d:$UUID}" \
-O ntpsrv -O domain -O wpad -O search -O nisdomain \
diff --git a/builder/modules.d/slx-network/udhcpc-trigger b/builder/modules.d/slx-network/udhcpc-trigger
index 17d73f51..9a056a6c 100755
--- a/builder/modules.d/slx-network/udhcpc-trigger
+++ b/builder/modules.d/slx-network/udhcpc-trigger
@@ -4,14 +4,15 @@ exec >> /run/openslx/udhcpc-trigger.log
exec 2>> /run/openslx/udhcpc-trigger.log
set -x
-if [ "x$1" != "xbound" -a "x$1" != "xrenew" ] || [ "x$interface" != "xbr0" ] || [ -z "$ip" ]; then
- exit 0
-fi
-
NETWORK_CONF="/run/openslx/network.conf"
-
. "$NETWORK_CONF"
+if [ "x$1" != "xbound" -a "x$1" != "xrenew" ] \
+ || [ "x$interface" != "${SLX_BRIDGE:-${SLX_PXE_NETIF}" ] \
+ || [ -z "$ip" ]; then
+ exit 0
+fi
+
# If we already got an IP from KCL, see if it differs, and remove first if so
# We just try to prevent everything from breaking if the DHCP server doesn't
# objey the renew request by the client and hands out a new address
@@ -112,3 +113,4 @@ if [ -n "$hostname" ]; then
echo "SLX_HOSTNAME='$hostname'" >> "/run/openslx/network.conf"
fi
+touch /.network