summaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-11-12 23:40:16 +0000
committerblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-11-12 23:40:16 +0000
commitbddadbe32baf2954ea49087cb81c1a5fc58eb7bb (patch)
tree6d5c2e14ba4fe1136e4e0ec04cd56a757edabdc7 /target
parenta8be2afd85a63700f228e0829de05304b04d753e (diff)
lantiq: add /lib/lantiq.sh and make hotplug handlers use it
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@29003 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom4
-rw-r--r--target/linux/lantiq/base-files/lib/lantiq.sh9
2 files changed, 12 insertions, 1 deletions
diff --git a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
index e2dfc1631..ad5652a7f 100644
--- a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
+++ b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
@@ -24,9 +24,11 @@ rt2x00_eeprom_extract() {
[ -e /lib/firmware/$FIRMWARE ] && exit 0
+. /lib/lantiq.sh
+
case "$FIRMWARE" in
"RT2860.eeprom" )
- local board=$(grep ^machine /proc/cpuinfo | sed "s/machine.*: \(.*\) - .*/\1/g")
+ local board=$(lantiq_board_name)
case $board in
ARV7525PW)
rt2x00_eeprom_extract "board_config" 1040 272
diff --git a/target/linux/lantiq/base-files/lib/lantiq.sh b/target/linux/lantiq/base-files/lib/lantiq.sh
new file mode 100644
index 000000000..75e8ac272
--- /dev/null
+++ b/target/linux/lantiq/base-files/lib/lantiq.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+lantiq_soc_name() {
+ grep ^system /proc/cpuinfo | sed "s/system type.*: \(.*\)/\1/g"
+}
+
+lantiq_board_name() {
+ grep ^machine /proc/cpuinfo | sed "s/machine.*: \(.*\)/\1/g" | sed "s/\(.*\) - .*/\1/g"
+}