diff options
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 |