Openwrt Boot Notes

Version 1.1 by Leon Poon on 2019/01/05 14:43

 

initramfs-kernel

kernel runs /init.

/init is a script which sets INITRAMFS=1 and then execs /sbin/init.

/sbin/init is ELF comes from procd package. What it does:

  • early:
    • mount /proc, /sysfs, and create /dev nodes, create /tmp subdirs etc
    • set PATH
  • kmodloader in subprocess
  • preinit
    • plugd in subprocess (seem to deal with firmware)
    • /etc/preinit in subprocess
  • when /etc/preinit is done then it execs and replaces itself with the "real" /sbin/procd