aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq/base-files/lib/preinit/01_preinit_board.sh
blob: a40185ad3c9fa641a1b838b1e77a21fdc27e5efe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/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