yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] capntrips:
The issue is there isn't enough space on your super partition to hold the temporary partition used to replace vendor_dlkm. The simplest solution would be to flash the kernel in fastboot.

One thing to note, that kernel is using an old version of AK3 (20220430), and the ability to fallback on unmount/resize was added in version 20220802.
[Android Apps and Games] jlokos:
The developer of the kernel updated the AK3; I flashed it with KF and it worked. Thanks so much for your assistance.
[Android Apps and Games] osm0sis:
My shame system works! 🤣

Backend: add base version code for easier debugging · osm0sis/AnyKernel3@6ae1c8e

- simplify checking if a dev is being lazy to expedite the appropriate public shaming

github.com
[Android Apps and Games] kpirnie:
@capntrips want to thank you for this app. I've been fighting for months trying to get a kernel to flah properly, and only stumbled across this the other day lol

anyways while everything flashed fine, even using Magisk 26 ;), i took an ak3 log, and there are some permissions issues... no complaint or anything as I said, everything worked fine... just thought you should know.

Spoiler content hidden.
[Android Apps and Games] capntrips:
Those messages come from here and are expected when those files aren't provided.
[Android Apps and Games] osm0sis:
Yep, feel free to customize your anykernel.sh to comment/remove those lines since your kernel doesn't need them.
[Android Apps and Games] kpirnie:
Appreciate ya bud
[Android Apps and Games] halfbytecode:
Would it be possible to add support for flashing bootloader and radio, if that would work?

Considering TWRP support is absent for Pixel 6 and 7 series. Thanks!
[Android Apps and Games] capntrips:
That is a bit outside the scope of this app and is something I'm not prepared to support. If you just want something quick and dirty, you could probably add the various bootloader and radio partitions (abl, bl1, gsa, modem, etc) here.

As for extracting the images, I have used imjtool and payload_dumper, though if the former's source is available, I couldn't immediately find it.
[Android Apps and Games] halfbytecode:
Thanks for the reply. I was actually taking a look at the code pointed out by you, while going through the commit for adding support for the vendor_kernel_boot partition.

I tend to forget that there is a solution for flashing zips by installing a Magisk module, Magic Flash Tool. We could try packaging the bootloader and radio files, after extracting them into necessary files first. This module would hopefully be able flash them from a running system, but it also has a disclaimer that flashing ROMs through it would result into bootloops.

Lack of a tool for recovering from hard bricks kind of concerns me here.
[Android Apps and Games] capntrips:
I'm not sure what your end goal is, but if you're just looking to install updates without losing root without getting a PC involved, you might be able to cobble together a tool to modify an OTA. I've never actually used it, but this might be an interesting starting point, if only for getting your own keys into recovery (and that may not even be necessary on unlocked devices, I'm not sure).

I recently used this to install some older stock OTAs while working on an AK3 issue recently, and it worked well enough.
[Android Apps and Games] k9r4n16:
I don't know if I have missed something but I can't seem to figure out how to flash anything on my Pixel 6 without it being soft bricked. How do I know which type of ZIP I'm trying to flash and how do I actually do it?
[Android Apps and Games] capntrips:
What version of the app are you using? Are you on a custom rom? Do you have a log you can share? The app gives you the option to save one after a flash.

The app should check that you're attempting to flash an AK3 zip, if it doesn't just throw an error and quit, you should theoretically be flashing the right thing, but you're looking for kernel zips that use AnyKernel3 (AK3).
[Android Apps and Games] k9r4n16:
The latest from GitHub... That's the thing, the device soft bricks every time. I tried the same kernel with Franco Kernel Manager and that failed too so it might just be my phone for some reason.
[Android Apps and Games] capntrips:
Are you on a custom rom? What kernel are you trying to flash? Do you have a log you can share?

Without more information, my best guess is you're either on a custom rom or you don't have verity and/or verification disabled and you're trying to flash a kernel that's using an old version of AK3.

