03_preinit_board.sh 533 B

12345678910111213141516171819
  1. #!/bin/sh
  2. lantiq_board_detect() {
  3. name=`grep "^machine" /proc/cpuinfo | sed "s/machine.*: \(.*\)/\1/g" | sed "s/\(.*\) - .*/\1/g"`
  4. model=`grep "^machine" /proc/cpuinfo | sed "s/machine.*: \(.*\)/\1/g" | sed "s/.* - \(.*\)/\1/g"`
  5. [ -z "$name" ] && name="unknown"
  6. [ -z "$model" ] && model="unknown"
  7. [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
  8. echo $name > /tmp/sysinfo/board_name
  9. echo $model > /tmp/sysinfo/model
  10. }
  11. do_lantiq() {
  12. . /lib/functions/lantiq.sh
  13. lantiq_board_detect
  14. }
  15. boot_hook_add preinit_main do_lantiq