diff options
author | Jonathan Bauer | 2019-08-26 12:52:19 +0200 |
---|---|---|
committer | Jonathan Bauer | 2019-08-26 12:52:19 +0200 |
commit | 5a45aafe03fbf46157b6b1fe524668e6dc285d42 (patch) | |
tree | c59d474214837322a213870e8e10b489a5ad12bc /builder/modules.d/slx-network/scripts/setup-bootif-network.stage4 | |
parent | [slx-dmsetup] remove quotes (diff) | |
download | systemd-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-x | builder/modules.d/slx-network/scripts/setup-bootif-network.stage4 | 11 |
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}" |