Question [HELP][Kernel building][Kernel][OP9] - OnePlus 9

I builded custom kernel for my Oneplus lemonade (A/B 2 slot)
I got "Image" & "Image.gz" file, how can i put it in boot.img

MURSHIG said:
I builded custom kernel for my Oneplus moo lemonade (A/B 2 slot)
I got "Image" & "Image.gz" file, how can i put it in boot.img
Click to expand...
Click to collapse
I have no AIK , just mkbootimg python vers from official Google repo, im executing ./unpackimg.py --boot_img boot.img --out out
in out directory there is -
file kernel - uncompressed kernel
file ramdisk - uncompressed ramdisk

Related

[Q] How to pack zImage binary kernel in CWM zip for TF101

Hi, i'm trying to flash my custom kernel with CWM recovery. I've seen some zip to update TF's kernel that use a kernelblob but i didn't realized how to create this binary file.
I've compiled kernel from source code from AsusTek files (Eee Pad Kernel Code for Android 3.2 OS (V8.6.5.7)) and i have zImage and modules (.ko).
Someone know how can i pack this things to flash my kernel with CWM?
Coniglioz said:
Hi, i'm trying to flash my custom kernel with CWM recovery. I've seen some zip to update TF's kernel that use a kernelblob but i didn't realized how to create this binary file.
I've compiled kernel from source code from AsusTek files (Eee Pad Kernel Code for Android 3.2 OS (V8.6.5.7)) and i have zImage and modules (.ko).
Someone know how can i pack this things to flash my kernel with CWM?
Click to expand...
Click to collapse
Just to create a CWM compatible kernel zip , it's a combination of the things below:
1) Fetch one of the many kernel zip files like from Roach or Clemsyn that are in the development forum to use as a template. Unzip it somewhere in a clean folder and you'll just be replacing modules & zImage (or whatever it is called, almost certainly *blob* something) then next step.
2) Most of what you need to create the insecure boot image is in here:
http://forum.xda-developers.com/showthread.php?t=1193737
3) Most of what you need to create the new blob is in here:
http://forum.xda-developers.com/showthread.php?t=1068548&highlight=blobpack
4) Now move your new modules from your freshly built custom kernel (do a $find {kerneldir} -iname '*.ko' ). Copy them over /system/lib/modules/* in the unzipped template zip from 1) and get rid of any that you didn't create yourself as well.
4.5) copy the blobpack'd file you created from zImage to whatever it was called in the unzipped zip template (say, boot.img to blob or kernelblob or whatever it was called so the script in the zip works).
5) zip the entire contents making sure you're starting at the right base directory into a new customized zip file. That's it you're done. If it doesn't work you might just have created a bum kernel.
Theory of this in a nutshell. There is no way to do the anykernel.zip method because the tf101 will only accept a blob on those encoded partitions so you have to get the blob and boot tools and use them and since all of the kernel zipfiles use it, you've got easy templates.
I'm not mentioning CWM in here because you would just have to create a bigger blob which is I think covered in any thread you search out that has 'blobpack' in it, like Rayman's. The catch-22 of doing recovery + kernel in one blob is that you have no way to boot the thing should things go haywire, unless you're just talking about CWM and it's kernel.
Good luck -
Hashi
Thanks, I blobbed my custom zImage.
I used this zip update as template: http://forum.xda-developers.com/showthread.php?t=1226717
I'll post this kernel with raw hid input support after testing all the functionalities!

[Q] Repack MT6577 not working ?!

Hi, I'm working on a custom kernel and I'm new on xda
So my problem here is from the repack scripts : bgcngm/mtk-tools on github
I'm doing :
unpack-MT65xx.pl boot.img
I do no changes on ramdisk or kernel.img and immediatly invoke
repack-MT65xx.pl -boot boot.img-kernel.img boot.img-ramdisk ../boot.img
But this gives me 2 differents sizes files (2 ko the difference between the original boot.img and the newboot.img) and the repacked boot.img won't boot.
So I'm doing something wrong but what ?

boot.img unpacking & repacking

Hi guys,
I'm fiddling with some boot images, trying to extract TWRP from arter97's Razer Phone 2 (Aura) r14 kernel, and use it with a Magisk-patched stock kernel.
I've found several tools to unpack and repack the images, although jcadduono's bootimg seems to be the simplest. When I repack the unpacked Magisk-patched boot.img, the file size is 20M instead of the 64M. The original boot.img is mostly padded with zeros, but with a 56-byte footer starting with AVBf.
When I use avbtool add_hash_footer --partition_name boot --partition_size 67108864 --image new.img, it pads to 64M and adds nearly the same footer. There are 2 0x30's in the original that are changed to 0x20 in the new version. The image boots just fine, though.
However, when I replace the Magisk-patched stock ramdisk with the one from arter97's kernel, rebuild, and resize, the phone boots only into TWRP. I can't boot into system. (It's worth noting that arter97's ramdisk is compressed with lz4 instead of gz, so I had to expand it and re-compress with gz. I'm assuming his kernel adds lz4 support.)
Any ideas what I'm doing wrong?
Thanks,
-edison

CrashDump mode after flashing blue_spark kernel r112

Hey folks,
I have rooted (magisk) OnePlus 8 phone with Android 11, w/o TWRP recovery. I'm trying to replace kernel with one of blue_spark, here's what I'm doing
1. Download zip file from https://github.com/engstk/op8/releases/tag/r112
2. Extract and unpack Image.gz
3. Unpack Magisk patched boot.img to /tmp (magiskboot unpack boot.img)
4. Replace kernel with unpacked Image (cp Image /tmp/kernel)
5. Repack boot.img (magiskboot repack boot.img boot-new.img)
6. Boot with boot-new.img (fastboot boot boot-new.img)
And here is when I'm getting into "QUALCOMM CrashDump Mode"
The same result if I build kernel from sources. Repacking boot.img with original kernel works, so problem is unlikely in magiskboot.
I'm trying to figure out the problem, but without kernel logs it's troublesome. Any ideas?
Thanks.
Hm... It looks like, I also have to update DTB. After that device boots successfully. Seems a bit strange to me. What's the difference in supported devices between blu_spark and stock kernel?
Ok, turned out AVB was enabled in the original device tree:
fsmgr_flags = "wait,slotselect,avb";
Switching it off fixes boot process.

Question about boot.img and ramdisk.cpio

Hello,
I'm just getting into Android, and I've been messing around with boot.img with Magisk.
The boot.img that I'm specifically looking at is Pixel 6a.
I used `magiskboot unpack boot.img`, but I only got a kernel file.
Now, I'm wondering where the ramdisk.cpio. From what I read, ramdisk determines what to mount and whatnot.
Even without a ramdisk, I can fastboot flash boot boot.img it to my device and it will still work.
If there is no ramdisk in boot.img, then how does the device know what to mount or what the file hierarchy is when I flash it?
If the stock boot.img doesn't have a ramdisk, does not mean I have to generate my own?
Thanks!
init is on system, no ramdisk required.
https://source.android.com/docs/core/architecture/partitions/system-as-root#sar-partitioning
alecxs said:
init is on system, no ramdisk required.
https://source.android.com/docs/core/architecture/partitions/system-as-root#sar-partitioning
Click to expand...
Click to collapse
does that mean if I do include ramdisk.cpio, it overrides the one on system?
Yes, if you modify the kernel so ramdisk is extracted and processed (that's what Magisk does)
alecxs said:
Yes, if you modify the kernel so ramdisk is extracted and processed (that's what Magisk does)
Click to expand...
Click to collapse
Thank you so much for the link. I read up on it, and as you said, boot.img just carries a kernel file and ramdisk is in system.img.
It looks like you can also unpack, modify, and repack system.img and flash it onto pixel devices, so do you know why Magisk decided to create ramdisk.cpio and repack it into boot.img when it could have modified system.img? Is it because boot.img has a kernel file?
Thanks
Magisk also mods the DTB from "skip_initramfs" to "want_initramfs".
drunk_santa said:
It looks like you can also unpack, modify, and repack system.img and flash it onto pixel devices, so do you know why Magisk decided to create ramdisk.cpio and repack it into boot.img when it could have modified system.img?
Click to expand...
Click to collapse
Because Magisk is systemless-root method
https://topjohnwu.github.io/Magisk/boot.html

Categories

Resources