Commit Graph
100 Commits
Author SHA1 Message Date
osm0sis 9d7f85807f AK2: fix stupid copy pasta error
thanks eng.stk for catching it
2018-10-01 13:18:43 -03:00
osm0sis 3ab879b71a AK2: add Android Pie /dev/block/by-name location to partition search list 2018-09-30 14:44:00 -03:00
osm0sis 361712b5e2 tools: update to latest builds, including busybox (1.29.2)
Compiled from my own updated forks:
https://github.com/osm0sis/mkbootimg
https://github.com/osm0sis/android-busybox-ndk

ARM binaries; see my Busybox Installer for busybox in other architectures:
https://github.com/Magisk-Modules-Repo/Busybox-Installer
2018-09-08 15:50:34 -03:00
osm0sis 30cca512d9 tools: bring back busybox 1.29.1 built with the broken gzip rolled back
https://bugs.busybox.net/show_bug.cgi?id=11171
2018-07-24 13:19:55 -03:00
osm0sis 8aa7b787e1 tools: revert to busybox 1.28.4 until an issue with 1.29.1 gzip can be resolved
- 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
2018-07-23 23:03:44 -03:00
osm0sis a53e3f765c tools: update to latest builds, including busybox (1.29.1), lz4 (1.8.2) and xz (5.2.4)
Compiled from my own updated forks:
https://github.com/osm0sis/mkbootimg
https://github.com/osm0sis/android-busybox-ndk

