diff options
author | Jonathan Bauer | 2019-07-31 17:42:45 +0200 |
---|---|---|
committer | Jonathan Bauer | 2019-07-31 17:42:45 +0200 |
commit | d817221b938a14e1e8af3ce9abe531bce659d70c (patch) | |
tree | a46427bbc866fc0ced384063fd272c9a9b507d92 /builder/modules.d/slx-network/udhcpc-trigger | |
parent | [slx-partitioner] renamed to slx-dmsetup (diff) | |
download | systemd-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/modules.d/slx-network/udhcpc-trigger')
-rwxr-xr-x | builder/modules.d/slx-network/udhcpc-trigger | 12 |
1 files changed, 7 insertions, 5 deletions
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 |