openwrtv3/target/linux/lantiq/base-files/lib/preinit/01_preinit_board.sh
Mathias Kresin 26dc65b126 lantiq: remove the former board name from device tree model
Remove the former used board name from the device model property and
use the model name as it is.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2017-12-16 23:33:56 +01:00

19 lines
434 B
Bash
Executable file

#!/bin/sh
lantiq_board_detect() {
name="$(strings /proc/device-tree/compatible | head -1)"
model="$(cat /proc/device-tree/model)"
[ -z "$name" ] && name="unknown"
[ -z "$model" ] && model="unknown"
[ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
echo $name > /tmp/sysinfo/board_name
echo $model > /tmp/sysinfo/model
}
do_lantiq() {
. /lib/functions/lantiq.sh
lantiq_board_detect
}
boot_hook_add preinit_main do_lantiq