Skip to content

Draft: Support for bootimg_vendor_android_boot_image device option

Vendor boot image should be accessible for the boot image generation, if dualbooting Android and PostmarketOS. Android boot image should be repacked in modern u-boot's FIT image format. This needed to shrink it's size (useful when using initramfs in boot partition for u-boot payload), and to move load addresses out of u-boot code base.

This option allows to place working android boot image under device /boot directory, and use that in boot image generation.

If deviceinfo_bootimg_vendor_android_boot_image specifies existing file, few things happens:

  • unpack file to vendor_boot_image directory
  • override device's header parameters with extracted ones, if deviceinfo_bootimg_override_header_info_using_vendor_image is "true"
  • split kernel and appended dtbs
  • find dtb, used by device, by dt identifiers, specified in deviceinfo_bootimg_vendor_device_tree_identifiers. It's a regular expressions, separated by space, to filter device tree, used by bootloader. For example: "qcom,msm-id\s=\s<0x141\s0x20001>; qcom,board-id\s=\s<0x08\s0x0e>;". Device tree matches, only if matches all identifiers. Matched dt replaces deviceinfo_bootimg_override_payload_append_dtb value.

Initramfs can be overridden with multiple file. Those are aligned to block size and concatenated preserving the order. Multiple file names should be splitted with space.

Add tests for new boot deploy functions. Add os_version and os_patch_level to generated bootimage. If changed, trustzone in Android will attempt to regenerate key, and use existing Android installation. Set that to extracted values from vendor image.

Alphabetize deviceinfo option list

See also related MRs: mkinitifs

Edited by Dzmitry

Merge request reports