diff options
author | Adrian Schmutzler <freifunk@adrianschmutzler.de> | 2020-02-07 15:42:54 +0100 |
---|---|---|
committer | Adrian Schmutzler <freifunk@adrianschmutzler.de> | 2020-02-14 14:10:51 +0100 |
commit | 8fe5ad5d3373cebed4fbc55a7b779721971ce427 (patch) | |
tree | 5d9106ede800508dde24c21dda7f90b8b1b8af5b /target/linux/bcm47xx/base-files/lib/preinit/01_sysinfo | |
parent | 8590e70fab64172700c21bc5e658eba17a1eae70 (diff) | |
download | upstream-8fe5ad5d3373cebed4fbc55a7b779721971ce427.tar.gz upstream-8fe5ad5d3373cebed4fbc55a7b779721971ce427.tar.bz2 upstream-8fe5ad5d3373cebed4fbc55a7b779721971ce427.zip |
brcm47xx: rename target to bcm47xx
This change makes the names of Broadcom targets consistent by using
the common notation based on SoC/CPU ID (which is used internally
anyway), bcmXXXX instead of brcmXXXX.
This is even used for target TITLE in make menuconfig already,
only the short target name used brcm so far.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'target/linux/bcm47xx/base-files/lib/preinit/01_sysinfo')
-rw-r--r-- | target/linux/bcm47xx/base-files/lib/preinit/01_sysinfo | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/target/linux/bcm47xx/base-files/lib/preinit/01_sysinfo b/target/linux/bcm47xx/base-files/lib/preinit/01_sysinfo new file mode 100644 index 0000000000..8c7bd399da --- /dev/null +++ b/target/linux/bcm47xx/base-files/lib/preinit/01_sysinfo @@ -0,0 +1,16 @@ +#!/bin/sh + +do_sysinfo_bcm47xx() { + local boardtype="$(nvram get boardtype)" + local boardnum="$(nvram get boardnum)" + local model="$(sed -ne 's/^machine[ \t]*: //p' /proc/cpuinfo)" + + [ -z "$model" ] && model="unknown" + [ -z "$boardtype" ] && boardtype="unknown" + + [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" + echo "$boardtype${boardnum:+:$boardnum}" > /tmp/sysinfo/board_name + echo "$model" > /tmp/sysinfo/model +} + +boot_hook_add preinit_main do_sysinfo_bcm47xx |