Hello! I'v been trying to patch boot image with various magisk versions using recovery and normal boot patching (using app). The phone goes bootloop after flashing the boot image.
Here's two files (attached in comment) One of them is patched, one is just stock boot.img
I've noticed a size difference between them. Also, I've tried to unpack stock boot with abootimg and ran into
boot.img: ramdisk size is null
boot.img: not a valid Android Boot Image.
UPD: codename of the phone is Begonia, the firmware is V10.4.2.0.PGGIDXM (Indonesian ROM)
Unpacks and repacks perfectly with AIK (matching id field checksum), but it's harder to verify the same with magiskboot.
Android Image Kitchen - UnpackImg Script
by osm0sis @ xda-developers
Supplied image: boot.img
Setting up work folders...
Image type: AOSP
Signature with "AVBv2" type detected.
Splitting image to "split_img/"...
BOARD_KERNEL_CMDLINE bootopt=64S3,32N2,64N2 buildvariant=user
BOARD_KERNEL_BASE 40078000
BOARD_NAME
BOARD_PAGE_SIZE 2048
BOARD_HASH_TYPE sha1
BOARD_KERNEL_OFFSET 00008000
BOARD_RAMDISK_OFFSET 07c08000
BOARD_SECOND_OFFSET 00e88000
BOARD_TAGS_OFFSET 0bc08000
BOARD_OS_VERSION 9.0.0
BOARD_OS_PATCH_LEVEL 2019-09
BOARD_HEADER_VERSION 1
BOARD_HEADER_SIZE 1648
Warning: No ramdisk found to be unpacked!
Done!
There is no ramdisk in your boot.img, so either Magisk can create one and hopefully it'll work or you'll need to patch recovery like on Samsung.
Has Magisk ever worked on this device? It could be they're enforcing their OEM AVBv2 boot.img signature or something.
Tested a repack with latest canary magiskboot using untouched compressed kernel from an AIK unpack, and magiskboot also repacks it perfectly (note the matching checksums):
Parsing boot image: [boot.img]
HEADER_VER [1]
KERNEL_SZ [10589361]
RAMDISK_SZ [0]
SECOND_SZ [0]
RECOV_DTBO_SZ [0]
OS_VERSION [9.0.0]
OS_PATCH_LEVEL [2019-09]
PAGESIZE [2048]
NAME []
CMDLINE [bootopt=64S3,32N2,64N2 buildvariant=user]
CHECKSUM [5486d7519f555e1673c3387caceb09d9cc6b7e55000000000000000000000000]
KERNEL_DTB [163124]
KERNEL_FMT [gzip]
RAMDISK_FMT [raw]
Repack to boot image: [new-boot.img]
HEADER_VER [1]
KERNEL_SZ [10589361]
RAMDISK_SZ [0]
SECOND_SZ [0]
RECOV_DTBO_SZ [0]
OS_VERSION [9.0.0]
OS_PATCH_LEVEL [2019-09]
PAGESIZE [2048]
NAME []
CMDLINE [bootopt=64S3,32N2,64N2 buildvariant=user]
CHECKSUM [5486d7519f555e1673c3387caceb09d9cc6b7e55000000000000000000000000]
Doesn't look like there's anything else mysterious going on in the image, so @topjohnwu will have to take it from here with regards to double-checking the Magisk patching. :+1:
Scratch that, I found the issue with your magisk_patched.img as well; it's likely due to the header being broken (note the 1660 where header version 1 should be 1648):
Android Image Kitchen - UnpackImg Script
by osm0sis @ xda-developers
Supplied image: magisk_patched.img
Setting up work folders...
Image type: AOSP
Splitting image to "split_img/"...
BOARD_KERNEL_CMDLINE bootopt=64S3,32N2,64N2 buildvariant=user
BOARD_KERNEL_BASE 40078000
BOARD_NAME
BOARD_PAGE_SIZE 2048
BOARD_HASH_TYPE sha1
BOARD_KERNEL_OFFSET 00008000
BOARD_RAMDISK_OFFSET 07c08000
BOARD_SECOND_OFFSET 00e88000
BOARD_TAGS_OFFSET 0bc08000
BOARD_OS_VERSION 9.0.0
BOARD_OS_PATCH_LEVEL 2019-09
BOARD_HEADER_VERSION 1
BOARD_HEADER_SIZE 1660
Unpacking ramdisk to "ramdisk/"...
Compression used: cpio
668 blocks
Done!
That all said, I couldn't replicate the issue using the latest Magisk Canary and Manager to patch your boot.img, so you must be using Magisk Stable? Try again with latest Canary, because whatever it was I think it's already been fixed.
Edit: Likely this commit: https://github.com/topjohnwu/Magisk/commit/9867a3bd600c5d1f599bee6e2d8e5b87bcd01a86
I patched the recovery image and got bootloop (patched via app, ticked the recovery mode). Is there any manual way to patch boot or something?
Use the latest Magisk Canary and patch your boot.img, it will work, as I said in my last comment.
Hi, tried patching boot.img with latest Magisk Canary and still getting a bootloop .
What details would help you to find the issue ?
Please find the patched boot img attached
RN8ProBootPatched.zip
I have used canary to patch the boot image and got a bootloop again. The issue is still not resolved.
So then we're back to my first 2 comments:
There is no ramdisk in your boot.img, so either Magisk can create one and hopefully it'll work or you'll need to patch recovery like on Samsung.
Has Magisk ever worked on this device? It could be they're enforcing their OEM AVBv2 boot.img signature or something.
The zeroing idea is interesting too. How are you flashing the resulting image? Is there any way to format boot partition before you write the patched image to it?
I tried patching and flashing recovery , got bootloop as well . Flashing all with your official instruction.
"Flash the patched boot/recovery image to your device and reboot. For most devices, here is the fastboot command:
fastboot flash boot /path/to/magisk_patched.img or
fastboot flash recovery /path/to/magisk_patched.img "
And of course I'm changing the path to the correct one
I've used fastboot erase on a partition and flashed it again -- same bootloop
I can do the full flash of patched boot for you and dump it, as I should be able to mount those from recovery. This will allow you to inspect final (and actual) image my system is using!
Here you go.
There're following images in the archive -- twrp recovery i use and it works and successfully flashed on my phone, original boot, patched boot and sdc34 which is the phone's boot partition (after the flashing is done).
https://drive.google.com/open?id=1Uv5uZCacK3vVnWxRjcDOST6KwIZgHo0O
I splitted sdc34.img - 1st fragment size = size of magisk_patched.img, 2nd - remainder. 1st fragment is byte to byte identical to magisk_patched.img, remainder entirely filled by 0
That means it's not the same issue as #2005 at all then.
Since this one is closed, I guess we should likely carry on over in #2008.
Hello! I'v been trying to patch boot image with various magisk versions using recovery and normal boot patching (using app). The phone goes bootloop after flashing the boot image.
Here's two files (attached in comment) One of them is patched, one is just stock boot.img
I've noticed a size difference between them. Also, I've tried to unpack stock boot with abootimg and ran into
boot.img: ramdisk size is null boot.img: not a valid Android Boot Image.UPD: codename of the phone is Begonia, the firmware is V10.4.2.0.PGGIDXM (Indonesian ROM)
I'm experiencing similar issue. I want to ask. Is it normal that my magisk_patched.img is just about 15 MB, while the original boot.img is about 32 MB. I flashed with fastboot and encountered bootloop. Before now though, Magisk was working fine on the same device running Android 9. I just flashed 10 and tried using the same method to get root but it's not working. I specifically wanna know if the size difference between the patched and original boot images makes sense at all. Thanks