20_sysinfo 472 B

12345678910111213141516171819202122232425262728293031
  1. do_sysinfo_octeon() {
  2. local machine
  3. local name
  4. machine=$(grep "^system type" /proc/cpuinfo | sed "s/system type.*: \(.*\)/\1/g")
  5. case "$machine" in
  6. "UBNT_E100"*)
  7. name="erlite"
  8. ;;
  9. "UBNT_E200"*)
  10. name="er"
  11. ;;
  12. "UBNT_E220"*)
  13. name="erpro"
  14. ;;
  15. *)
  16. name="generic"
  17. ;;
  18. esac
  19. [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
  20. echo "$name" > /tmp/sysinfo/board_name
  21. echo "$machine" > /tmp/sysinfo/model
  22. }
  23. boot_hook_add preinit_main do_sysinfo_octeon