[please apply to both, trunk and AA]

Since r33305 the embedded switch is disabled for some boards.
This causes sysupgrade to make the device inaccessible when coming from a
version before r33305 as the switch is then disabled, but the kept network
settings still refer to eth0.1.

Signed-off-by: Daniel Golle <dgo...@allnet.de>
---
 .../ramips/base-files/etc/uci-defaults/vlan-migration   | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100755 
target/linux/ramips/base-files/etc/uci-defaults/vlan-migration

diff --git a/target/linux/ramips/base-files/etc/uci-defaults/vlan-migration 
b/target/linux/ramips/base-files/etc/uci-defaults/vlan-migration
new file mode 100755
index 0000000..efbe0f6
--- /dev/null
+++ b/target/linux/ramips/base-files/etc/uci-defaults/vlan-migration
@@ -0,0 +1,17 @@
+#!/bin/sh
+#
+# Copyright (C) 2012 OpenWrt.org
+#
+
+if [ ! -x /sbin/swconfig ]; then
+       return
+fi
+
+local lanif="$(uci -q get network.lan.ifname)"
+local vlanenabled="$(swconfig dev rt305x get enable_vlan)"
+
+if [ "$lanif" = "eth0.1" ] && [ "$vlanenabled" = "0" ]; then
+       logger -t vlan-migration "ESW is disabled, use untagged instead of 
legacy VLAN 1"
+       uci set network.lan.ifname=eth0
+       uci commit network
+fi
-- 
1.8.0

Attachment: pgpeztIRcebbc.pgp
Description: PGP signature

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to