Commit Graph
100 Commits
Author SHA1 Message Date
osm0sis d2f06464d8 tools: update magisk utils to v26.3(26300) stable 2023-09-04 07:10:30 -03:00
osm0sis df90d744fd AK3: add overlay.d warning for KernelSU users 2023-08-30 19:59:16 -03:00
osm0sis 051f79300f AK3: fix unset PATCHVBMETAFLAG, only read kernel strings once 2023-08-30 19:47:39 -03:00
osm0sis b52433bf12 AK3: fix repack return check with magiskboot 2023-08-28 22:37:04 -03:00
Chris Renshaw 7b28c94d1f README: update for KernelSU support 2023-08-22 23:27:54 -03:00
Chris Renshaw 87d6fc9545 Example: use boot_attributes instead of deprecated attributes
DO NOT MERGE if you have already updated your zip properly for your device
2023-08-22 12:35:28 -03:00
Chris Renshaw 2680ecb2cd README: update for supported.vendorpatchlevels 2023-08-22 02:01:36 -03:00
Chris Renshaw b9bdc36b60 anykernel: add supported.vendorpatchlevels 2023-08-22 01:53:06 -03:00
Chris Renshaw b9df8b892f Backend: add vendor security patch checking 2023-08-22 01:51:39 -03:00
Chris Renshaw 17f728cae0 README: add no_magisk_check=1 2023-08-15 21:09:00 -03:00
Chris Renshaw 9d09ba3ecd AK3: add no_magisk_check=1 to skip Magisk detection and repatching 2023-08-15 20:08:55 -03:00
Chris Renshaw 86417ffcb3 Example: correct order 2023-08-11 01:52:00 -03:00
Chris Renshaw d9afe472df Example: tidy again 2023-08-10 20:04:53 -03:00
Chris Renshaw e40e655e40 Example: add commented multi-parition attributes functions
DO NOT MERGE if you have already updated your zip properly for your device
2023-08-10 13:22:03 -03:00
Chris Renshaw 6567864730 anykernel: remove attributes call (now handled in core) 2023-08-10 13:14:20 -03:00
Chris Renshaw 32073dff09 AK3: add per-partition attributes, multi-partition fixes
- attributes function now runs via core in setup_ak and reset_ak, but only if it exists, allowing more easy removal of it for setups with no ramdisk changes (so all should now remove the awkward `&& attributes` call from anykernel3.sh, see next commit)
- for multi-partition zips with multiple ramdisks requiring different files, multiple attributes functions may now be specified, either redefine attributes() in anykernel.sh for the next partition, or add a different function for each partition, e.g. boot_attributes() and vendor_boot_attributes()
- fix block=auto multi-partition setup creating an "auto-files" directory instead of final found block, e.g. "init_boot-files"
2023-08-10 13:11:32 -03:00
Chris Renshaw a5ce1c04d1 Backend: hide shcon workaround stderr on (likely) working recoveries
- some recoveries don't allow reading/changing shell context and will show an error:

sh: write error: Invalid argument

- these recoveries seem to allow loop mounts unlike most LOS Recovery builds lately, so hide the error output
2023-08-10 12:36:28 -03:00
Chris Renshaw 9ab60a49de Backend: work around for chcon on broken recoveries 2023-08-01 11:04:26 -03:00
Chris Renshaw 4030d36655 AK3+Backend: helper module improvements and full KernelSU support
- only parse kernel strings when both do.modules=1 and do.systemless=1 are set
- support post-fs-data.sh in systemless kernel helper module (gets renamed and sourced from the built-in one)
- show systemless kernel helper module as an update pending reboot in module apps if flashed while booted
- add system_ext support to systemless kernel helper module
- show a warning during flash if systemless kernel helper module is configured but there's no decrypted /data access to be able to install it
- detect the installed KernelSU app as the indicator the user intends to use KernelSU, and install systemless kernel helper module to modules_update.img accordingly
- do KernelSU directory setup and create modules_update.img if this appears to be the initial KernelSU install
- set all systemless kernel helper module files to system_file context, since unlabeled files are not gracefully handled by KernelSU (they trigger a reboot and the module gets rejected)

