aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq/base-files/lib/preinit/03_preinit_board.sh
blob: aef946036eb1613b2da609805c64b5189d5780a7 (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=`grep "^machine" /proc/cpuinfo | sed "s/machine.*: \(.*\)/\1/g" | sed "s/\(.*\) - .*/\1/g"`
	model=`grep "^machine" /proc/cpuinfo | sed "s/machine.*: \(.*\)/\1/g" | sed "s/.* - \(.*\)/\1/g"`
	[ -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