split_boot is for fine grained control over what exactly gets flashed
at what point. It makes more sense for flash_dtbo to live in write_boot,
which does everything all at once.
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Some zips may want to flash just the dtbo so add a function that can be
called in anykernel.sh to make that happen.
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
- gzip in busybox 1.29.1 doesn't seem to use compression anymore, with -1 and -9 both coming
out to the same size, generally dramatically larger than previously resulting in
boot-new.img exceeding the partition size on some devices so then failing the check.
e.g. 28mb ramdisk.cpio -> 11.2mb ramdisk.cpio.gz in 1.28.4, is now 20mb in 1.29.1
thanks nathanchance for reporting
- adapted from https://github.com/nathanchance/AnyKernel2/commit/3dfba3dcabff3cf1f859276e1851ae35891d8801
- works around odd behaviors in TWRP on system-as-root devices, but retains working fallback using /system/system/build.prop if getprop also fails
- simplify unmount_all stderr redirection
Please see the above linked commit for further details.
Thanks to nathanchance for reporting, the device-specific workaround, and much testing
- was broken with search strings containing paths (a limitation with busybox sed)
- now matches blank lines and lines containing only white space for next-empty-line matching
- include end-of-file as the final possible end-point for next-empty-line matching
This reverts commit bafe4bd586.
A certain level of functioning recovery is expected by AnyKernel2 (versus this patch's source, the Magisk installer, which is extremely pessimistic).
- search using a list of known ramdisk/kernel or recovery by-name partition names
- block=auto is equivalent to block=boot
- for use with broad, device non-specific AK2-based mod zips
- remove "kernel" from "Installing" wording since AK2 is also used on recoveries, and multi-partition Treble devices and this could be misleading
- fix getprop build.prop fallback on /system/system devices
- check for and remove patch for multi-partition/reset_ak (so removal of ramdisk/ and patch/ with the addition of $(basename block)-files is now the full trigger)
- wipe $(basename block)-files/ramdisk to ensure proper copied output, as the original contents are retained in the copied rdtmp
- for ramdisk-only changes that don't require added files or patch snippets, create the $(basename block)-files subfolder for proper output backup with reset_ak
- if no ramdisk is found in the zip, check for and copy files in from "$(basename $block)-files", e.g. boot-files + recovery-files subfolders, each which can contain their own zImage, and ramdisk and patch subfolders, etc.
- as part of the reset_ak command, copy the output files back to the corresponding *-files subfolder for use in debugging
* when ak2-core.sh gets run again by reset_ak after changing block= in anykernel.sh the above process begins again
- was only available in the update-binary, so allow in anykernel.sh as well, for use with checking /system/build.prop, /default.prop, $ramdisk/default.prop, etc.
- clean up false error output where sections are already removed on repeat flashes
- move size check to just before flash since we must compare against the fully repacked, signed boot-new.img