Jump to content

Boot process: Difference between revisions

From postmarketOS Wiki
Exkc (talk | contribs)
No edit summary
update to gitlab.postmarketos.org
Line 17: Line 17:
On most Android devices, the bootloader on that device would boot the Android boot image that is in the partition labeled as <code> boot</code>. 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.
On most Android devices, the bootloader on that device would boot the Android boot image that is in the partition labeled as <code> boot</code>. 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 ====
==== isorec ====
Very few Android devices don't expect a <code>boot.img</code> 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 ([https://gitlab.com/postmarketOS/pmaports/-/blob/1d2b62a1094e77e50e1a52c48b07eecb1fbfd26a/device/testing/linux-samsung-i9100/APKBUILD#L31-50 example]).
Very few Android devices don't expect a <code>boot.img</code> 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 ([https://gitlab.postmarketos.org/postmarketOS/pmaports/-/blob/1d2b62a1094e77e50e1a52c48b07eecb1fbfd26a/device/testing/linux-samsung-i9100/APKBUILD#L31-50 example]).


== See also ==
== See also ==

Revision as of 07:49, 4 November 2024

Overview

Once you press the power button on your postmarketOS device, it goes through the following steps:

  1. Device specific bootloader
  2. postmarketOS initramfs
  3. Init
  4. Display manager (If the UI is none, it stops at getty)
  5. 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