NOTE: currently it appears KernelSU won't parse the modules_update.img on the first boot where it sets itself up from initial KernelSU install, but it will then do it after the following reboot. Hopefully this can be fixed by a future KernelSU release so that the systemless kernel helper module is active right away as this might be necessary to boot fully on some devices
2023-07-16 16:33:47 -03:00
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
Chris Renshaw 4cd6b57df7 LICENSE: update XDA link 2023-06-04 18:37:42 -03:00
Chris Renshaw 1a9dea2caf README: update for snapshotupdater_static 2023-06-04 17:22:20 -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 5c916de64c Backend: abort apex loop mounts early if failing
- /dev/block/loop* nodes don't behave correctly in Lineage Recovery anymore (beginning ~ LOS19), not sure why, but mount and losetup can't use them
- bail out early so we don't slow the install to a crawl with the rapid mount failures
2023-05-25 18:36:51 -03:00
osm0sis f4cbd4b68d Backend: fixup now that mount_apex direct .img mount works 2023-05-24 15:26:02 -03:00
osm0sis 7ea57acaa6 tools: update to latest busybox (1.36.1)
Compiled from my own updated fork:
https://github.com/osm0sis/android-busybox-ndk
2023-05-24 15:24:56 -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
osm0sis ba82924dab AK3+Backend: pass AKHOME via export 2023-05-03 15:45:34 -03:00
osm0sis dee204c197 Backend: simpify getprop replacement propval return 2023-05-03 15:32:06 -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 f2dbe60f63 AK3: partial revert of d6e040c2 until issue with kernel_dtb is addressed
- magiskboot split needs to be updated to not decompress so that if there's a patched kernel_dtb it can be properly appended to the restored unpatched compressed new kernel

see: https://github.com/topjohnwu/Magisk/pull/6597#issuecomment-1518709863
2023-04-23 00:05:05 -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 e46a516d50 LICENSE: update for snapshotupdater_static 2023-04-21 14:15:54 -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
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 c2e33f95d1 AK3+Backend: support AMLogic devices where A-only sets slot=normal 2023-02-08 12:53:48 -04:00
Chris Renshaw 950b8e5711 Merge branch 'koush:master' into master
¯\_(ツ)_/¯
2023-01-21 23:20:06 -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
Chris Renshaw 03046c34e3 README: update for any partition auto-detect 2022-12-01 21:32:05 -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 dd66ae6335 README: updates to bring in line with xda thread 2022-11-13 08:59:05 -04:00
Chris Renshaw f14d70d54b Example: clean up some more for readability 2022-11-11 23:42:31 -04:00
osm0sis eb203ccd54 LICENSE: shorten by combining for included Apache 2.0 utilities 2022-11-11 22:23:15 -04:00
osm0sis 8db5d2413a Example: add commented init_boot + vendor_kernel_boot setup for reference
DO NOT MERGE if you have already updated your zip properly for your device
2022-11-11 22:21:34 -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
osm0sis c713211a84 Backend: pass ZIPFILE name into AK3 core env 2022-11-11 08:10:07 -04:00
Chris Renshaw cf1a93136c AK3: separate init_boot and boot partition detections
- both boot for kernel and init_boot for first stage ramdisk access to overlay.d will be needed
- remove ramdisk and recovery_ramdisk from detection since devices which use them also use kernel partition and would need to be multi-partition setups either way
2022-10-19 23:19:09 -03:00
Chris Renshaw 6e1b5c9cd9 tools: update magisk utils to v25.1(25100) stable 2022-06-20 00:24:11 -03:00
Chris Renshaw 1e417cbc78 README: update for httools_static + fec 2022-06-08 23:22:46 -03:00
Chris Renshaw c8961dedb8 AK3: silence placeholder cleanup rmdir noise 2022-06-07 20:19:45 -03:00
Chris Renshaw 9758c926da README: update for lptools 2022-05-05 22:01:52 -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
osm0sis af9b68cd4c tools: update magisk utils to v24.1(24100) stable 2022-01-28 22:50:58 -04:00
Chris Renshaw 42e9c3a9a9 README: document patch_vbmeta_flag feature 2021-12-17 14:16:53 -04:00
osm0sis 19cf85643b Example: change commented vendor_boot setup to patch_vbmeta_flag
DO NOT MERGE if you have already updated your ramdisk properly for your device
2021-12-15 20:31:48 -04:00
osm0sis d7d7aebf7a anykernel: change keep_vbmeta_flag -> patch_vbmeta_flag 2021-12-15 20:29:04 -04:00
osm0sis fb5fbb1516 AK3: update KEEPVBMETAFLAG -> PATCHVBMETAFLAG for Canary 23016+ 2021-12-15 20:20:27 -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 12baa2739a AK3: better backwards compatibility for keep_vbmeta_flag (unset=auto) 2021-12-11 00:12:14 -04:00
osm0sis 78f08d471e Example: add commented keep_vbmeta_flag to vendor_boot setup 2021-12-10 23:32:14 -04:00
osm0sis f7490f764c anykernel: add keep_vbmeta_flag 2021-12-10 23:31:05 -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
osm0sis 66f42c1951 AK3+Backend: grep cleanups
- fix duplicate kernel version (vertmp) entries from some kernels
- don't use head when grep -m1 will suffice
- fix some (bad) OEM prop files including entries twice, use last entry like live system
2021-12-10 17:34:54 -04:00
Chris Renshaw 08a76000ad AK3: unbreak anykernel scripts using flash_dtbo directly 2021-12-06 13:45:16 -04:00
Chris Renshaw 4950e80ca2 README: update remaining flash_dtbo references 2021-12-06 13:29:02 -04:00
Chris Renshaw 89c8c54f4a README: update for flash_generic and vendor_dlkm 2021-12-06 10:58:38 -04:00
osm0sis 297d6c3b99 AK3: add flash_generic to reduce code duplication 2021-12-06 10:04:54 -04:00
osm0sis a312a2bdc9 tools: update magisk utils to e097c097(23015+) CI
- adds partial hdr v4 support (cannot currently unpack vendor_boot v4 multi-ramdisk or bootconfig)
- use upstream CI build since it includes an AVBv2 signature padding fix, resolving all known regressions