Edit: I see from your recent posts that you're trying to flash blu_spark on Evolution X. I did a quick search for "kernel" in that rom thread, and the reports about custom kernels are a mixed bag, with seemingly more bootloops than successes at a glance. The rom dev says custom kernels are unsupported and the kernel dev says custom roms are unsupported, fwiw.
[Android Apps and Games] k9r4n16:
Oh, that would probably be why then lol. I'm going to reflash the latest stock ROM and see if that works tomorrow. Unfortunately I have a busy day today :( I will report back if it works, thank you.
[Android Apps and Games] halfbytecode:
Thanks for the detailed reply. My end goal is to flash bootloader and radio directly from the phone, on custom ROMs, which don't include them in the ROM updates.

I will try to determine how to properly get the bootloader and radio into a flashable zip, for flashing all necessary partitions. Hopefully flashing that works from a running system, and does not result in bricking the device.

Thanks for sharing the OTA update tool links. As you would know, a lot of custom ROMs also come with their own OTA updater, based on Lineage OS' OTA updater. Some ROMs also have an option added to feed a local update to the OTA updater from storage.

I could try modifying that to take any ROM and flash it over any ROM, when needed. Thanks for the idea! I still wish we still had a working app like Flash Fire though, or even TWRP.
[Android Apps and Games] osm0sis:
Might be an issue with Boot SHA1 calculations. Noticed that they remained the same after an OTA and reboot, even though new slot is ROM kernel and old slot is custom kernel.
[Android Apps and Games] capntrips:
When rooted, it uses the one Magisk stores in the ramdisk. Maybe the old hash ended up in the ramdisk of the new kernel?

Edit: It seems like I remember seeing that happen once a while back in the PixelFlasher thread.
[Android Apps and Games] osm0sis:
Kernel hash should still change though, since the build date at least is different, and the addon.d reports a "stock" image when running on the updated slot during the OTA so isn't preserving the old hash. 🤔
[Android Apps and Games] capntrips:
Here's what it should be doing under the hood, if you want to see if you get the same results as the app:

Spoiler content hidden.
[Android Apps and Games] osm0sis:
Works as expected via shell! 🤯

Checking boot_a
1b8666102845063f49565335f3ff27465c075877
Checking boot_b
2dfa53bdd60648df531ac611b0b023460240709a

Edit: Weirdly the direct sha1 matches too, but it shouldn't fall back to that since both are Magisk patched... 🤨

magiskboot sha1 /dev/block/by-name/boot_a
1b8666102845063f49565335f3ff27465c075877
magiskboot sha1 /dev/block/by-name/boot_b
2dfa53bdd60648df531ac611b0b023460240709a

Edit 2: Hmm yes the script is falling back to the Stock check for some reason!

Edit 3: Ahh, it was because I was running from / so no write access to dump. Worked as actually expected in /data/local/tmp:

Checking boot_a
Patched
804278a2139a9d63910edd574c9b97f7d432e38a
Checking boot_b
Patched
804278a2139a9d63910edd574c9b97f7d432e38a

Guess it goes to show they are different however, so not sure why they'd contain the same sha1 in their /.backup/.magisk config files; I'm certain Lineage compiles the kernel fresh each week. Guess I'd have to take that up with Magisk. 🤔🤷‍♂️
[Android Apps and Games] capntrips:
My device is also affected 🤦‍♂️ Sorry for the delay in that sinking in. I'll try to look into it in the next few days, but I'm on the road, so it might be like Tuesday.
[Android Apps and Games] osm0sis:
I don't think the stored Magisk "stock" hash really matters though? The hash of the actual partition seems like the more logical thing to be shown in the app. 😅

Edit: I can confirm those are the actual stored hashes in config file in the ramdisks, so 🤷‍♂️

Edit 2: I wonder if it's something to do with Magisk's addon.d-v2 script or having TWRP flashed... I'll keep digging.

Edit 3: Doing a fresh untouched boot.img flash then TWRP then Magisk while booted and rooted instantly got a different, unique/normal hash. Definitely something to fix somewhere! I'll see on Tuesday if it's an OTA that botches it.
[Android Apps and Games] osm0sis:
Back to same SHA1 after the OTA! Now to figure out where in the addon.d-v2 process it happens...
[Android Apps and Games] osm0sis:
It's a combination of addon.d-v2 scripts: my 98-twrp_ab.sh copies the old slot's rooted TWRP ramdisk over whole, so then when 99-magisk.sh attempts to root the new slot it sees and keeps the old SHA1.

Not sure how best to work around it (probably trying to unroot the copied ramdisk?), but I'll see what I can do.

Edit

: Fixed! 😁

https://xdaforums.com/t/tools-zips-...ices-platforms.2239421/page-164#post-88546091
[Android Apps and Games] shingers5:
thanks for this gonna use it on pixel 6pro
[Android Apps and Games] adblacklidge:
I thought maybe someone here can provide some direction on how to flash this kernel: MaxHunter

I have so far downloaded the factory build from May for the Pixel 7, did the disable verity and verification in the bootloader, wiped my phone, then rebooted. I still had root, so I went ahead and installed this Kernel Flasher app. I unzipped the kernel I linked to and flashed boot.img, dtbo.img, vendor_dlkm.img, then the vendor_kernel_boot.img files using this app, one at a time. I then rebooted the phone and it's telling me there is a problem with my phone as soon as it fully boots (which it does still boot thank god). When I open Kernel Flasher app, it says I am running the kernel I want to be on, but it doesn't look like anything has changed and then I have that error now.

The only thing that I was told to do in the topic where the kernel link was posted was disable verity/verification, then wipe. I don't know how to properly flash the kernel apparently.

I did make a backup using the Flasher app before trying any of this. What can I do to reverse whatever I did and install the kernel properly using the app?
[Android Apps and Games] capntrips:
Assuming you're referring to one of the AK3 zips linked from here, you flash the zip directly, rather than unzipping it and flashing the images individually. In Kernel Flasher, click the Flash AK3 Zip button.

The simplest solution would be to flash the factory image. Don't forget to disable verity and verification again, or you'll be forced to wipe again on your next attempt.
[Android Apps and Games] Deeglifsay:
if I'm flashing with kernel flasher do I flash to both slots or just the active slot?
[Android Apps and Games] capntrips:
Kernel Flasher does not currently provide an option to flash to the inactive slot. There is a pending feature request to add that option, but it hasn't yet been pushed.
[Android Apps and Games] Divine Bicycle:
Can I use the backup slot feature to copy the contents of Slot A to Slot B? When Android 13 came out I had a few issues with flashing both slots so I'm still not entirely sure if both slots have been flashed properly to Android 13 to avoid the downgrade prevention kicking in should I be kicked onto slot B. As you can see in the attached screenshots they both seem to have the same hash and be on the same kernel version, but I wanted to see if I could ensure they were both up to date.
[Android Apps and Games] capntrips:
It is not currently possible to flash the inactive slot with Kernel Flasher. That may change in the future, but it certainly won't be in the next few days.

I strongly suggest using the method recommended by Google, rather than trying to work around the issue with tools not intended for the purpose.

This is an known issue that I haven't had a chance to fix. You would be better off hashing the complete images of the partitions, especially the bootloader related ones, given the old bootloader is what will render the device unbootable.
[Android Apps and Games] Divine Bicycle:
I see, later on I'll try doing that bootloader flash. I think that it was flashed when I upgraded, but it's been a while, and because of the issues I had I was never entirely sure if it had been. Will I be able to complete the steps linked with a custom kernel installed, I should be since the bootloader is the only thing that gets flashed?
[Android Apps and Games] capntrips:
With option 2 from their docs, yes.
[Android Apps and Games] halfbytecode:
I faced an issue while flashing a kernel on Pixel 7 Pro, on a ROM that I had updated using its built in OTA updater.

It failed to flash vendor_dlkm, and the partial flash made my device unbootable. I had to flash the vendor_dlkm manually using fastboot to make the device work.

Log is attached for reference.

It is worth adding on the earlier build of the ROM, that I had sideloaded using adb, flashing kernels worked fine.
[Android Apps and Games] osm0sis:
Well, for starters, AK_BASE_VERSION=20220827 means the kernel dev (@Freak07) is almost a year out of date with AK3 zip updates again, so that could be it... 😬
[Android Apps and Games] halfbytecode:
Yeah that seems out of date, but the issue I faced still occurs if I try to flash the vendor_dlkm image manually using the app. In fact even the image which came installed with ROM update.

