2017-04-07 16:01:17 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
do_sysinfo_brcm47xx() {
|
2018-07-30 06:36:26 +00:00
|
|
|
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"
|
2017-04-07 16:01:17 +00:00
|
|
|
|
|
|
|
[ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
|
2018-07-30 06:36:26 +00:00
|
|
|
echo "$boardtype${boardnum:+:$boardnum}" > /tmp/sysinfo/board_name
|
|
|
|
echo "$model" > /tmp/sysinfo/model
|
2017-04-07 16:01:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
boot_hook_add preinit_main do_sysinfo_brcm47xx
|