02_sysinfo 378 B

12345678910
  1. do_sysinfo_generic() {
  2. [ -d /proc/device-tree ] || return
  3. mkdir -p /tmp/sysinfo
  4. [ -e /tmp/sysinfo/board_name ] || \
  5. echo "$(strings /proc/device-tree/compatible | head -1)" > /tmp/sysinfo/board_name
  6. [ ! -e /tmp/sysinfo/model -a -e /proc/device-tree/model ] && \
  7. echo "$(cat /proc/device-tree/model)" > /tmp/sysinfo/model
  8. }
  9. boot_hook_add preinit_main do_sysinfo_generic