msg: java.lang.Error: Unmapping vendor_dlkm_a failed
stacktrace: java.lang.Error: Unmapping vendor_dlkm_a failed
at com.github.capntrips.kernelflasher.common.PartitionUtil.flashLogicalPartition(PartitionUtil.kt:161)
at com.github.capntrips.kernelflasher.ui.screens.slot.SlotViewModel$flashImage$1.invokeSuspend(SlotViewModel.kt:570)
at com.github.capntrips.kernelflasher.ui.screens.slot.SlotViewModel$flashImage$1.invoke(Unknown Source:8)
at com.github.capntrips.kernelflasher.ui.screens.slot.SlotViewModel$flashImage$1.invoke(Unknown Source:2)
at com.github.capntrips.kernelflasher.ui.screens.slot.SlotViewModel$launch$1.invokeSuspend(SlotViewModel.kt:148)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@21e9b1c, Dispatchers.IO]
[Android Apps and Games] capntrips:
What ROM and version? I've got a Nothing Phone 2 due to arrive in the next few days, and once I've made the transfer, I can run a few tests on my Pixel 7.
[Android Apps and Games] halfbytecode:
Sure, I'm on crDroid 07/12 build, installed using the ROM's OTA updater.

I remember reading the AK3 zips sonetimes fail to flash if a ROM was flashed using fastboot, that resized the partitions. The issue faced by me is not that right, as this is not a fastboot flashable ROM?
[Android Apps and Games] capntrips:
The issue was there was no way to resize the partition, so if you flashed a smaller one, there was no way to grow it if you needed a larger one later. That issue was fixed in 20220430 and tweaked in 20220802, 20220827, and 20230504.

The issue you're having is that AK3 and Kernel Flasher are unable to resize the partition using either method. In fact, I wonder if your issue is the one fixed in 20230504. I don't think I added that to Kernel Flasher's restore function.

I'll quote myself from the conversation I had that led to that change:

I'm guessing you're in a similar situation to Lineage where it left a bunch of cow partitions on super, and you don't have enough room to create the replacement partition.

A simple way to test it would be to run lptools clear-cow then flash the kernel (or just vendor_dlkm) in Kernel Flasher. You can get one of my builds of lptools from here or extract it from the tools folder in the AK3 zip.
[Android Apps and Games] halfbytecode:
So yeah it is the same issue really, since the OTA updater across ROMs is mostly from LineageOS, including on crDroid.

I ran lptools clear-cow and it worked. I was able to flash the vendor_dlkm image successfully using the app after that. So the issue actually seems to be fixed by 20230504.

I did not use the restore function earlier as well, just tried to flash the image manually since the app does not yet support restoring backups across slots.

I guess you can make the app run lptools clear-cow if it fails to resize the partition.

I think kernel developers also need to update the AK3 base to the latest, for preventing issues while flashing zips. Still if we can have a workaround in the app for the kernel zips that use an old AK3 base, that would be great too.
[Android Apps and Games] osm0sis:
The app fix would only handle the direct partition flashing/restoring, which would be good.

Out of date kernel developers shouldn't be catered to, instead you as a user should go tell them to update their zips since their inaction is causing you problems. 😉
[Android Apps and Games] capntrips:
I'll add it to my todo list. Hopefully the new phone will get me motivated. I had hoped the next build would be feature complete, so I could make it a beta, but the planned changes have outpaced me. I guess I need to just break it down into chunks and make a few more alpha builds. This and the hash bug (and maybe one other? I need to read back through the thread) should probably get immediate attention.
[Android Apps and Games] halfbytecode:
The issue with flashing outdated zips as faced by me is the partial flash renders the device unbootable. vendor_dlkm failed to flash earlier, but the kernel zip flashed other partitions.

That was the reason I said the outdated zips should be handled in the app to avoid that. That would be better than a solution such as undoing the partial flash and flashing back the earlier partition images again.

Thanks for that and all the help. It would be great if you could add an option in the app to clear the cow partitions, seemingly on a per-partition basis. That would be an additional solution which would work, if a suggestion is displayed to the user to do that, on failure to resize the partitions.

