openwrtv4/target/linux/brcm47xx/base-files/lib/preinit/01_sysinfo

17 lines
469 B
Text
Raw Normal View History

#!/bin/sh
do_sysinfo_brcm47xx() {
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_brcm47xx