-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hisense U6H - magiskinit fails b/c bootloader adds skip_initramfs on 2SI device #8063
Comments
How about moving Magisk/native/src/init/init.cpp Lines 96 to 97 in c6f0762
before Magisk/native/src/init/init.cpp Lines 90 to 91 in c6f0762
But I dont know if this will break other devices. |
Hi @yujincheng08 just checking whether this is truly "not planned" or if it was closed for being stale. I'll have a device on-hand again soon - am I able to re-open this or open a new issue when I am available to work on it? |
it was closed for being stale |
Perfect. Thank you :) |
Device: Hisense U6H
Android version: 11
Magisk version name: 81658d4
Magisk version code: 27002
In October 2023 I was successful in patching the boot image, but faced a black screen and no OS when trying to boot from it. The debug logs showed that Magisk was seeing
skip_initramfs
in the patched image of our 2SI device:Magisk normally patches
skip_initramfs
out of the boot image. At some point in the past devices (ex: Galaxy A21s) started havingskip_initramfs
added to the dtb bootargs. Magisk v24.0 fixed this by patching the dtb. Similar to how that issue presented, magiskinit treats the Hisense U6H as aLegacy SAR
device becauseskip_initramfs
is added by U-Boot (MBOOT).Special thanks to @throwaway96 for finding this. Hisense adds
skip_initramfs
in the bootloader (0x274F108C):it does this with a check in the do_readKL() function (0x274F1654):
Luckily with this understanding we can easily patch Magisk to achieve root:
Patching Magisk :)
Prereqs: - [Magisk v27.0 Source](https://github.com/topjohnwu/Magisk/releases/tag/v27.0)* - Ability to compile Magisknative/src/init/init.cpp
from:to:
A similar issue to this was created when Galaxy A21s devices began including
skip_initramfs
in the dtb (xda, #4307). In that issue osm0sis stated:I'm not sure what Magisk can do to solve this without hardcoding for these devices. Patching the bootloader seems risky. Depending on how other devices are structured, can the order for checking
skip_initramfs
andforce_normal_boot
be swapped? Any other ideas?Thank you :)
Quick reference:
Hisense U6H XDA Thread
Patching Magisk for Galaxy A21s XDA Thread
#4307
tl;dr Assumptions that Magisk makes should be correct, but the patches Hisense have applied to U-Boot make that not so
The text was updated successfully, but these errors were encountered: