lantiq.sh 740 B

1234567891011121314151617181920212223242526272829
  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. lantiq_board_model() {
  12. local model
  13. [ -f /tmp/sysinfo/model ] && model=$(cat /tmp/sysinfo/model)
  14. [ -z "$model" ] && model="unknown"
  15. echo "$model"
  16. }
  17. lantiq_board_name() {
  18. local name
  19. [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
  20. [ -z "$name" ] && name="unknown"
  21. echo "$name"
  22. }