1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-27 22:53:09 +02:00

ar71xx: change user-space board detection

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@29432 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
juhosg 2011-12-05 12:56:20 +00:00
parent 71573bb739
commit 1f7d4ca407
2 changed files with 25 additions and 6 deletions

View File

@ -1,9 +1,12 @@
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2009 OpenWrt.org # Copyright (C) 2009-2011 OpenWrt.org
# #
ar71xx_board_name() { AR71XX_BOARD_NAME=
AR71XX_MODEL=
ar71xx_board_detect() {
local machine local machine
local name local name
@ -199,10 +202,24 @@ ar71xx_board_name() {
*ZCN-1523H-5) *ZCN-1523H-5)
name="zcn-1523h-5" name="zcn-1523h-5"
;; ;;
*)
name="generic"
;;
esac esac
echo $name [ -z "$name" ] && name="unknown"
[ -z "$AR71XX_BOARD_NAME" ] && AR71XX_BOARD_NAME="$name"
[ -z "$AR71XX_MODEL" ] && AR71XX_MODEL="$machine"
[ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
echo "$AR71XX_BOARD_NAME" > /tmp/sysinfo/board_name
echo "$AR71XX_MODEL" > /tmp/sysinfo/model
}
ar71xx_board_name() {
local name
[ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
[ -z "$name" ] && name="unknown"
echo "$name"
} }

View File

@ -2,6 +2,8 @@
do_ar71xx() { do_ar71xx() {
. /lib/ar71xx.sh . /lib/ar71xx.sh
ar71xx_board_detect
} }
boot_hook_add preinit_main do_ar71xx boot_hook_add preinit_main do_ar71xx