Commit Graph
76 Commits
Author SHA1 Message Date
osm0sis 0b37d0bfa4 AK3+Backend: add preliminary KernelSU support 2023-07-04 15:32:02 -03:00
osm0sis c91542d29f AK3: don't attempt to AVBv1 sign if /system/bin/dalvikvm is not present
- latest Android has moved dalvikvm to /apex/com.android.art/bin/dalvikvm but there's currently no way to run this from recovery due to linkerconfig
- AVBv1 signing is most likely only needed on older devices running older Android which will still have /system/bin/dalvikvm so this shouldn't really affect anything
2023-06-05 12:56:37 -03:00
osm0sis c878b3e62b Backend: fix loop mounts on newer Lineage-based recoveries
- loops would fail only in LOS Recovery from direct mount .img and losetup .img+loop mount with, e.g. "mount: mounting /dev/block/loop0 on /apex/com.android.adbd failed: Invalid argument"
- this started ~LOS19, I believe, though I haven't tracked down the specific change yet
- confusing to diagnose, since it always works in recovery adb shell, until I realized there was a context difference: "su" for adb shell and "recovery" for zip flashes
- switch shell context temporarily to "su" to do apex mounts, then return to original context (currently only necessary for mounting loops)
2023-05-26 07:25:10 -03:00
osm0sis 15b90dc7db tools: newer busybox (1.36.1) patched to fix loop mounts on kernels <5.x
Compiled from my own updated fork:
https://github.com/osm0sis/android-busybox-ndk
2023-05-25 18:41:34 -03:00
osm0sis f4cbd4b68d Backend: fixup now that mount_apex direct .img mount works 2023-05-24 15:26:02 -03:00
osm0sis 8055e75b8e Backend: move busybox bin setup to setup_bb function, add tools to PATH 2023-05-06 15:21:34 -03:00
Captain Trips 68564baf10 AK3: clear cow before logical partition replace or resize (#78) 2023-05-04 13:36:15 -03:00
osm0sis ba82924dab AK3+Backend: pass AKHOME via export 2023-05-03 15:45:34 -03:00
osm0sis b3c769f1db AK3+Backend: use busybox as much as possible + OLD_PATH for exceptions 2023-04-23 00:09:54 -03:00
osm0sis f080b80e30 Backend: refactor mount_all and umount_all
- only umount /metadata and /persist if not already mounted, as some recoveries have these always mounted
- combine into list of possibly pre-mounted partitions to umount
2023-04-22 08:18:14 -03:00
osm0sis c45a8d52c0 Backend: support /metadata mount + debugging improvements
- look for .ak3-debugging file in /tmp /cache /metadata or /persist to allow debugging better on recoveries that only support sideload
- use /tmp for ak3-debug.tgz if sideloading, and fix .tgz compression when apex fails to mount
2023-04-21 16:42:22 -03:00
osm0sis d6e040c227 AK3: update for latest magiskboot, don't un/repack kernel if not patched 2023-04-18 13:27:44 -03:00
Captain Trips ddbb40edc8 AK3: detect flashing to inactive slot during OTA on VAB devices (#77) 2023-04-16 18:06:44 -03:00
engstk 9664985a0b tools: update magisk utils to v26.0(26000) beta
Signed-off-by: engstk <eng.stk@sapo.pt>
2023-04-06 09:34:56 -03:00
osm0sis 8588147d67 Backend: fix byname finding on modern Android versions for devices without super
- /dev/block/mapper exists on all devices with apex but only contains system partition symlinks on devices with super partition logical partitions
2023-04-05 23:19:05 -03:00
osm0sis 7a3e6df8ca Backend: fix showing ui_printfile padding char in error when booted 2023-03-23 17:05:57 -03:00
osm0sis 7c8c1e7e9b Backend: fix ui_printfile on Lineage-based recoveries
- add padding character to work around bad handling of leading whitespace which CWM-based and TWRP-based both handle fine
2023-03-16 17:10:24 -03:00
osm0sis 398b9631df Backend: correct build.prop locations for getprop replacement
- system_ext and odm only have build.prop in /<partition>/etc
- product may have build.prop in /product and/or /product/etc
2023-02-08 12:56:54 -04:00
osm0sis 6ffb765c8c AK3: correct cmdline to remove any type of leading whitespace 2023-01-20 12:37:19 -04:00
osm0sis 8077d11135 AK3: also remove leading spaces from cmdline 2023-01-09 19:19:13 -04:00
osm0sis e49ea0be95 Backend: don't unmount any existing apex at start of flash 2023-01-08 14:03:30 -04:00
osm0sis c2e0bd7c4b AK3: flash_* display/output/debug improvements
- tidy up flash_generic block display output to match setup_ak
- add helpful flash_generic debugging stderr for mapper flashing
- hide flash_boot harmless stderr from strings command in TWRP
2023-01-07 14:25:44 -04:00
osm0sis aea91db9e7 AK3: block=auto and flash_generic improvements
- restore block=auto covering both ramdisk and boot, with ramdisk list favored to accomodate init_boot
- favor mapper/by-name in flash_generic
- add block/by-name over bootdevice/by-name in flash_generic to mirror block=auto/<name> path finding behavior
2023-01-06 22:16:52 -04:00
osm0sis e4e0c0eecb Backend: add useful mount debugging stderr for logs 2023-01-05 23:30:47 -04:00
osm0sis 1fd27023b8 AK3: partition auto-detect improvements
- remove whitelist to allow auto-detect for any partition based on by-name filename only
- add more error catching for manually specified partition paths
- restore Huawei Treble partitions to auto-detect (kernel, ramdisk and recovery_ramdisk)
2022-12-01 19:59:09 -04:00
osm0sis 020ca6fddb AK3: add support for simple init_boot + vendor_kernel_boot setup
- starting with Pixel 7 series, boot_img_hdr_v4 is now even more complicated, adding 2 more new partitions (init_boot and vendor_kernel_boot) so let's attempt to keep it as simple as we can
- if init_boot partition is detected split up flash files for boot (kernel), init_boot (ramdisk), and vendor_kernel_boot (dtb)
- continue to support current practice of Image* and dtb in zip root by automatically creating a multi-partition AK3 zip setup from these files (ramdisk directory is for the init_boot partition since that's where Magisk and overlay.d will be)

NOTE 1: anykernel.sh must still be setup for multi-parition patching - see the updated Example file for parts to uncomment
NOTE 2: currently magiskboot still does not support unpack/repack of VNDRBOOT v4 multi-ramdisk format (i.e. vendor_boot v4 and vendor_kernel_boot) so if modifications are necessary in these ramdisks they will need to be prebuilt and flashed whole by including vendor_boot.img and/or vendor_kernel_boot.img in the zip root
2022-11-11 22:20:59 -04:00
Matthew Alex 042d0ccf6d AK3: add support for vendor_kernel_boot (#75) 2022-10-19 23:07:26 -03:00
Captain Trips 70fb859ec1 lptools: use a different overload of MetadataBuilder::New (#74) 2022-08-27 16:12:55 -03:00
Captain Trips 97794de0a2 AK3: use lptools resize for vendor_dlkm (#73)
- default to replace and fallback to resize when not enough space in super
2022-08-02 17:31:51 -03:00
engstk 330de65c77 tools: update magisk utils to v25.2(25200) stable
Signed-off-by: engstk <eng.stk@sapo.pt>
2022-07-27 12:19:30 -03:00
Captain Trips bc736e9ce1 AK3: add support for avb patching (#70)
- this supports custom kernel users to continue not having to fastboot reflash vbmeta with --disable-verity and --disable-verification, now that Magisk 24303+ no longer patches avb out of the fstab on-the-fly at boot time
- checks for an avb option in the fstab entry for the current partition
- if found, it checks if verity or verification is disabled on the top-level vbmeta, and if so, appends a hashtree and FEC data to the partition and updates the hashtree descriptor in the vbmeta partition referenced in the avb option
2022-06-08 13:33:19 -03:00
engstk f81b0b2db6 tools: update magisk utils to v25.0(25000) beta
Signed-off-by: engstk <eng.stk@sapo.pt>
2022-06-07 20:21:32 -03:00
Captain TripsandChris Renshaw 79cb6945ff AK3: add support for resizing logical partitions (#69)
- add flash_generic support for flashing to dynamic/logical partitions larger than stock using phhusson's lptools binary
- enable full automated support for flashing custom vendor_dlkm.img (note: must NOT be sparse format; factory images are sparse, but images generated from source are not)

Co-authored-by: Chris Renshaw <osm0sis@outlook.com>
2022-04-30 20:01:03 -03:00
osm0sis 4ebf8e538c Backend: add id to helper module.prop so 3rd party mgr apps are happy 2022-04-28 23:36:54 -03:00
osm0sis adb09dcc81 AK3: ensure no template files from beginner devs get to the ramdisk 2022-04-23 18:47:35 -03:00
osm0sis 97d2d7ffd5 AK3: also ensure $comp fallback is a working command for ramdisks 2022-04-10 22:30:19 -03:00
osm0sis c19c5be18c AK3: fix unpack/repack with magiskboot zimage kernel support
- exclude "zimage" as a compression type since magiskboot unpack, split and repack handle it automatically and there is no fallback
- ensure $comp is a working command for all busybox compression fallbacks
2022-04-03 09:19:15 -03:00
osm0sis 991bb673a7 tools: update magisk utils to v24.3(24300) stable 2022-03-10 19:17:40 -04:00
Chris Renshaw 743bb44ed1 AK3: add support for new upstream AOSP init_boot partition
https://android-review.googlesource.com/c/platform/build/+/1882268
2022-03-04 13:45:59 -04:00
osm0sis 446ad5d85d tools: update magisk utils to v24.2(24200) beta 2022-03-02 09:00:45 -04:00
Alexander Winkowski 3e99a63e92 AK3: fix no_block_display behaviour with flash_generic (#65) 2022-02-01 13:14:43 -04:00
osm0sis af9b68cd4c tools: update magisk utils to v24.1(24100) stable 2022-01-28 22:50:58 -04:00
engstk 52f96e80d2 tools: update magisk utils to v24.0(24000) beta
Signed-off-by: engstk <eng.stk@sapo.pt>
2022-01-26 13:10:40 -04:00
engstk 6aec94e549 tools: update magisk utils to 5f4cd50c (23017) canary
Signed-off-by: engstk <eng.stk@sapo.pt>
2022-01-20 18:06:52 -04:00
engstk 11cb678fb3 tools: update magisk utils to 92546e8a(23016) canary
Signed-off-by: engstk <eng.stk@sapo.pt>
2021-12-15 20:33:34 -04:00
osm0sis 1edb7e9f39 Backend: fix devicecheck now that we can't abuse file_getprop with .* 2021-12-11 00:15:34 -04:00
osm0sis 6e7fcd6d28 AK3: add magiskboot KEEPVBMETAFLAG support
- some devices fail to boot when magiskboot changes the vbmeta flag is set in the AVBv2 signature from 00 to 03, this allows disabling that behavior
- set keep_vbmeta_flag=1 in anykernel.sh to force it to keep whatever's there, =auto will take it from the existing image if Magisk-patched (Canary 23016 or later), and =0 will allow the default magiskboot behavior
2021-12-10 23:30:24 -04:00
Chris Renshaw 08a76000ad AK3: unbreak anykernel scripts using flash_dtbo directly 2021-12-06 13:45:16 -04:00
osm0sis 297d6c3b99 AK3: add flash_generic to reduce code duplication 2021-12-06 10:04:54 -04:00
Chris Renshaw ae28b9dc92 Increment AK_BASE_VERSION for latest changes 2021-12-05 03:15:25 -04:00