openwrt/target/linux/bcm47xx/base-files/lib/preinit/01_sysinfo
Adrian Schmutzler 48c1fdd046 treewide: drop shebang from non-executable target files
This drops the shebang from all target files for /lib and
/etc/uci-defaults folders, as these are sourced and the shebang
is useless.

While at it, fix the executable flag on a few of these files.

This does not touch ar71xx, as this target is just used for
backporting now and applying cosmetic changes would just complicate
things.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-06-16 14:26:33 +02:00

15 lines
456 B
Plaintext

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