ARM binaries; see AIK-mobile v3.3 for other architectures and optional binaries:
https://forum.xda-developers.com/showthread.php?t=2073775
2018-07-23 10:39:04 -03:00
osm0sis b1524da099 Backend: move system_root mounting to after device check
- 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
2018-07-19 21:30:56 -03:00
osm0sis 0b8b09f29e AK2: fix repacked ramdisk check now that compext is local to repack_ramdisk
Thanks eng.stk for reporting and testing the fix
2018-07-16 23:16:26 -03:00
osm0sis 303e50e371 Example: fix more things confusing to new adopters
DO NOT MERGE if you have already updated your ramdisk/anykernel.sh properly for your device
2018-07-16 14:27:08 -03:00
osm0sis 6714cd3250 README: document patch_ueventd 2018-07-16 14:01:23 -03:00
osm0sis 955f3ce488 AK2: add patch_ueventd
- introduce function to modify or add entries to ueventd.rc using its spaced columns format, matched using the device node
2018-07-16 14:00:23 -03:00
osm0sis 1811b87a19 AK2: fix slot detection broken by block auto detection 2018-07-16 13:54:49 -03:00
osm0sis 915cdaff1b AK2: fix replace_section and remove_section functions
- 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
2018-07-14 16:48:45 -03:00
osm0sis 8ed75ed99c README: touch up new block= documentation to show full paths are still supported 2018-07-14 16:20:14 -03:00
osm0sis 56373a6a1c AK2: use local variables for ramdisk editing functions 2018-07-13 02:08:44 -03:00
osm0sis 5fbae260c0 Revert "Support more locations for dtbo img (#24)"
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).
2018-07-13 01:29:33 -03:00
osm0sis c545e6779e anykernel: fix ramdisk/sbin permissions
- while stock uses 750, Magisk and SuperSU both use 755 for sbin and contained binaries, so we had better do so as well
2018-07-13 01:27:54 -03:00
osm0sis 23a088f4c8 README: document block=auto, fix zip exclusions 2018-07-13 01:27:20 -03:00
osm0sis 75986e14d1 AK2: add auto detection of named block (e.g. boot, recovery) partitions (#19, #26)
- 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
2018-07-13 01:20:04 -03:00
osm0sis 2a34450ba9 AK2+Backend: move system_root setup and tear down to backend
- abstract out unmounting and expand to support undoing system_root
- also preserve and restore LD_PRELOAD
2018-07-03 20:49:31 -03:00
osm0sis 25d93de829 anykernel: fix special characters in prop values breaking shell execution 2018-05-30 00:01:57 -03:00
osm0sis caf289b584 Backend: misc fixes
- 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
2018-05-29 23:57:29 -03:00
Chris Renshaw f2ee53b843 AK2: fix AVBv1 auto signing
- BootSignature.jar uses stderr to print VALID on image verification, so the grep was always failing
2018-05-22 01:08:01 -03:00
Chris Renshaw b648bd74d6 Merge pull request #27 from googlebleh/googlebleh
README: fix command to match filename in repo
2018-05-19 12:46:18 -03:00
osm0sis 14826f628f AK2: fix elftool repack of ELF without cmdline 2018-03-24 11:31:39 -03:00
osm0sis a4cc13af28 tools: update to latest lz4 (1.8.1.2)
ARM binary; see AIK-mobile v3.2 for other architectures and optional binaries:
https://forum.xda-developers.com/showthread.php?t=2073775
2018-03-23 13:42:54 -03:00
osm0sis 6e14f5cfe9 Backend: fix modules support regression for /vendor
thanks @nathanchance for the quick heads-up
2018-03-23 13:29:55 -03:00
osm0sis e686f1f76c README: document multi-partition setup and auto slot detection 2018-03-23 12:31:00 -03:00
osm0sis 19a49f1f34 AK2: allow is_slot_device=auto (#21)
- for use with broad, device non-specific AK2-based mod zips
2018-03-23 12:19:08 -03:00
osm0sis 79b4c2c593 Backend: fix modules support regression on /system/system devices 2018-03-23 11:51:48 -03:00
osm0sis 966cea0d57 AK2: more multi-partition support improvements
- 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-23 11:32:59 -03:00
osm0sis d7c56e9c06 AK2: improve/expand multi-partition use cases
- 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-22 18:51:01 -03:00
osm0sis 1176e19406 AK2: only AVB sign if dumped original dumped image is signed (#20)
- 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-22 14:14:23 -03:00
osm0sis a4332bda2a README: document restore_file, add mkbootfs warning, fixes 2018-03-22 13:51:43 -03:00
osm0sis 4a7014d5aa AK2: add restore_file for use with ramdisk-only in a restore zip (#19)
thanks @Zackptg5
2018-03-22 13:42:57 -03:00
osm0sis 3baf2a564a README: update now that elftool is available in AIK-mobile 2018-03-20 00:11:23 -03:00
osm0sis ab830140ca README: add support thread 2018-03-17 13:41:27 -03:00
osm0sis 0acab592bb README: update for file_getprop 2018-03-07 15:17:12 -04:00
osm0sis 865564032d AK2: add file_getprop
- 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-07 15:15:41 -04:00
osm0sis 07cc7c31ce AK2: fix section functions with "" for next-blank-line end search 2018-03-07 14:24:39 -04:00
osm0sis 55ab97f6ec AK2: improve section functions, improve size check
- 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-07 10:52:14 -04:00
osm0sis c81b3d5658 AK2: add Nook HD+ and Nook Tablet signing loader support 2018-03-05 17:09:51 -04:00
osm0sis 1e3d48355e README: update for banner and version file support 2018-02-28 09:14:35 -04:00
Chris Renshaw 14e73ecbec AK2: fix cpio extraction with busybox 1.28+
"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-27 00:47:57 -04:00
osm0sis 12289267c5 Backend: touch up install whitespace now that we have banner/version display 2018-02-26 13:03:50 -04:00
osm0sis efa4623689 Backend: add custom kernel version display support
- place version text in a file named "version" in the root of the zip and it will display after the kernel.string when flashing
- useful in conjunction with build scripts, i.e. a generated version file not actually part of the kernel AK2 repo
2018-02-26 12:22:58 -04:00
osm0sis b0a2cae9cd Backend: add custom kernel banner support
- place text or line-art in a file named "banner" in the root of the zip and it will display
ahead of the kernel.string when flashing
2018-02-26 11:18:35 -04:00
osm0sis 7391ede9b9 tools: update to latest busybox (1.28.1)
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-25 13:56:31 -04:00
osm0sis 7b09dd8b66 Backend: fix vendor unmounting 2018-02-25 13:54:45 -04:00
osm0sis e32f6915ef AK2: fix insert_line wc/ash bad number error when missing file 2018-02-25 13:54:43 -04:00
Chris Renshaw 893aef6df2 Merge pull request #16 from Tomoms/master
ak2-core.sh: fix repacking of Sony ELF kernels
2018-01-25 18:31:41 -04:00
osm0sis 153567dcaf README: document new patch_cmdline usage 2018-01-19 03:00:29 -04:00
osm0sis 2b7501710d AK2: clarify new patch_cmdline usage 2018-01-19 03:00:04 -04:00
osm0sis 83df1e3df1 Backend: only replace getprop if needed (and do so more robustly) 2018-01-19 01:58:49 -04:00
Chris Renshaw 4308266480 Merge pull request #15 from nathanchance/insert-line-offset
AK2: Fix insert_line line validation
2018-01-18 02:01:41 -04:00
osm0sis d4f81e628e AK2: add reset_ak(), fix patch_cmdline(), improve AVBv1 signing
- 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-15 02:41:23 -04:00
osm0sis 79f1c391ea AK2: allow U-Boot uImage without ramdisk 2018-01-13 17:47:37 -04:00
osm0sis c3ca17f3cf README: update for elftool 2018-01-13 17:47:27 -04:00
osm0sis fb44ff18e1 AK2: add support for repacking as Sony ELF
- 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)
2018-01-13 17:15:51 -04:00
Chris Renshaw 4e31cbd461 Merge pull request #14 from nathanchance/module-contexts
Backend: Only apply contexts to new modules
2018-01-08 12:36:12 -04:00
Chris Renshaw d0648af3a5 Merge pull request #13 from nathanchance/moar-modules
Backend: Allow multiple module directories
2018-01-02 09:05:36 -05:00
osm0sis 81066ed3d7 README: document "OG AK" mode 2017-12-14 13:19:08 -04:00
osm0sis 7f47e21362 AK2: add "OG AK" mode by making the unpack/repack procedure more granular
- 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-14 13:03:23 -04:00
osm0sis 13f2018ee3 tools: update to latest builds
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-14 11:45:44 -04:00
osm0sis 79df8fcf0b AK2+Backend: misc fixes
- 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-12-03 08:50:51 -04:00
osm0sis df1999911b README: update for dtbo support 2017-11-29 13:50:02 -04:00
osm0sis 3269b51d28 AK2: add dtbo and Pixel 2 slot prop support
- 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-29 13:34:51 -04:00
osm0sis 5da00cb54d Example: remove AK2 attribute command confusing to new adopters
DO NOT MERGE if you have already updated your ramdisk properly for your device
2017-11-26 18:19:10 -04:00
osm0sis c578db07ff anykernel: underp ownership, thanks @attack11 2017-11-26 18:14:11 -04:00
osm0sis 45766e2afc AK2: tidy up compression support a little more 2017-11-22 19:31:34 -04:00
osm0sis 34631228b0 README: update documentation for ramdisk_compression variable 2017-11-22 13:45:39 -04:00
osm0sis 02b9dd7d21 anykernel: add ramdisk_compression shell variable, see 0535fd7ca0 2017-11-22 13:32:06 -04:00
osm0sis 0535fd7ca0 AK2: allow forcing repack ramdisk compression format of choice
- 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-22 13:28:47 -04:00
osm0sis e6b8326197 README: update documentation for multiple compression support 2017-11-22 09:59:18 -04:00
osm0sis 1ffbf0d1af AK2+tools: add support for alternate ramdisk compression formats
- 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-11-22 09:58:20 -04:00
osm0sis 6bcf2668e4 AK2: improve cpio ramdisk unpacking
- 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-10-14 13:42:51 -03:00
osm0sis e7faefc0b9 anykernel: be clear ownership is also necessary to be set 2017-10-14 13:36:23 -03:00
osm0sis 721c5db7c2 Example: clean ups and fixes for current functions
- remove more things confusing to new adopters (AK2 does not root)
- update patch_fstab examples for corrected syntax

DO NOT MERGE if you have already updated your ramdisk properly for your device
2017-10-14 13:34:00 -03:00
osm0sis aa1377c9ab AK2: fix patch_fstab substring replacement
- 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-22 01:35:51 -03:00
osm0sis 65019b0f49 Backend: fix -debugging functionality on abort, clean up abort 2017-09-22 00:18:31 -03:00
osm0sis 4863f79152 AK2: fix abort ui_prints from slot detection checks 2017-09-22 00:16:10 -03:00
osm0sis 8db96bb746 README: add rkcrc to optional binaries 2017-09-11 12:13:37 -03:00
osm0sis 66b221ef99 AK2: add KRNL and NOOK signed image support
- 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-11 12:10:14 -03:00
osm0sis c867216f91 tools: update to latest builds, including busybox (1.27.2)
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-10 23:26:12 -03:00
osm0sis d5c58cdadb README: optional binaries update 2017-09-10 23:14:17 -03:00
osm0sis d60281c8b2 AK2: add DHTB signed image support
- add built-in support for dhtbsign for Samsung/Spreadtrum board devices signature header (see: https://github.com/osm0sis/dhtbsign)
2017-09-10 23:05:47 -03:00
osm0sis 1787580bf9 AK2: rename pxa1088- AOSP variant tools to pxa- per upcoming AIK release 2017-09-10 22:55:53 -03:00
osm0sis ce29998bf9 AK2: silence possible expected mount stderr with AVB signing 2017-08-20 01:00:53 -03:00
osm0sis e6d3b4271e Backend: miscellaneous fixes
- fix busybox getting permissions on some devices where chmod does not accept -R to recurse
- use busybox for more possibly non-standard broken recovery shell commands
- silence some more generally expected/inconsequential stderr
2017-08-20 01:00:45 -03:00
Chris Renshaw db7cb4f306 Backend: fix module copying on devices with links
- symlinks under /system/lib/modules were getting broken, so follow them instead to replace the target file, avoiding issues with multiple versions of the same module and running out of free space (e.g. OnePlus devices link /system/lib/modules/wlan.ko to /system/lib/modules/qca_cld3/qca_cld3_wlan.ko)
- set contexts on copied modules (following symlinks) to system_file to avoid SELinux issues where unlabeled module files might not be allowed to load
2017-08-14 02:46:18 -03:00
osm0sis 79c2ab4f60 AK2: fix AVB signing 2017-07-14 13:16:12 -03:00
osm0sis b91ec4deda AK2: better fix for unknown hash type
- 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-04 15:47:31 -03:00
osm0sis adc21ed2c3 AK2: allow next blank line (" ") for replace_section and remove_section
- 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-07-04 14:24:12 -03:00
osm0sis 45bfc5d602 AK2: assume sha1 if "unknown" hash type encountered
- 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-26 21:00:23 -03:00
osm0sis 05cb01112d AK2: accept .pem certificates for AVB signing
- 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-16 17:00:46 -03:00
osm0sis ec285b291a README: add BootSignature_Android.jar to optional binary list 2017-06-06 13:28:03 -03:00
osm0sis 697e286654 AK2: add Android Verified Boot (AVB) signature support
- 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-06 13:24:47 -03:00
osm0sis 89ba5089d2 tools: update to latest unpackbootimg build
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-06-05 16:27:16 -03:00
osm0sis 282e05ec47 update README 2017-05-28 19:57:29 -03:00
osm0sis c4d0ed8f9c Backend: add developer option to create a debugging archive
- to make it easier to diagnose issues with patches, image creation or flashing, adding "-debugging" to the end of the AK2 zip filename will enable the creation of a tar.gz of the entire /tmp directory after the installation process (but before cleanup, of course), this includes recovery.log, boot.img, boot-new.img and any other remnants to allow more thorough, direct debugging at a later time
2017-05-28 18:44:46 -03:00