postmarketOS

samsung i9100 (Samsung Galaxy SII)

Contributors

What works

What does not work

How to enter flash mode

Boot process

Unlike most other Android devices, the i9100 can not boot a boot.img (which consists of kernel + initramfs). Instead, the boot.img file is just a regular kernel. Here's an example from a LineageOS boot.img for the i9100 (for "real" boot.img files, file says something like boot.img: Android bootimg, kernel, ramdisk, page size: 2048 ):

/tmp/test # file boot.img
boot.img: Linux kernel ARM boot executable zImage (little-endian)

However, it is possible to directly integrate a initramfs into the kernel at kernel compile time (this is totally different from the boot.img approach, if this is unclear to you, please ask in the channel), and this is what the Android ROMs do on the i9100. While it is not a big deal in the Android compilation process, it is a problem for postmarketOS, because we want to be able to build the initramfs independently from the kernel.

The following workaround is currently implemented: We flash the real initramfs to the recovery partition (source) The initramfs init script built into the kernel checks if the recovery partition contains a compressed initramfs, and if it does, it extracts it and passes execution to the real initramfs' init script. * This idea is based on something called "isorec".

While this works for the i9100, this approach needs to be improved to also work on other Samsung devices, that need to be flashed with heimdall, like the i9070 (see #22).

Links

Photos