Author: blogic Date: 2014-07-02 18:33:11 +0200 (Wed, 02 Jul 2014) New Revision: 41472
Modified: trunk/target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom trunk/target/linux/lantiq/base-files/etc/uci-defaults/01_leds trunk/target/linux/lantiq/base-files/etc/uci-defaults/02_network trunk/target/linux/lantiq/base-files/etc/uci-defaults/03_wireless-wps trunk/target/linux/lantiq/base-files/lib/functions/lantiq.sh Log: lantiq: add support for /tmp/sysinfo Signed-off-by: John Crispin <[email protected]> Modified: trunk/target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom =================================================================== --- trunk/target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom 2014-07-02 14:32:43 UTC (rev 41471) +++ trunk/target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom 2014-07-02 16:33:11 UTC (rev 41472) @@ -33,7 +33,7 @@ case "$FIRMWARE" in "RT2860.eeprom" ) - local board=$(lantiq_board_id) + local board=$(lantiq_board_name) case $board in ARV7510PW22|ARV7519PW|ARV752DPW|ARV752DPW22) rt2x00_eeprom_extract "board_config" 520 256 1 Modified: trunk/target/linux/lantiq/base-files/etc/uci-defaults/01_leds =================================================================== --- trunk/target/linux/lantiq/base-files/etc/uci-defaults/01_leds 2014-07-02 14:32:43 UTC (rev 41471) +++ trunk/target/linux/lantiq/base-files/etc/uci-defaults/01_leds 2014-07-02 16:33:11 UTC (rev 41472) @@ -17,7 +17,7 @@ [ $? -eq 0 ] && ucidef_set_led_default $a $a $a `cat /sys/class/leds/$a/brightness` done -board=$(lantiq_board_id) +board=$(lantiq_board_name) case "$board" in VG3503J) Modified: trunk/target/linux/lantiq/base-files/etc/uci-defaults/02_network =================================================================== --- trunk/target/linux/lantiq/base-files/etc/uci-defaults/02_network 2014-07-02 14:32:43 UTC (rev 41471) +++ trunk/target/linux/lantiq/base-files/etc/uci-defaults/02_network 2014-07-02 16:33:11 UTC (rev 41472) @@ -68,7 +68,7 @@ lan_mac="" wan_mac="" -board=$(lantiq_board_id) +board=$(lantiq_board_name) case "$board" in # adm6996 Modified: trunk/target/linux/lantiq/base-files/etc/uci-defaults/03_wireless-wps =================================================================== --- trunk/target/linux/lantiq/base-files/etc/uci-defaults/03_wireless-wps 2014-07-02 14:32:43 UTC (rev 41471) +++ trunk/target/linux/lantiq/base-files/etc/uci-defaults/03_wireless-wps 2014-07-02 16:33:11 UTC (rev 41472) @@ -3,10 +3,10 @@ set_wps() { uci set wireless.$1.wps_pushbutton=0 - uci set wireless.$1.wps_device_name="OpenWrt - $(lantiq_board_name)" + uci set wireless.$1.wps_device_name="OpenWrt - $(lantiq_board_model)" } -board=$(lantiq_board_id) +board=$(lantiq_board_name) case $board in WBMR) config_load wireless Modified: trunk/target/linux/lantiq/base-files/lib/functions/lantiq.sh =================================================================== --- trunk/target/linux/lantiq/base-files/lib/functions/lantiq.sh 2014-07-02 14:32:43 UTC (rev 41471) +++ trunk/target/linux/lantiq/base-files/lib/functions/lantiq.sh 2014-07-02 16:33:11 UTC (rev 41472) @@ -1,9 +1,29 @@ #!/bin/sh -lantiq_board_id() { - grep "^machine" /proc/cpuinfo | sed "s/machine.*: \(.*\)/\1/g" | sed "s/\(.*\) - .*/\1/g" +lantiq_board_detect() { + name=`grep "^machine" /proc/cpuinfo | sed "s/machine.*: \(.*\)/\1/g" | sed "s/\(.*\) - .*/\1/g"` + model=`grep "^machine" /proc/cpuinfo | sed "s/machine.*: \(.*\)/\1/g" | sed "s/.* - \(.*\)/\1/g"` + [ -z "$name" ] && name="unknown" + [ -z "$model" ] && model="unknown" + [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" + echo $name > /tmp/sysinfo/board_name + echo $model > /tmp/sysinfo/model } +lantiq_board_model() { + local model + + [ -f /tmp/sysinfo/model ] && model=$(cat /tmp/sysinfo/model) + [ -z "$model" ] && model="unknown" + + echo "$model" +} + lantiq_board_name() { - grep "^machine" /proc/cpuinfo | sed "s/machine.*: \(.*\)/\1/g" | sed "s/.* - \(.*\)/\1/g" + local name + + [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name) + [ -z "$name" ] && name="unknown" + + echo "$name" } _______________________________________________ openwrt-commits mailing list [email protected] https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits
