Skip to content

Patched Xiaomi Miatoll kernel doesn't boot Android #5

Open
@Zekiu

Description

@Zekiu

I use LineageOS 22.1, didn't test with MIUI.
Here are the steps I took:

  • unpacked LineageOS's boot.img with unpack_bootimg --boot_img boot.img --format=mkbootimg
  • patched the kernel with DualBootKernelPatcher out/kernel SM7125_EFI_SB.fd PatchedKernel Config/DualBoot.Sm7125.cfg ShellCode/ShellCode.Miatoll.bin
  • replaced the kernel in out/ with PatchedKernel
  • repackaged the boot.img with mkbootimg --header_version 2 --os_version 15.0.0 --os_patch_level 2025-03 --kernel out/kernel --ramdisk out/ramdisk --dtb out/dtb --pagesize 0x00001000 --base 0x00000000 --kernel_offset 0x00008000 --ramdisk_offset 0x01000000 --second_offset 0x00000000 --tags_offset 0x00000100 --dtb_offset 0x0000000001f00000 --board '' --cmdline 'androidboot.console=ttyMSM0 androidboot.hardware=qcom androidboot.memcg=1 androidboot.usbcontroller=a600000.dwc3 cgroup.memory=nokmem,nosocket console=ttyMSM0,115200n8 earlycon=msm_geni_serial,0xa88000 loop.max_part=7 lpm_levels.sleep_disabled=1 msm_rtb.enabled=1 msm_rtb.filter=0x237 service_locator.enable=1 swiotlb=1 video=vfb:640x400,bpp=32,memsize=3072000' -o boot_uefi.img
  • flashed the image with fastboot flash boot boot_uefi.img

The unpacking and repacking process works correctly, because just unpacking and repacking the boot.img works and I can successfully boot into Android. With the patched kernel the phone bootloops when booting into Android, pushing Volume Up works correctly and it boots into UEFI, just the Android part doesn't work. I haven't tried booting full Windows yet with this DualBootKernel. Doing this with magiskboot unpack and magiskboot repack produces the same results.
Am I doing something wrong? Does this not work with LineageOS?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions