aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq/base-files/lib/preinit
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2017-03-17 16:17:42 +0100
committerJo-Philipp Wich <jo@mein.io>2017-12-13 14:54:12 +0100
commit0f0d742ae35523d300667c7a39874fd4fcfdde89 (patch)
treef94f21f933240055dfaa36ee0fca85e7179b7c2a /target/linux/lantiq/base-files/lib/preinit
parentf173464f13102e6901c60de417b50b44d93bcbde (diff)
downloadupstream-0f0d742ae35523d300667c7a39874fd4fcfdde89.tar.gz
upstream-0f0d742ae35523d300667c7a39874fd4fcfdde89.tar.bz2
upstream-0f0d742ae35523d300667c7a39874fd4fcfdde89.zip
lantiq: move lantiq_board_detect() to 03_preinit_board.sh
It is only used there Signed-off-by: Felix Fietkau <nbd@nbd.name> (cherry picked from commit aa95d6cd20f7e08420562b9747c197c2eac1d2e2)
Diffstat (limited to 'target/linux/lantiq/base-files/lib/preinit')
-rwxr-xr-xtarget/linux/lantiq/base-files/lib/preinit/03_preinit_board.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/target/linux/lantiq/base-files/lib/preinit/03_preinit_board.sh b/target/linux/lantiq/base-files/lib/preinit/03_preinit_board.sh
index 6d4bd67af5..aef946036e 100755
--- a/target/linux/lantiq/base-files/lib/preinit/03_preinit_board.sh
+++ b/target/linux/lantiq/base-files/lib/preinit/03_preinit_board.sh
@@ -1,5 +1,15 @@
#!/bin/sh
+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
+}
+
do_lantiq() {
. /lib/functions/lantiq.sh