diff options
Diffstat (limited to 'target/linux/brcm47xx/base-files/lib/preinit/01_sysinfo')
-rw-r--r-- | target/linux/brcm47xx/base-files/lib/preinit/01_sysinfo | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/target/linux/brcm47xx/base-files/lib/preinit/01_sysinfo b/target/linux/brcm47xx/base-files/lib/preinit/01_sysinfo index 8a2de67bc5..a3b0c38437 100644 --- a/target/linux/brcm47xx/base-files/lib/preinit/01_sysinfo +++ b/target/linux/brcm47xx/base-files/lib/preinit/01_sysinfo @@ -1,12 +1,16 @@ #!/bin/sh do_sysinfo_brcm47xx() { - local name="$(sed -ne 's/^machine[ \t]*: //p' /proc/cpuinfo)" - [ -z "$name" ] && name="unknown" + 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 "$name" > /tmp/sysinfo/board_name - echo "unknown" > /tmp/sysinfo/model + echo "$boardtype${boardnum:+:$boardnum}" > /tmp/sysinfo/board_name + echo "$model" > /tmp/sysinfo/model } boot_hook_add preinit_main do_sysinfo_brcm47xx |