545 Commits
Author SHA1 Message Date
osm0sis 62392072b2 tools: update to latest builds, including busybox (1.30.1), lz4 (1.9.0)
Compiled from my own updated forks:
https://github.com/osm0sis/mkbootimg
https://github.com/osm0sis/android-busybox-ndk

ARM binaries; see AIK-mobile v3.5 for other architectures and optional binaries:
https://forum.xda-developers.com/showthread.php?t=2073775
2019-04-18 09:35:40 -03:00
osm0sis ac441a6eaa AK2: fix customdd detection logic 2019-04-06 21:46:23 -03:00
osm0sis a40fe9c65b AK2: add backwards compat for crazy devices hacking their mmcblk0
see comments here: https://github.com/osm0sis/AnyKernel2/pull/38#issuecomment-479577751

This will allow the current way people were adding arguments to dd via block= but also allow them to control this directly by adding customdd= to anykernel.sh.
2019-04-05 21:24:52 -03:00
Park Ju Hyung 3998baa529 AK2: optimize write operations
- dd uses bs=512 by default, which is far from optimal for sequential reads.
   Use bs=1048576(1M) for initial dump.
   This improves read performance by a measurable amount.

 - Zero-fill only the remaining blocks.
   There's no need to zero-fill all blocks,
   not to mention the additional/unnecessary wear and tear
   to the flash storage.

   Linux pipe uses bs=4096 by default. By using cat for this,
   we additionally gain much better write performance.

   On the OnePlus 6T, final write operation took 7.1 seconds in total with
   2 consecutive dd commands. With cat, it now takes 0.08 seconds.

Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
2019-04-03 14:07:15 -03:00
osm0sis 3ea64d006a AK2: workaround for U-Boot dumpimage failing on untrimmed uImage dumps
https://lists.denx.de/pipermail/u-boot/2019-January/355670.html
2019-03-21 17:13:56 -03:00
osm0sis c109065a3d AK2: fix ramdisk repack and mtk signing when uncompressed cpio 2019-02-08 23:19:21 -04:00
osm0sis b7f18eadfd README: document cpio compression support 2019-02-07 13:02:59 -04:00
osm0sis 82e7c0345b AK2: add support for uncompressed cpio ramdisks
ramdisk_compression=cpio or =none to force
2019-02-07 13:00:42 -04:00
osm0sis a1f20c0d53 Backend: support all half-sensible ROM version formats
9
9.0
9.0.0

Anything else is insanity.
2019-01-02 17:08:22 -04:00
osm0sis 34d8a65fbe Backend: workaround bad ROM versioning practices in supported check
- some ROMs have taken it upon themselves to go against AOSP, i.e. where starting with Pie AOSP now versions it as only 9, some ROMs are still making it 9.0
- introduce integer 2 float function that will add a decimal place to all for comparisons
- this should support the majority of ROMs, but anything crazy like 9.0.0, or crazier like 09.0.0 should be frowned upon by the community and the ROM devs should be made to get it together and follow AOSP
2018-12-20 13:46:52 -04:00
osm0sis 9d49de1caf Backend: clean up mounting
- only mount system when not already mounted (avoids harmless stderr during booted flashes)
- optimize module targeting and mount logic further
2018-12-16 23:38:21 -04:00
osm0sis 2ec3b8cf72 README: touchups to supported.versions documentation
(Android 8.1 was 8.1.0 in build.prop ;) )
2018-12-16 19:14:03 -04:00
osm0sis 414a9dcea0 Revert "anykernel: fix ramdisk/sbin permissions"
This reverts commit c545e6779e.

