- use proper variable for ramdisk in mkbootfs support
patch_cmdline:
- if match not present, appends to the end of the current commandline
- if match is present, expands to full string (to allow for item=value entries), and optionally replaces with a second string, or just removes the entry, then cleans up doublespaces and trailing whitespace
"Some older scripts may still use ‘.’ in place of the ‘:’ separator. POSIX 1003.1-2001 does not require support for that, but for backward compatibility GNU chown supports ‘.’ so long as no ambiguity results. New scripts should avoid the use of ‘.’ because it is not portable, and because it has undesirable results if the entire owner‘.’group happens to identify a user whose name contains ‘.’."
Source: http://gnu.org/software/coreutils/manual/html_node/chown-invocation.html#chown-invocation.
- Chainfire inlines support for this into SuperSU (unlike the similar LG Bump support which must be added via /data/custom_boot_image_patch.sh), so we must also.
- on Sony devices supporting standard boot.img on unloacked bootloaders first AK2 flash would convert from ELF to boot.img, but second flash would attempt to use unpackelf again and fail, so fallback to unpackbootimg
- requires updated unpackelf binary for Sony ELF devices (see: https://github.com/osm0sis/unpackelf)
- add built-in support for futility for ChromeOS devices (see https://github.com/osm0sis/futility)
- small path cleanup since we generally need to be in /tmp/anykernel for post-repack anyway
- these seem to confuse new adopters, so end up left in the ramdisks of various devices where they are not applicable
DO NOT MERGE if you have already updated your ramdisk properly for your device
- add built-in support for mtd-utils (nanddump, flash_erase, nandwrite) for MTD-based Android devices that do not work with dd
- wipe boot block with dd before write to be clean/safe (SuperSU zip also does this)
Known working mtd-utils ARM binaries can be found in my FlashIt v2.5 package:
https://forum.xda-developers.com/showthread.php?t=2239421
- add built-in support for unpackelf for Sony ELF devices (see: https://github.com/osm0sis/unpackelf)
- kernel section is not gzipped on ELF devices with non-QCDT/non-ELF dtb, which needs compression and the dtb appended before it can be repacked (thanks @tobiaswaldvogel)
- new shell variable "is_slot_device" to enable slot suffix detection
("block" shell variable remains the partition filepath minus the suffix)
Notes: on slot-based systems now the boot.img contains only the recovery ramdisk, not rootfs, by default, but when rooted contains both, with rootfs in /boot. Since modifications to both recovery and (when rooted) boot ramdisks are now possible through AK2 no other behavior is changed so that the dev may modify what they wish, e.g. to add files to rooted boot ramdisk put them in AK2's ramdisk/ folder in a boot/ subfolder, and to make modifications to rooted boot files add "boot/" to the filenames used with the commands.
- still unable to do an actual tweak check due to grep being limited to single lines, but..
- have them check to at least ensure there's a match for end string that comes after begin string so the sed should function without any chance of removing more than intended
- use simple replacement to automatically escape forward slashes (/) to make remove_section and replace_section perform like the other functions, since they are needed as part of a sed /pattern/,/pattern/d delete operation
- update documentation