Boot process
Overview
Once you press the power button on your postmarketOS device, it goes through the following steps:
- Device specific bootloader
- postmarketOS initramfs
- Init
- getty
(If the UI is none, it stops at here) - Display manager
- User Interface of choice
Early boot process
In the early boot process, the device specific bootloader will intialize the device hardware. After that the way it boots the OS in device-specific ways. (See below) See Category:Bootloaders to learn more about how different bootloaders work.
UEFI
On devices that support UEFI, pmOS generally boots via systemd-boot
Android boot image
On most Android devices, the bootloader on that device would boot the Android boot image that is in the partition labeled as boot
. That file contains the initramfs and kernel. Generally, pmOS would put its initramfs and kernel into a Android boot image and flash it to the boot partition. However, there are some Android devices that don't support Android boot images.
isorec
Very few Android devices don't expect a boot.img
file written to the Android boot partition, but rather just the Linux kernel, with an embedded initramfs. But we want the initramfs packaging to be independent of the kernel (not require a kernel rebuild to change the initramfs!). Therefore we use the so-called "isorec" trick here: the initramfs script built into the kernel is just a very small stub, that loads the real initramfs from the postmarketOS boot partition (example).
See also
- Partition Layout
- Category:Bootloaders
- Troubleshooting:boot
- Troubleshooting:boot:initfshooks
- pmaports#664: two postmarketOS installations: OpenRC may mount wrong partition as /boot
- postmarketOS low-level blog post (talks in part about liberating bootloaders)
- Deviceinfo: flash methods