Magisk and SuperSU actually keep these as the proper 750 within the boot.img ramdisk itself, and so should we
2018-12-16 18:37:29 -04:00
osm0sis 614be6510b README: document supported.versions 2018-12-16 18:37:15 -04:00
osm0sis ddf0e59256 anykernel: add supported.versions 2018-12-16 18:36:54 -04:00
osm0sis a31d03f2ce Backend: introduce Android version check
- checks the supported.versions prop in anykernel.sh and matches against it to prevent users flashing incorrect kernels for ROM versions
- supported.versions can be a list, e.g. "7.1.2, 8.0, 8.1" or a range, e.g. "8.1 - 9" of versions in the correct formatting for that Android version in ro.build.version.release in /system/build.prop
2018-12-16 18:31:53 -04:00
osm0sis 9e24ea91f1 README: add replace_string scope + note re: extra device.name# entries 2018-12-16 14:23:33 -04:00
osm0sis d9acb3384d AK2: allow replace_string to optionally global scope replace 2018-12-16 14:03:47 -04:00
osm0sis 1d58385b26 AK2+Backend: fix file_getprop truncating if prop value contained =
See comments: https://github.com/osm0sis/AnyKernel2/pull/35#issuecomment-447648900
2018-12-16 13:53:33 -04:00
osm0sis 56b4244d53 Backend: cleanups 2018-12-15 09:00:36 -04:00
osm0sis 77fe6bffeb Backend: more robust getprop checks and replacements
- getprop failures are not only a system-as-root device issue, as it now also happens on OnePlus 5T in recovery when ROM is Pie Open Beta
- this appears to come down to a libc mismatch between recovery and ROM resulting in direct property checks failing but getprop without arguments printing all properties working
- revert most of https://github.com/osm0sis/AnyKernel2/commit/b1524da099efa716616a8eb3357876bca6a73540 since this should remain resolved with the new implementation
- keep the old check and file_getprop fallback for devices without getprop entirely
- add new getprop fallback that parses the full getprop output
2018-12-14 16:29:53 -04:00
osm0sis dda2ee9bbf README: document device.name<num> limit removal 2018-12-14 15:46:22 -04:00
osm0sis da8c2d1e6c Backend: allow infinite device.name<num>= device check properties (#34) 2018-12-14 15:43:25 -04:00
osm0sis fd881bd8d7 Backend: only attempt module bind remount if already mounted
- blindly attempting to remount broke module placement on some ROMs (e.g. Pocophone MIUI stock)
2018-12-11 13:34:37 -04:00
osm0sis 6d5332e054 Backend: attempt remounting module location as well
- some custom ROMs on some devices (e.g. Lineage on Pocophone) bind mount modules in /system over modules on /vendor, so remount rw at the bind target to ensure the bind source is also remounted and replaced
- toybox mount doesn't accept the /. prefixed paths from find so ensure we use busybox for mounts

Thanks franciscofranco and topjohnwu for the tips!
2018-12-11 02:35:15 -04:00
osm0sis e1ae4412f5 AK2: add AOSP boot_img_hdr_v1 support 2018-10-28 19:30:59 -03:00
osm0sis 301ed77319 tools: update to latest builds, including busybox (1.29.3), lz4 (1.8.3)
Compiled from my own updated forks:
https://github.com/osm0sis/mkbootimg
https://github.com/osm0sis/android-busybox-ndk

ARM binaries; see AIK-mobile v3.4 for other architectures and optional binaries:
https://forum.xda-developers.com/showthread.php?t=2073775
2018-10-28 19:28:03 -03:00
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
Nathan Chancellor 51662f9a1d README: Document flash_dtbo
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2018-08-03 00:03:46 -03:00
Nathan Chancellor 5ce0e9f2d4 AK2: Move flash_dtbo into write_boot
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>
2018-08-03 00:03:46 -03:00
Nathan Chancellor d067d39b83 AK2: Expose dtbo flashing
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>
2018-08-03 00:03:46 -03:00
DarkLord1731 e92d8f96c6 AK2: Allow reading multiple lines from version file
This becomes handy to display some additional details apart from just showing the kernel version
2018-07-29 06:58:38 -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
Nathan Chancellor 01bf828e78 backend: Break out of device check loop if a match is found
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2018-07-16 21:28:54 -03:00
Nathan Chancellor dd914e3385 backend: Break out of device check loop if a blank value is found
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2018-07-16 21:28:54 -03:00
Nathan Chancellor cea9c5a247 backend: Cache build.prop values in device check block
These values are static, we don't need to keep getting them with
getprop.

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
2018-07-16 21:28:54 -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