Closes #61
2021-12-06 08:07:42 -04:00
Chris Renshaw ae28b9dc92 Increment AK_BASE_VERSION for latest changes 2021-12-05 03:15:25 -04:00
osm0sis d432fd5721 Backend: support Android 12 .capex (compressed apex) files 2021-11-18 15:58:06 -04:00
Chris Renshaw 20ad14111f Create FUNDING.yml 2021-10-31 16:33:57 -03:00
osm0sis d5572891d9 Backend: fix apex mounts on fastboot boot'd TWRP
- work around different /apex environment causing loop mounts to fail on TWRP only when it's initiated by `fastboot boot twrp.img`
2021-10-18 11:43:01 -03:00
osm0sis 049180b3cd Backend: update apex support
- support unmounting TWRP's mounted apex files to avoid conflicts
- hide less apex u/mount stderr to aid future debugging
2021-10-16 14:54:06 -03:00
Chris Renshaw 74be8b014f README: update thread links for XenForo xda 2021-10-06 16:00:47 -03:00
osm0sis 52aec65a1b Backend: use stderr for consistency with other debug output 2021-10-04 22:34:26 -03:00
osm0sis 42611f420b Backend: adjust AK_BASE_VERSION placement in output 2021-10-03 14:53:40 -03:00
osm0sis 446d3caeef tools: update to latest busybox (1.34.1)
Compiled from my own updated fork:
https://github.com/osm0sis/android-busybox-ndk
2021-10-03 14:48:15 -03:00
osm0sis b32e4ceb6e Backend: fix module installation if apex mounts fail 2021-10-02 00:36:20 -03:00
osm0sis fc43a2a1a9 Backend: print AK_BASE_VERSION to stdout in script output 2021-10-01 19:20:43 -03:00
osm0sis f88f90e3d2 Backend: underps and regression fixes
- fallback by-name system mount may still result in /system at /system_root so add back check
- add missing /persist mountpoint
2021-09-15 00:02:22 -03:00
osm0sis 84caeb46e5 Backend: more partition mount fixes
- attempt to mount other partitions whether determined as /system or /system_root
- /system_root by that point if mounted will actually be /system_root so no need for further checks
- add missing /system_ext entries to custom getprop and cleanup functions
2021-09-14 17:10:11 -03:00
osm0sis 4dfc45a6b2 Backend: check before mounts, fix persist mount on Virtual A/B 2021-09-11 00:05:52 -03:00
osm0sis d705b13c45 Backend: mount cleanups and add system_ext support 2021-09-10 00:21:03 -03:00