summaryrefslogtreecommitdiffstats
path: root/builder/modules.d/slx-network/scripts/setup-bootif-network.stage4
diff options
context:
space:
mode:
authorJonathan Bauer2019-08-26 12:52:19 +0200
committerJonathan Bauer2019-08-26 12:52:19 +0200
commit5a45aafe03fbf46157b6b1fe524668e6dc285d42 (patch)
treec59d474214837322a213870e8e10b489a5ad12bc /builder/modules.d/slx-network/scripts/setup-bootif-network.stage4
parent[slx-dmsetup] remove quotes (diff)
downloadsystemd-init-5a45aafe03fbf46157b6b1fe524668e6dc285d42.tar.gz
systemd-init-5a45aafe03fbf46157b6b1fe524668e6dc285d42.tar.xz
systemd-init-5a45aafe03fbf46157b6b1fe524668e6dc285d42.zip
[slx-network] initial VLAN support
Diffstat (limited to 'builder/modules.d/slx-network/scripts/setup-bootif-network.stage4')
-rwxr-xr-xbuilder/modules.d/slx-network/scripts/setup-bootif-network.stage411
1 files changed, 8 insertions, 3 deletions
diff --git a/builder/modules.d/slx-network/scripts/setup-bootif-network.stage4 b/builder/modules.d/slx-network/scripts/setup-bootif-network.stage4
index bd89fec6..17afe798 100755
--- a/builder/modules.d/slx-network/scripts/setup-bootif-network.stage4
+++ b/builder/modules.d/slx-network/scripts/setup-bootif-network.stage4
@@ -14,6 +14,11 @@ if [ -z "$SLX_PXE_NETIF" ] || [ -z "$SLX_PXE_CLIENT_IP" ]; then
exit 1
fi
+MAIN_NETIF="$SLX_PXE_NETIF"
+[ -n "$SLX_VLAN_ID" ] && MAIN_NETIF="${SLX_PXE_NETIF}.${SLX_VLAN_ID}"
+[ -n "$SLX_BRIDGE" ] && MAIN_NETIF="${SLX_BRIDGE}"
+readonly MAIN_NETIF
+
# set default options
declare -a udhcpc_opts
udhcpc_opts+=("-t" "8")
@@ -37,14 +42,14 @@ fi
mkdir -p /run/udhcpc || echo "Could not create '/run/udhcpc'."
udhcpc "${udhcpc_opts[@]}" \
- -i "${SLX_BRIDGE:-${SLX_PXE_NETIF}}" \
+ -i "$MAIN_NETIF" \
-r "${SLX_PXE_CLIENT_IP}" \
-s /opt/openslx/scripts/udhcpc-trigger \
- -p "/run/udhcpc/udhcpc.${net_if}.pid"
+ -p "/run/udhcpc/udhcpc.${MAIN_NETIF}.pid"
ret=$?
if [ "${ret}" != 0 ]; then
- echo "udhcpc" "Could not run 'udhcpc ${udhcpc_opts[*]}' on ${net_if}."
+ echo "udhcpc" "Could not run 'udhcpc ${udhcpc_opts[*]}' on ${MAIN_NETIF}."
fi
exit "${ret}"