diff options
Diffstat (limited to 'target/linux/lantiq/base-files/lib/preinit/01_preinit_board.sh')
-rwxr-xr-x | target/linux/lantiq/base-files/lib/preinit/01_preinit_board.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/target/linux/lantiq/base-files/lib/preinit/01_preinit_board.sh b/target/linux/lantiq/base-files/lib/preinit/01_preinit_board.sh new file mode 100755 index 0000000000..aef946036e --- /dev/null +++ b/target/linux/lantiq/base-files/lib/preinit/01_preinit_board.sh @@ -0,0 +1,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 |