lantiq: add support for /tmp/sysinfo

Signed-off-by: John Crispin <blogic@openwrt.org>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@41472 3c298f89-4303-0410-b956-a3cf2f4a3e73
master
John Crispin 2014-07-02 16:33:11 +00:00
parent e72b4b2291
commit 6ec3299aa8
5 changed files with 28 additions and 8 deletions

View File

@ -33,7 +33,7 @@ rt2x00_eeprom_extract() {
case "$FIRMWARE" in case "$FIRMWARE" in
"RT2860.eeprom" ) "RT2860.eeprom" )
local board=$(lantiq_board_id) local board=$(lantiq_board_name)
case $board in case $board in
ARV7510PW22|ARV7519PW|ARV752DPW|ARV752DPW22) ARV7510PW22|ARV7519PW|ARV752DPW|ARV752DPW22)
rt2x00_eeprom_extract "board_config" 520 256 1 rt2x00_eeprom_extract "board_config" 520 256 1

View File

@ -17,7 +17,7 @@ for a in `ls /sys/class/leds/`; do
[ $? -eq 0 ] && ucidef_set_led_default $a $a $a `cat /sys/class/leds/$a/brightness` [ $? -eq 0 ] && ucidef_set_led_default $a $a $a `cat /sys/class/leds/$a/brightness`
done done
board=$(lantiq_board_id) board=$(lantiq_board_name)
case "$board" in case "$board" in
VG3503J) VG3503J)

View File

@ -68,7 +68,7 @@ payload="bridged"
lan_mac="" lan_mac=""
wan_mac="" wan_mac=""
board=$(lantiq_board_id) board=$(lantiq_board_name)
case "$board" in case "$board" in
# adm6996 # adm6996

View File

@ -3,10 +3,10 @@
set_wps() { set_wps() {
uci set wireless.$1.wps_pushbutton=0 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 case $board in
WBMR) WBMR)
config_load wireless config_load wireless

View File

@ -1,9 +1,29 @@
#!/bin/sh #!/bin/sh
lantiq_board_id() { lantiq_board_detect() {
grep "^machine" /proc/cpuinfo | sed "s/machine.*: \(.*\)/\1/g" | sed "s/\(.*\) - .*/\1/g" 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() { 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"
} }