topjohnwu / Magisk

The Magic Mask for Android
GNU General Public License v3.0
47.08k stars 11.9k forks source link

(darcy) Device Does Not Boot After Patching Boot.img #8297

Closed znbaboy closed 1 week ago

znbaboy commented 1 month ago

Device: Nvidia Shield TV 2017 (darcy) Android version: lineage-21.0-20240805-nightly-foster (Android 14) Magisk version name: Magisk Canary Magisk version code: 27006

Trying to boot device after patching/flashing boot.img via fastboot/bootloader causes device to return to bootloader interface. Fails to boot.

Magisk Debug Logs + Patched Boot.img.zip

znbaboy commented 1 month ago

Old issue that was never reopened for some reason: https://github.com/topjohnwu/Magisk/issues/8285

hamedsbt commented 1 month ago

Same issue on Nvidia Shield TV 2019 Pro OS: Lineage-21.0-20240805-nightly-foster (Android 14) Magisk version name: Magisk Canary Magisk version code: 27006

StupidRepo commented 1 month ago

Was having this issue on bramble (Google Pixel 4a 5G) where the boot animation would be really laggy and then after some time of showing the boot animation it would restart. Then all of a sudden it started booting but things like my default home screen app and GBoard configuration was reset? All my apps were still installed.

Also, Magisk appeared to show as if it wasn't installed even though it was.

Screenshot_20240809-234944_Magisk.png

StupidRepo commented 1 month ago

I don't know why that comment was marked off topic as it was very on topic...

Edit: Marked as abuse? Wtf...

vvb2060 commented 1 month ago

You are using a custom ROM, please ask the ROM builder to contact us. If anyone knows how to fix this, the issue will be reopened.

znbaboy commented 1 month ago

You are using a custom ROM, please ask the ROM builder to contact us. If anyone knows how to fix this, the issue will be reopened.

LineageOS Gitlab issue created: https://gitlab.com/LineageOS/issues/android/-/issues/7545

znbaboy commented 4 weeks ago

Looks like LOS team doesn't want anything to do with it either: https://gitlab.com/LineageOS/issues/android/-/issues/7545

Oh well...

hamedsbt commented 4 weeks ago

Looks like LOS team doesn't want anything to do with it either: https://gitlab.com/LineageOS/issues/android/-/issues/7545

Oh well...

I would say, their refusing is reasonable. Unless, we provide an evidence that prove the bug is related to LOS.

znbaboy commented 4 weeks ago

Looks like LOS team doesn't want anything to do with it either: https://gitlab.com/LineageOS/issues/android/-/issues/7545 Oh well...

I would say, their refusing is reasonable. Unless, we provide an evidence that prove the bug is related to LOS.

I agree. Unfortunately, we are at the mercy of the developers.

znbaboy commented 4 weeks ago

You are using a custom ROM, please ask the ROM builder to contact us. If anyone knows how to fix this, the issue will be reopened.

LineageOS is does not support root so we cannot get any support on their end. Is there any reason you believe it is an issue with the ROM? Something I can provide the devs there at-least? Right now we are at a dead end...

image

Also, I see another open issue with someone else using LineageOS and you tried providing support for their device? I don't understand why our issue is being dismissed when we are also on LOS..?

https://github.com/topjohnwu/Magisk/issues/7390

vvb2060 commented 4 weeks ago

Without help from the ROM builder, troubleshooting the issue could be challenging. Can you get kmsg? #7390 uploaded kmsg so we know what happened.

hamedsbt commented 3 weeks ago

@vvb2060 Hi, thank you for your support.

This is Unsuccessful boot /sys/fs/pstore/console-ramoops file after install Magisk Canary v27006 console-ramoops-0-magisk.zip

And this is successful boot /sys/fs/pstore/console-ramoops file without Magisk: console-ramoops-0.zip

I'm ready to be a volunteer to install any modified Magisk file(s) to overcome this issue.

Device: Nvidia Shield TV 2019 Pro OS: Lineage-21.0-20240805-nightly-foster (Android 14)

