- all working directory variables
- all user set variables
- add backwards compat so devs have time to update anykernel.sh
- overdue core variable cleanup, part 3/x
- attributes function now runs via core in setup_ak and reset_ak, but only if it exists, allowing more easy removal of it for setups with no ramdisk changes (so all should now remove the awkward `&& attributes` call from anykernel3.sh, see next commit)
- for multi-partition zips with multiple ramdisks requiring different files, multiple attributes functions may now be specified, either redefine attributes() in anykernel.sh for the next partition, or add a different function for each partition, e.g. boot_attributes() and vendor_boot_attributes()
- fix block=auto multi-partition setup creating an "auto-files" directory instead of final found block, e.g. "init_boot-files"
- only parse kernel strings when both do.modules=1 and do.systemless=1 are set
- support post-fs-data.sh in systemless kernel helper module (gets renamed and sourced from the built-in one)
- show systemless kernel helper module as an update pending reboot in module apps if flashed while booted
- add system_ext support to systemless kernel helper module
- show a warning during flash if systemless kernel helper module is configured but there's no decrypted /data access to be able to install it
- detect the installed KernelSU app as the indicator the user intends to use KernelSU, and install systemless kernel helper module to modules_update.img accordingly
- do KernelSU directory setup and create modules_update.img if this appears to be the initial KernelSU install
- set all systemless kernel helper module files to system_file context, since unlabeled files are not gracefully handled by KernelSU (they trigger a reboot and the module gets rejected)
NOTE: currently it appears KernelSU won't parse the modules_update.img on the first boot where it sets itself up from initial KernelSU install, but it will then do it after the following reboot. Hopefully this can be fixed by a future KernelSU release so that the systemless kernel helper module is active right away as this might be necessary to boot fully on some devices
- latest Android has moved dalvikvm to /apex/com.android.art/bin/dalvikvm but there's currently no way to run this from recovery due to linkerconfig
- AVBv1 signing is most likely only needed on older devices running older Android which will still have /system/bin/dalvikvm so this shouldn't really affect anything
- tidy up flash_generic block display output to match setup_ak
- add helpful flash_generic debugging stderr for mapper flashing
- hide flash_boot harmless stderr from strings command in TWRP
- restore block=auto covering both ramdisk and boot, with ramdisk list favored to accomodate init_boot
- favor mapper/by-name in flash_generic
- add block/by-name over bootdevice/by-name in flash_generic to mirror block=auto/<name> path finding behavior
- remove whitelist to allow auto-detect for any partition based on by-name filename only
- add more error catching for manually specified partition paths
- restore Huawei Treble partitions to auto-detect (kernel, ramdisk and recovery_ramdisk)
- starting with Pixel 7 series, boot_img_hdr_v4 is now even more complicated, adding 2 more new partitions (init_boot and vendor_kernel_boot) so let's attempt to keep it as simple as we can
- if init_boot partition is detected split up flash files for boot (kernel), init_boot (ramdisk), and vendor_kernel_boot (dtb)
- continue to support current practice of Image* and dtb in zip root by automatically creating a multi-partition AK3 zip setup from these files (ramdisk directory is for the init_boot partition since that's where Magisk and overlay.d will be)
NOTE 1: anykernel.sh must still be setup for multi-parition patching - see the updated Example file for parts to uncomment
NOTE 2: currently magiskboot still does not support unpack/repack of VNDRBOOT v4 multi-ramdisk format (i.e. vendor_boot v4 and vendor_kernel_boot) so if modifications are necessary in these ramdisks they will need to be prebuilt and flashed whole by including vendor_boot.img and/or vendor_kernel_boot.img in the zip root
- both boot for kernel and init_boot for first stage ramdisk access to overlay.d will be needed
- remove ramdisk and recovery_ramdisk from detection since devices which use them also use kernel partition and would need to be multi-partition setups either way
- this supports custom kernel users to continue not having to fastboot reflash vbmeta with --disable-verity and --disable-verification, now that Magisk 24303+ no longer patches avb out of the fstab on-the-fly at boot time
- checks for an avb option in the fstab entry for the current partition
- if found, it checks if verity or verification is disabled on the top-level vbmeta, and if so, appends a hashtree and FEC data to the partition and updates the hashtree descriptor in the vbmeta partition referenced in the avb option
- add flash_generic support for flashing to dynamic/logical partitions larger than stock using phhusson's lptools binary
- enable full automated support for flashing custom vendor_dlkm.img (note: must NOT be sparse format; factory images are sparse, but images generated from source are not)
Co-authored-by: Chris Renshaw <osm0sis@outlook.com>
- exclude "zimage" as a compression type since magiskboot unpack, split and repack handle it automatically and there is no fallback
- ensure $comp is a working command for all busybox compression fallbacks
Patching system partition entry won't work if system_ext partition is present. Fix this by adding [[:space:]] to the end of the pattern.
Note that grep -w can't be used in this case because there is still a possibility of erroneous matches from grep using / as a whole word delimiter, e.g., logical vendor partition (that is just "vendor") and "/vendor/dsp".