summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2018-05-03Support more locations for dtbo img (#24)Zackptg5
* Support more locations for dtbo img (from Magisk's util_functions.sh)
2018-03-24AK2: fix elftool repack of ELF without cmdlineosm0sis
2018-03-23tools: update to latest lz4 (1.8.1.2)osm0sis
ARM binary; see AIK-mobile v3.2 for other architectures and optional binaries: https://forum.xda-developers.com/showthread.php?t=2073775
2018-03-23AK2: allow is_slot_device=auto (#21)osm0sis
- for use with broad, device non-specific AK2-based mod zips
2018-03-23AK2: more multi-partition support improvementsosm0sis
- 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
2018-03-22AK2: improve/expand multi-partition use casesosm0sis
- 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
2018-03-22AK2: only AVB sign if dumped original dumped image is signed (#20)osm0sis
- avoids issues for broad AK2-based mod zips on devices where AVB 1.0 signed images cause issues, while maintaining signing on AVB 1.0 devices
2018-03-22AK2: add restore_file for use with ramdisk-only in a restore zip (#19)osm0sis
thanks @Zackptg5
2018-03-07AK2: add file_getproposm0sis
- 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.
2018-03-07AK2: fix section functions with "" for next-blank-line end searchosm0sis
2018-03-07AK2: improve section functions, improve size checkosm0sis
- 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
2018-03-05AK2: add Nook HD+ and Nook Tablet signing loader supportosm0sis
2018-02-27AK2: fix cpio extraction with busybox 1.28+Chris Renshaw
"cpio: skipping unsafe symlink to '/system/vendor' in archive, set EXTRACT_UNSAFE_SYMLINKS=1 to extract", introduced by https://git.busybox.net/busybox/commit/?id=bc9bbeb2b81001e8731cd2ae501c8fccc8d87cc7 Thanks @nathanchance for the quick heads up
2018-02-25tools: update to latest busybox (1.28.1)osm0sis
Compiled from my own updated fork: https://github.com/osm0sis/android-busybox-ndk ARM binary; see my Odds & Ends for other architectures: https://forum.xda-developers.com/showthread.php?t=2239421
2018-02-25AK2: fix insert_line wc/ash bad number error when missing fileosm0sis
2018-01-25ak2-core.sh: fix repacking of Sony ELF kernelsTommaso Fonda
elftool fails to repack the ELF boot image on Sony devices when a custom dtb file is not provided within the AnyKernel2 zip, because the "dtb" variable, that contains the name of the dtb file, is overridden before the dtb filename is actually passed to the "rpm" variable. Swapping these two lines of code fixes the issue (tested by me on a Sony Xperia SP).
2018-01-19AK2: clarify new patch_cmdline usageosm0sis
2018-01-17AK2: Fix insert_line line validationNathan Chancellor
Currently, trying to use insert_line to insert something on the second to last line fails and places it on the last line. AK2 line: insert_line test "sched_boost 0" after "on property:sys.boot_completed=1" " write /proc/sys/kernel/sched_boost 0" Before: on property:sys.boot_completed=1 bootchart stop After: on property:sys.boot_completed=1 bootchart stop write /proc/sys/kernel/sched_boost 0 Expected result: on property:sys.boot_completed=1 write /proc/sys/kernel/sched_boost 0 bootchart stop In this example, the file length is 2 but the line we're inserting at is also 2, which is perfectly fine because everything will get shifted down by 1. Only if the file length is less than the desired position (in this example, 3) should be handled by >>. All three cases are now handled fine by insert_line (position 1, 2, and 3). Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2018-01-15AK2: add reset_ak(), fix patch_cmdline(), improve AVBv1 signingosm0sis
- introduce reset_ak function to reset the /tmp/anykernel directory to allow for multi-partition mods; use after changing the AK2 shell (block, etc.) variables again - make patch_cmdline more intuitive; match the string, and if it doesn't exist add the replacement string, and if so replace with it - allow AVBv1 signing of recovery by adding simple partition type detection based on name - restore LD_LIBRARY_PATH after AVBv1 signing to be friendly to recovery when flashed in between other zips
2018-01-13AK2: allow U-Boot uImage without ramdiskosm0sis
2018-01-13AK2: add support for repacking as Sony ELFosm0sis
- add built-in support for elftool for older Sony devices which don't support AOSP boot.img repacks (see: #3, https://forum.xda-developers.com/xperia-j-e/development/arm-elftool-pack-unpack-boot-image-sony-t2146022)
2017-12-14AK2: add "OG AK" mode by making the unpack/repack procedure more granularosm0sis
- split dump_boot into split_boot + unpack_ramdisk and write_boot into repack_ramdisk + flash_boot - fully backwards compatible as dump_boot and write_boot still exist and call these new functions (i.e. no changes needed to anykernel.sh) - those that wish to do zImage-only AK2 packages can now use split_boot intead of dump_boot and and flash_boot instead of repack_ramdisk in their anykernel.sh - add failsafe check for failed boot-new.img creation to ensure abort before wiping target partition in edge cases
2017-12-14tools: update to latest buildsosm0sis
Compiled from my own updated forks: https://github.com/osm0sis/mkbootimg ARM binaries; see AIK-mobile v3.0 for other architectures and optional binaries: https://forum.xda-developers.com/showthread.php?t=2073775
2017-12-03AK2+Backend: misc fixesosm0sis
- hide some expected stderr for AK2 mods with no additional ramdisk files - fix U-Boot support by passing correct repacked ramdisk filename - fix multi-compression support during repack derp - fix cleanup on successful flash not working due to double match from cleanuponabort
2017-11-29AK2: add dtbo and Pixel 2 slot prop supportosm0sis
- dtbo may be added as dtbo or dtbo.img to the base of the zip - new Pixel 2 ro.boot.slot doesn't contain _ like Pixel ro.boot.slot_suffix does Thanks @nathanchance for the majority of the work and research on this one, via #12
2017-11-22AK2: tidy up compression support a little moreosm0sis
2017-11-22AK2: allow forcing repack ramdisk compression format of choiceosm0sis
- ramdisk_compression=auto; (or undefined) in anykernel.sh is the default, automatically repacking with the detected unpack format - changing auto to gz lzo lzma xz bz2 lz4-l (for lz4 legacy) or lz4 force the repack as that format
2017-11-22AK2+tools: add support for alternate ramdisk compression formatsosm0sis
- to this point only gzip was supported, so add support for bzip2, lzop, lzma, xz and lz4 by detecting file magic via plaintext od dump comparison - busybox contains all necessary formats except for lzma/xz compression (has decompression), and lz4 so add both of these binaries to the minimal default setup ARM binaries; see AIK-mobile v2.9 for other architectures and optional binaries: https://forum.xda-developers.com/showthread.php?t=2073775
2017-10-15AK2: Allow users to use either "" or " " for empty stringsNathan Chancellor
Either one is now valid: patch_fstab fstab.qcom /system ext4 options "discard" " " patch_fstab fstab.qcom /system ext4 options "discard" "" Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2017-10-15AK2: Sanitize patch_fstab for proper commasNathan Chancellor
Users may forget to place the commas for removal or they may want to remove something in the middle. This will remove all commas at the beginning and end and will make sure there are only single commas between entries. Examples: Options: ro,barrier=1,discard,errors=panic patch_fstab fstab.qcom /system ext4 options "discard,errors=panic" "" patch_fstab fstab.qcom /system ext4 options ",errors=panic" "" patch_fstab fstab.qcom /system ext4 options "errors=panic" "" patch_fstab fstab.qcom /system ext4 options "discard" "" Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2017-10-15AK2: Improve patch_fstabNathan Chancellor
After aa1377c, trying to remove part of the original string was not possible. Example: patch_fstab fstab.qcom /system ext4 flags “wait,verify” “wait” Because "wait" is within "wait,verify", the entire if block will miss since grep will succeed in finding it. To work around this, we'll allow users to leave the last part blank and put in the part they want to remove as the fifth parameter. Example: patch_fstab fstab.qcom /system ext4 flags “,verify” “” Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2017-10-14AK2: improve cpio ramdisk unpackingosm0sis
- add workaround for malformed ramdisks without leading directory cpio entries - explicitly set ramdisk root directory to 755 (AOSP default) to avoid issues in some environments
2017-09-22AK2: fix patch_fstab substring replacementosm0sis
- the 'original string' ($5) was not being used, instead the entire part was always being replaced with the 'replacement string' ($6) - replace the target 'original string' of the entry part with 'replacement string' as expected/intended NOTE: any properly written patch_fstab commands with original string as the complete original part WILL remain working as this is a backwards compatible change
2017-09-22AK2: fix abort ui_prints from slot detection checksosm0sis
2017-09-11AK2: add KRNL and NOOK signed image supportosm0sis
- add built-in support for rkcrc for Rockchip board devices signed ramdisk image (see: https://github.com/rockchip-linux/rkflashtool) - add built-in detection and support for Barnes & Noble Nook 'Green Loader/Green Recovery' signature
2017-09-10tools: update to latest builds, including busybox (1.27.2)osm0sis
Compiled from my own updated forks: https://github.com/osm0sis/mkbootimg https://github.com/osm0sis/android-busybox-ndk ARM binaries; see AIK-mobile v2.9 for other architectures and optional binaries: https://forum.xda-developers.com/showthread.php?t=2073775
2017-09-10AK2: add DHTB signed image supportosm0sis
- add built-in support for dhtbsign for Samsung/Spreadtrum board devices signature header (see: https://github.com/osm0sis/dhtbsign)
2017-09-10AK2: rename pxa1088- AOSP variant tools to pxa- per upcoming AIK releaseosm0sis
2017-08-20AK2: silence possible expected mount stderr with AVB signingosm0sis
2017-07-14AK2: fix AVB signingosm0sis
2017-07-04AK2: better fix for unknown hash typeosm0sis
- https://github.com/osm0sis/AnyKernel2/commit/45bfc5d602582c53433bd2398bdc5876a7e260c9 broke the error catching on unpackbootimg - more easily worked around during repack, see linked commit for rationale for the assumption
2017-07-04AK2: allow next blank line (" ") for replace_section and remove_sectionosm0sis
- sometimes it's difficult to anchor to specific end lines due to variations across ROMs, so allow the end line to be blank " " - note this will also remove the trailing blank line so for replacements a trailing \n should be added to maintain spacing; this should be pretty intuitive since you are including the blank line as the end line search
2017-06-26AK2: assume sha1 if "unknown" hash type encounteredosm0sis
- some Samsung device images can be unpacked and repacked with the standard tools but the id sha1 is offset differently than in the standard header resulting in broken hash type detection
2017-06-16AK2: accept .pem certificates for AVB signingosm0sis
- turns out BootSignature.jar accepts .pem as well as .der - AOSP uses "verity" keys by default for boot signatures: https://github.com/android/platform_build/tree/master/target/product/security
2017-06-06AK2: add Android Verified Boot (AVB) signature supportosm0sis
- add built-in support for BootSignature_Android.jar for AVB signature enforcing devices (see https://forum.xda-developers.com/android/software-hacking/signing-boot-images-android-verified-t3600606)
2017-06-05tools: update to latest unpackbootimg buildosm0sis
Compiled from my own updated fork: https://github.com/osm0sis/mkbootimg ARM binary; see AIK-mobile v2.8 for other architectures and optional binaries: https://forum.xda-developers.com/showthread.php?t=2073775
2017-05-26AK2+Backend: tidy up remaining intentional stderrosm0sis
- no need to see these when there is an expected error during normal use
2017-05-26AK2: add uImage and PXA1088 boot.img variant supportosm0sis
- add built-in support for dumpimage/mkimage for DENX U-Boot uImage devices (see: http://git.denx.de/u-boot.git) - add built-in support for pxa1088-unpackbootimg/pxa1088-mkbootimg for Marvell PXA1088 board devices' deviation from the AOSP standard (see: https://github.com/osm0sis/pxa1088-mkbootimg)
2017-05-04AK2: introduce .prop files patching functionosm0sis
patch_prop: - if matched name is not present, appends new prop entry to the end of the file - if matched name is present, replaces the entry with the new value
2017-05-04tools: update to latest builds, including busybox (1.26.2)osm0sis
Compiled from my own updated forks: https://github.com/osm0sis/mkbootimg https://github.com/osm0sis/android-busybox-ndk ARM binaries; see AIK-mobile v2.7 for other architectures and optional binaries: https://forum.xda-developers.com/showthread.php?t=2073775