Commit bca0236a authored by Adam Wujek's avatar Adam Wujek 💬

rootfs: read vlan configuration from dot-config in the vlan.sh init script

Update vlan.sh init script to let wrs_vlans to read configuration from
the dot-config.

Remove vlan_config.sh since it is not used anymore.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent f86b16d8
......@@ -276,6 +276,7 @@ config WRS_LOG_OTHER
--wrs_watchdog
--wrs_auxclk
--wrs_custom_boot_script.sh
--vlan.sh
This collective entry is to avoid number of entries in dot-config.
The string can be a pathname (e.g. /dev/kmsg) or a <facility>.<level>
spefification like "daemon.debug". An empty strings is used
......
......@@ -580,6 +580,7 @@ value is changed by the web interface, proper action is taken.
@item @t{wrs_watchdog}
@item @t{wrs_auxclk}
@item @t{wrs_custom_boot_script.sh}
@item @t{vlan.sh}
@end itemize
Each value
can be a pathname, to select logging to file (and @t{/dev/kmsg}
......
#!/bin/sh
tmpdir=/tmp
vlans_status_file="$tmpdir"/vlans_status
dotconfig=/wr/etc/dot-config
set -o pipefail
start() {
echo -n "Setting up VLANs: "
# set-up VLANs
/wr/etc/vlan_config.sh
if [ -f $dotconfig ]; then
. $dotconfig
else
echo "$0 unable to start wrs_throttling, unable to source " \
"dot-config ($dotconfig)!"
exit 1
fi
if [ $? -eq 0 ]; then
WRS_LOG=$CONFIG_WRS_LOG_OTHER
# if empty turn it to /dev/null
if [ -z $WRS_LOG ]; then
WRS_LOG="/dev/null";
fi
# if a pathname, use it
if echo "$WRS_LOG" | grep / > /dev/null; then
eval LOGPIPE=\" \> $WRS_LOG 2\>\&1 \";
else
# not a pathname: use verbatim
eval LOGPIPE=\" 2\>\&1 \| logger -t wr-switch -p $WRS_LOG\"
fi
# set-up VLANs
eval /wr/bin/wrs_vlans -f /wr/etc/dot-config $LOGPIPE
ret=$?
if [ $ret -eq 0 ]; then
echo "OK"
elif [ $ret -eq 2 ]; then
echo "Disabled"
else
echo "Failed"
fi
......
#!/bin/sh
set -e
## vlan configuration
## fill this file with vlans configuration
## Please note:
## wri2 is marked as port 2 on the front panel of the switch
## in other words:
## --port 2 == wri2
## and:
## wri2 == port2
## example configuration:
# configure ports 1-4,6,8-18 as pvid 1
# /wr/bin/wrs_vlans --port 1-4,6,8-18 --pmode 0 --pvid 1
# configure ports 5,7 as pvid 2
# /wr/bin/wrs_vlans --port 5,7 --pmode 0 --pvid 2
## set VID=1 on all ports except 4 and 6
## - binary: 11 1111 1111 1010 1111
## - hex : 0x3FFAF
# /wr/bin/wrs_vlans --rvid 1 --rfid 1 --rmask 0x3FFAF
## set VID=2 at ports 5 and 7 - this is
## - binary: 00 0000 0000 0101 0000
## - hex : 0x00050
# /wr/bin/wrs_vlans --rvid 2 --rfid 2 --rmask 0x00050
## when VLANs are defined, comment out the line below
echo -n "no vlan configuration "
exit 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment