diff options
author | Simon Rettberg | 2018-05-04 11:41:26 +0200 |
---|---|---|
committer | Simon Rettberg | 2018-05-04 11:41:26 +0200 |
commit | c893145e65bdea2d44bf95bcd5b130d4fabb5055 (patch) | |
tree | ab851146fce492c29ceb716d38d5dea0b7ad6627 /core/rootfs/rootfs-stage31/data/inc | |
parent | [rfs-stage31] Don't try to source config before downloading it... (diff) | |
download | mltk-c893145e65bdea2d44bf95bcd5b130d4fabb5055.tar.gz mltk-c893145e65bdea2d44bf95bcd5b130d4fabb5055.tar.xz mltk-c893145e65bdea2d44bf95bcd5b130d4fabb5055.zip |
[rfs-stage31] Fix race when syncing time, more network setup tweaks
Diffstat (limited to 'core/rootfs/rootfs-stage31/data/inc')
-rw-r--r-- | core/rootfs/rootfs-stage31/data/inc/setup_network | 10 | ||||
-rw-r--r-- | core/rootfs/rootfs-stage31/data/inc/setup_network_retry | 1 |
2 files changed, 9 insertions, 2 deletions
diff --git a/core/rootfs/rootfs-stage31/data/inc/setup_network b/core/rootfs/rootfs-stage31/data/inc/setup_network index 76195780..6a196b82 100644 --- a/core/rootfs/rootfs-stage31/data/inc/setup_network +++ b/core/rootfs/rootfs-stage31/data/inc/setup_network @@ -95,9 +95,11 @@ wait_for_iface "$BRIDGE" PARAM= if [ -n "$CLIENTIP" ]; then PARAM="-r $CLIENTIP" + echo -n "$CLIENTIP" > "/run/firstip" +fi +if [ -n "$GATEWAY" ]; then + echo -n "$GATEWAY" > "/run/firstgw" fi -echo -n "$CLIENTIP" > "/run/firstip" -echo -n "$GATEWAY" > "/run/firstgw" # save our variables for retry on fail ff. echo "CLIENTIP=$CLIENTIP" >> /run/network.conf @@ -105,4 +107,8 @@ echo "GATEWAY=$GATEWAY" >> /run/network.conf echo "BRIDGE=$BRIDGE" >> /run/network.conf udhcpc $PARAM -O ntpsrv -O domain -O wpad -O search -t 5 -T 2 -s "/inc/udhcpc-trigger" -f -n -q -i "$BRIDGE" +URET=$? # udhcpc return value will be return value of this script +[ -z "$CLIENTIP" ] && CLIENTIP=$(cat /run/firstip) +[ -z "$GATEWAY" ] && GATEWAY=$(cat /run/firstgw) +return $URET diff --git a/core/rootfs/rootfs-stage31/data/inc/setup_network_retry b/core/rootfs/rootfs-stage31/data/inc/setup_network_retry index 0578d9b2..95c662c7 100644 --- a/core/rootfs/rootfs-stage31/data/inc/setup_network_retry +++ b/core/rootfs/rootfs-stage31/data/inc/setup_network_retry @@ -12,6 +12,7 @@ for i in 1 2 3 4 5 6 7 8; do echo "and up again.." ip link set dev $IFACE up + ip link set dev $BRIDGE up usleep 1000 wait_for_iface "$IFACE" |