DONT'T APPLT. That doesn't work. $( swconfig rt305x get vlanenabled ) is always
0 that early in the boot-sequence, as switch settings are apparently only
applied later on (tried on HW550-3G)... So it rather needs to be board-specific.

Another thing came up:
We currently don't have any way to know from which version the user is coming on
sysupgrade (right?). What about -- in case of keeping the configuration --
adding a version tag which can later on be taken into account when migrating
config changes?


On 31/10/12 15:40, Daniel Golle wrote:
> I wasn't quite sure if I should hardcode "lan" as an interface name or just
> config_load network
> config_foreach ...
> and replace eth0.1 with eth0, so we also catch cases where the user might have
> renamed lan to something else...
> If anyone thinks that might be a good idea, I'll implement it, otherwise I'd 
> opt
> for simplicity does the job in 99% of the cases...
> 
> On 31/10/12 15:24, Daniel Golle wrote:
>> [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 <[email protected]>
>> ---
>>  .../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
>>
> 
> 


-- 
ALLNET GmbH ; Maistr. 2 ; D-82110 Germering ; Germany
Tel. +49-89-89422217 - Fax +49-89-89422233
http://www.allnet.de
email: Daniel Golle <[email protected]>
Schulungs-/Veranstaltungsprogramm: http://www.802lab.de<http://www.802lab.de/>
Geschäftsführer: Wolfgang Marcus Bauer
Handelsregister München B 95922 ; UST-ID-Nr. DE 128214294 ;
St.-Nr.117/115/00164
WEEE-Reg.-NR. DE 13101093
Bankverbindung:
Sparkasse Fürstenfeldbruck KTO: 2774594 ; BLZ: 70053070
Swift-Code: BYLADEM1FFB ; IBAN: DE61700530700002774594
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to