Make initramfs-extra opt-in
The postmarketOS initramfs includes a lot of complexity for supporting a wild variety of hardware and user configurations. Part of this is the initramfs-extra archive which was introduced to ensure that postmarketOS could always boot on devices with extremely limited space available for the ramdisk.
It works by shoving lots of non-core components (like osk-sdl/unl0kr) into a seperate archive on the pmOS boot partition, this is then unpacked into RAM during boot so that the root partition can be unlocked.
At the time, the feature was enabled for all devices, and this is still the case to this day, despite the fact that only a handful of devices actually require it.
It is the only reason that we have to find and mount the pmOS_boot partition while in the ramdisk, and is also the only reason we even need a pmOS_boot partition on Android devices (and therefore also the only reason we need to deal with subpartitioning on these devices).
Action items
I suggest we do the following:
- Make a list of all devices that actually depend on initramfs-extra for full functionality
- Introduce a new deviceinfo variable
deviceinfo_split_initramfs
(ordeviceinfo_tiny_boot_partition
;P) and enable it for these devices - Adjust the behaviour of mkinitfs to insert an empty file
/initramfs_extra_flag
into the initramfs-extra archive, and concatenate the initramfs-extra CPIO archive to initramfs before compression if the afformentioned variable is set (magic feature of CPIO, kernel will unpack both archives together) - Adjust the behaviour of the initramfs to entirely skip finding/mounting the boot partition and unpacking initramfs-extra if
/initramfs_extra_flag
exists - Make Android devices without
deviceinfo_split_initramfs
no longer have a pmOS_boot partition and simply flash the rootfs partition directly.