-
Notifications
You must be signed in to change notification settings - Fork 10
EXTENDROM_PREROOT_BOOT (legacy2)
this is left here for historical reasons. see the NEW guide here
| State | Branch | Supported Android version(s) | Tested on | Howto Guide |
|---|---|---|---|---|
DEPRECATED |
main |
A9, A10, A11, A12, A13 |
A9, A10, A11, A12, A13 |
see the NEW guide here |
[1] might work on lower and/or higher Android versions, too but that is untested
If you have used this method before commit d9ab7a9 you need to remove any custom bootimg makefile you have added by the legacy guide!
| flag | values | meaning | where to configure |
|---|---|---|---|
| EXTENDROM_PREROOT_BOOT | can be unset or true
|
must be true to activate patching a boot.img with MAGISK |
device/<vendor>/<model>/vendorsetup.sh or device/<vendor>/<model>/<any>.mk
|
| EXTENDROM_PACKAGES | one of (mutually exclusive):Magisk,SignMagisk, Magisk_vXX.xx, SignMagisk_vXX.xx
|
specify the Magisk type and version |
device/<vendor>/<model>/vendorsetup.sh or device/<vendor>/<model>/<any>.mk
|
Pre-rooting with MAGISK seemingless within the AOSP build process while keeping AVB / DM-VERITY intact !
- when executing
vendor/extendrom/er.shthe specified Magisk version will be downloaded, extracted and all necessary components moved to a temporary patch dir (out/.magisk) - When building your ROM a completely unmodified magisk boot_patch.sh will be executed (also a completely unmodified utils_functions.sh gets included) which actually does the patching of your boot.img like the Magisk App would do.
Note: There is no custom mkbootimg.mk required anymore! This is included in extendrom from now on.
This comes with a disadvantage: if you need a custom bootimg makefile BOARD_CUSTOM_BOOTIMG_MK := xxxxxxx in your BoardConfig.mk then you need to adjust it manually as before. There is no generic way to solve this but check out the extendrom make file here and the old guide explaining everything needed here
EXTENDROM_PREROOT_BOOT = trueEXTENDROM_PACKAGES = Magisk | SignMagisk | Magisk_vXX.xx | SignMagisk_vXX.xx
When choosing just Magisk|SignMagisk in EXTENDROM_PACKAGES you will always get the latest (supported) Magisk release.
If you want a specific version set it accordingly to any of the supported versions in EXTENDROM_PACKAGES.
So when to use "Magisk" and when "SignMagisk" ?
The short answer is: usually you want "Magisk" (i.e. without the "Sign" keyword).
SignMagisk will sign the Magisk package with your own signature and this prevents upgrading even the Magisk app later (as the signatures are different). If you have a device where you are able to re-lock the bootloader this becomes useful though as it adds a (simple) barrier to "prevent" from upgrading Magisk. Upgrading just the Magisk app itself will not break the system but flashing Magisk into the boot image will (verity will reject booting as the checksums are not matching anymore). So this actually does not prevent anything if the user reboots to recovery and flashes Magisk there but at least it was useful for me so I remember not doing nasty things on a locked device.
Examples:
EXTENDROM_PACKAGES="Magisk"EXTENDROM_PACKAGES="Magisk_v25.2"EXTENDROM_PACKAGES="SignMagisk_v23.0"
Note: extendrom supports only v22 and later! This is due to the merge of ZIP (installer) and APK (MagiskManager) introduced with v22.
-
MAGISK_TARGET_ARCH=arm-> OPTIONAL: when using 32-bit devices (ONLY then)*
(*)note: MAGISK_TARGET_ARCH will be parsed when set in your vendorsetup.sh or specified as env variable.
It can be arm or arm64 which will copy the correct libs according to whats specified.
If unset the default is expecting arm64 - so ensure you set it for 32-bit devices (see above)!