Automatically handling this for flashing/restoring images and even AK3 zips, for the reasons I mentioned above, would be a good primary solution though I feel.
[Android Apps and Games] Freak07:
The state of the AK3 zip is actually even older and a bit customized iirc, because it just directly flashes the partitions and that was what fit my needs when I released it.

At the time of the initial release ak3 didn't work properly on pixel 7 pro.

I'm sorry, but I don't have time to track yet another repo and update/compare/test the zip for each release.

It's mentioned everywhere in my thread that custom ROMs are completely unsupported and users are on their own!

Custom ROMs doing their own things for the updater is part of that reason.

The second reason is that the versioning check for the security patch date does not prevent flashes on firmware that's not meant for certain kernels.

(ROMs are sometimes updated to new security patch without updating firmware/kernel.)

Yes I know in an ideal world I'd keep my zips updated with the latest ak3, but it has caused me more headaches to update it than to just use what works/worked. (That's just the way it is and was for me, it has nothing to do with the quality of @osm0sis work which I appreciate hugely, same goes for @capntrips )

I'm not good at this script stuff and it costs me a lot of time (that I currently don't have)

GKI, especially on P7 pro where verity/verification patching does not work on the fly without a wipe, complicated things further.

At least for me it's not 100% trivial to just update the AK3 zip and be sure there's no issue, as that happened multiple times in the past.

I simply lack the time to do any additional testing besides testing my actual kernel.

In the end this is also a community. Just like one can send reasonable pull requests on GitHub for kernels, one can update the AK3 zip and upload it for review in my thread.

Once I find any time I can gladly update the zip, if someone is faster than me be my guest.
[Android Apps and Games] osm0sis:
I unfortunately don't have much time either, especially not to go around policing every kernel developer who's behind and updating their zips for them, since that would require, well, infinite time. 😛

The most I can do is try to fix things centrally on my repo for the kernel developers to easily update from, (I believe all of the Pixel 7 support issues you mention have been addressed), and when a user has a problem because their kernel of choice isn't using an up to date zip, inform them to go ask their kernel developer to get up to date. 🙂👍

Edit: I would love to figure out a way to add a firmware check if you have any ideas, I know it's a big problem on custom ROMs for OnePlus devices where certain ROMs use OOS11 FW, others OOS12 FW and yet others OOS13 FW. Some check on something in vendor would be the move, but not sure exactly what would be best. 🤓

And please feel free to drop me a line any time AK3 isn't doing the trick as-is, or you have any ideas in the future. I can't fix problems I'm not aware of. 😅
[Android Apps and Games] halfbytecode:
I think this issue of partitions not being resizable often appears even if people use fastboot to flash, which can include stock ROM. I remember reading about that in one of the kernel threads here.

The fix just involves adding one operational line of code or just a command really, from this commit.

echo "Clearing any merged cow partitions..." >&2;
$bin/lptools_static clear-cow;

Adding this to the relevant place in ak3-core.sh would fix the issue.

I could do that and even update the AK3 base, but I feel I will just manually clear the cow partitions as needed at this point.

Having said that, things were simpler during Nexus 5 days when I used to develop my own kernel.
[Android Apps and Games] osm0sis:
Just realized the slot Restore functionality is limited by the Boot SHA1 matching the backups, but that really doesn't make sense since anything you'd need to restore from afterwards would have also changed the Boot SHA1. 🙃
[Android Apps and Games] halfbytecode:
Using Kernel Flasher, I restored unpatched init_boot and vbmeta, on a Magisk patched and verity/verification disabled Pixel 7 Pro, without rebooting afterwards, in hopes of getting an OTA on Android 14 Beta 5.2, but I have not been successful and it has been a few days now.

The plan was to install the OTA, and without rebooting, install Magisk to other slot and patch vbmeta on the other slot to disable verity and verification, and then reboot.

Just doing the init_boot and Magisk thing has worked on custom ROMs having incremental OTAs, but those showed up on a rooted device too.
[Android Apps and Games] RockerAlex:
App won't open on Samsung S20 FE 5G Snapdragon on A13