summaryrefslogtreecommitdiff
path: root/target/linux/ppc40x/base-files/lib/preinit
diff options
context:
space:
mode:
authorMathias Kresin <dev@kresin.me>2017-04-07 18:01:17 +0200
committerMathias Kresin <dev@kresin.me>2017-07-15 23:13:34 +0200
commit78cf5eed6edaa38561e9c9c3ff14a36c1eedfadd (patch)
tree2fcf94f7ad5e69d0ea2ef62a83365f5afd98bb6b /target/linux/ppc40x/base-files/lib/preinit
parentac3e05c5d757334944fbf1f14583164cd1d69172 (diff)
downloadmtk-20170518-78cf5eed6edaa38561e9c9c3ff14a36c1eedfadd.zip
mtk-20170518-78cf5eed6edaa38561e9c9c3ff14a36c1eedfadd.tar.gz
mtk-20170518-78cf5eed6edaa38561e9c9c3ff14a36c1eedfadd.tar.bz2
treewide: do board detection during preinit
Do the board detection during preinit to unify it across all targets. Signed-off-by: Mathias Kresin <dev@kresin.me>
Diffstat (limited to 'target/linux/ppc40x/base-files/lib/preinit')
-rw-r--r--target/linux/ppc40x/base-files/lib/preinit/01_sysinfo12
1 files changed, 12 insertions, 0 deletions
diff --git a/target/linux/ppc40x/base-files/lib/preinit/01_sysinfo b/target/linux/ppc40x/base-files/lib/preinit/01_sysinfo
new file mode 100644
index 0000000..9f82c84
--- /dev/null
+++ b/target/linux/ppc40x/base-files/lib/preinit/01_sysinfo
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+do_sysinfo_ppc40x() {
+ local name="$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /model/ {print $2}' /proc/cpuinfo)"
+ [ -z "$name" ] && name="unknown"
+
+ [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
+ echo "$name" > /tmp/sysinfo/board_name
+ echo "unknown" > /tmp/sysinfo/model
+}
+
+boot_hook_add preinit_main do_sysinfo_ppc40x