Thank you!

vvb2060 commented 3 weeks ago

Don't use canary, install debug version and upload kmsg.

hamedsbt commented 3 weeks ago

@vvb2060 I've installed Magisk app-debug.apk (canary-27006), but after that, I couldn't boot Android successfully. So, I went to recovery and pulled the /sys/fs/pstore/console-ramoops file. console-ramoops-0.txt

Also the result of dmesg > /sdcard/dmesg.log is: dmesg.log

Finally, the result of cat /dev/kmsg > /sdcard/kmsg.log is: kmsg.log

Note: result cat /proc/kmsg > /sdcard/kmsg.log is empty!

Are these okey?

vvb2060 commented 3 weeks ago
[    4.739385] magiskinit: Device config:
[    4.743489] magiskinit: skip_initramfs=[1]
[    4.747931] magiskinit: force_normal_boot=[0]
[    4.752632] magiskinit: rootwait=[1]
[    4.756555] magiskinit: slot=[]
[    4.760045] magiskinit: dt_dir=[/proc/device-tree/firmware/android]
[    4.766654] magiskinit: fstab_suffix=[]
[    4.770839] magiskinit: hardware=[darcy]
[    4.775107] magiskinit: hardware.platform=[]
[    4.779720] magiskinit: emulator=[0]
[    4.783641] magiskinit: LegacySARInit

Previously, bootloader used the skip_initramfs kernel command line parameter to decide which mode to boot into. For Android 10 devices, the bootloader MUST NOT pass skip_initramfs to the kernel command-line. Instead, bootloader should pass androidboot.force_normal_boot=1 to skip recovery and boot normal Android.

https://source.android.com/docs/core/ota/dynamic_partitions/implement#system-as-root-changes

hamedsbt commented 3 weeks ago

@vvb2060 I unpacked the boot.img file (magiskboot -h boot.img) I want to apply the two kernel parameters you mentioned to the cmdline of the header file. Could you confirm if the format is correct.
cmdline=androidboot.boot_devices=sdhci-tegra.0,tegra-sata.0,sdhci-tegra.3 skip_initramfs=0 androidboot.force_normal_boot=1

Thank you.

vvb2060 commented 3 weeks ago

https://github.com/LineageOS/android_kernel_samsung_sdm429/commit/a3e0f795018bfae4c3e805c1418a39a6611d6346

hamedsbt commented 3 weeks ago

@vvb2060 Thank you for your reply. I can't understand C or C++ code clearly. Could you confirm if the format is correct please? cmdline=androidboot.boot_devices=sdhci-tegra.0,tegra-sata.0,sdhci-tegra.3 skip_initramf=0 want_initramf=1 androidboot.force_normal_boot=1 Or Can I patch the kernel file directly via magiskboot --hexpatch kernel 736B69705F696E697472616D667300 77616E745F696E697472616D667300 ? image

Thank you.

aviraxp commented 3 weeks ago

Workaround: https://github.com/LineageOS/android_kernel_lge_sdm845/commit/026011c9e651996d73a201e47770c425b0c55700

hamedsbt commented 3 weeks ago

@aviraxp Thank you for your help but I couldn't understand what you mean.

vvb2060 commented 2 weeks ago

try https://install.appcenter.ms/users/vvb2060/apps/magisk/distribution_groups/public

curiouslux408 commented 2 weeks ago

Device: Xiaomi Xiaomi 11T is agate Android version: V14.0.5.0.TKWTWXM Magisk version name: Magisk Canary Magisk version code: 27007

Trying to boot device after patching/flashing boot.img via fastboot/bootloader causes device to return to bootloader interface. Fails to boot.

hamedsbt commented 2 weeks ago

try https://install.appcenter.ms/users/vvb2060/apps/magisk/distribution_groups/public

Hi, It's working. Thank you! I also attached the console-ramoops-0 file: console-ramoops-0

hamedsbt commented 3 days ago

I installed this version of com.topjohnwu.magisk package from canary channel, but the device doesn't boot again! Screenshot_20240908-221419_Trebuchet