Skip to content

Conversation

@ukriu
Copy link
Contributor

@ukriu ukriu commented Jun 24, 2025

This will add support to patch vendor_boot with LKM for devices which have their init ramdisk inside of vendor_boot and not boot/init_boot.

@ukriu
Copy link
Contributor Author

ukriu commented Jun 24, 2025

For this to work, /manager/app/src/main/jniLibs/arm64-v8a/libmagiskboot.so needs to be updated to the latest version.
The current magiskboot binary is not capable to unpack vendor_boot properly.

@ukriu
Copy link
Contributor Author

ukriu commented Jun 25, 2025

For ak3 GKI flashing, this fix is also needed for these devices. Kernel-SU/AnyKernel3#6

@rifsxd
Copy link
Contributor

rifsxd commented Jun 25, 2025

Hold this PR a bit i will work on the pixel vendor_boot too

@ukriu ukriu marked this pull request as draft June 25, 2025 10:14
@rifsxd
Copy link
Contributor

rifsxd commented Jun 26, 2025

KernelSU-Next/KernelSU-Next#541 (comment)

fully finished and tested

@rifsxd
Copy link
Contributor

rifsxd commented Jun 26, 2025

should fix #2325

@rifsxd
Copy link
Contributor

rifsxd commented Jun 26, 2025

@ukriu now pick this commit too KernelSU-Next/KernelSU-Next@b74e953

@ukriu ukriu force-pushed the main branch 2 times, most recently from 799a37a to bcfad42 Compare June 26, 2025 04:58
@ukriu ukriu marked this pull request as ready for review June 26, 2025 05:04
@rifsxd
Copy link
Contributor

rifsxd commented Jul 15, 2025

@5ec1cff could you review it

Edit: it's tested on both vendor_boot (Xiaomi & Pixel)

@ukriu
Copy link
Contributor Author

ukriu commented Jul 15, 2025

The devices affected by this: (as far as I'm aware of)
Redmi Note 12S, Redmi 13/POCO M6, Redmi Note 13 5G/13R Pro/POCO X6 Neo 5G, Redmi Note 11S 4G/POCO M4 Pro 4G, Redmi 13C/POCO C65
And also the Pixel 6 family

@rifsxd
Copy link
Contributor

rifsxd commented Jul 16, 2025

The devices affected by this: (as far as I'm aware of) Redmi Note 12S, Redmi 13/POCO M6, Redmi Note 13 5G/13R Pro/POCO X6 Neo 5G, Redmi Note 11S 4G/POCO M4 Pro 4G, Redmi 13C/POCO C65 And also the Pixel 6 family

Pixel 7 also iirc

@aviraxp
Copy link
Collaborator

aviraxp commented Jul 17, 2025

I want to know whether the devices that require patching vendor_boot have init_boot or boot partitions. If they do, do those partitions contain a ramdisk? And if so, does the ramdisk include /init?

@rifsxd
Copy link
Contributor

rifsxd commented Jul 17, 2025

I want to know whether the devices that require patching vendor_boot have init_boot or boot partitions. If they do, do those partitions contain a ramdisk? And if so, does the ramdisk include /init?

Some devices have ramdisk is at vendor_boot/vendor_ramdisk/init_boot.cpio and some other devices have ramdisk in vendor_ramdisk/ramdisk.cpio

@rifsxd
Copy link
Contributor

rifsxd commented Jul 17, 2025

The logic I did is fail proof and is working fine for ksunext tested for a whole month without issues it basically checks for correct ramdisk for all boot partitions

@rifsxd
Copy link
Contributor

rifsxd commented Jul 17, 2025

I want to know whether the devices that require patching vendor_boot have init_boot or boot partitions. If they do, do those partitions contain a ramdisk? And if so, does the ramdisk include /init?

Oh and no the device that require the vendor_boot patching doesn't have init_boot partition but has boot partition but doesn't contain a ramdisk so patching won't work, but vendor_boot patching works as should

@rifsxd
Copy link
Contributor

rifsxd commented Jul 17, 2025

Also do note that the vendor_boot/vendor_ramdisk/ramdisk.cpio requires permission 750 instead of the usual 755 or else the init & kernel driver files won't be copied over since the original files are symlinks

Copy link
Contributor

@5ec1cff 5ec1cff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also update magiskboot

@ukriu ukriu force-pushed the main branch 5 times, most recently from 07eb80d to 51d00bd Compare July 17, 2025 11:57
@ukriu ukriu marked this pull request as draft July 17, 2025 12:15
@ukriu ukriu force-pushed the main branch 3 times, most recently from dc89bd3 to 4a27d82 Compare July 17, 2025 16:02
@ukriu ukriu marked this pull request as ready for review July 17, 2025 16:14
@5ec1cff
Copy link
Contributor

5ec1cff commented Jul 18, 2025

Please rebase and run clippy fix

@ukriu ukriu requested a review from 5ec1cff July 19, 2025 14:12
@aviraxp aviraxp requested review from yujincheng08 and removed request for 5ec1cff July 19, 2025 15:32
@aviraxp aviraxp enabled auto-merge (squash) July 20, 2025 05:46
@aviraxp aviraxp merged commit 67fa81b into tiann:main Jul 20, 2025
18 of 24 checks passed
@fatalcoder524
Copy link

Guys, Can anyone look into it?

Kernel-SU/AnyKernel3#6

Has been tested and Flashed in Wild Kernels for multiple releasess.

fadlyas07 added a commit to bengal-upstream/KernelSU that referenced this pull request Sep 13, 2025
* 'main' of https://github.com/tiann/KernelSU: (42 commits)
  Unmount isolated process which forks from zygote unconditionally (tiann#2747)
  fix 'for' loop problem (tiann#2745)
  update resetprop (tiann#2733)
  Strip JNI debug logs on release build (tiann#2732)
  manager: Support search module (tiann#2730)
  manager: Add uninstall 2nd confirm (tiann#2729)
  manager: Fix some issues (tiann#2725)
  manager: fix button issues in module cards (tiann#2719)
  manager: switch ui to miuix design style (tiann#2710)
  Revert "Handle unmount for isolated process correctly" (tiann#2718)
  Handle unmount for isolated process correctly (tiann#2696)
  Reset seccomp filter count when escaping to root (tiann#2708)
  kernel: selinux: rules: Micro-optimize get_policydb() and fix illegal RCU lock usage in handle_sepolicy() (tiann#2695)
  Update resetprop from Magisk v30.2 (tiann#2700)
  ksud: support vendor_boot patching for some odd devices (tiann#2650)
  ksud: make clippy happy (tiann#2683)
  feat(ui): improve predictive back animations (tiann#2675)
  kernel: added new prctl CMD_GET_MANAGER_UID to get the uid of the crowned manager (tiann#2673)
  kernel: selinux: rules: Fix illegal RCU lock usage in apply_kernelsu_rules() (tiann#2646)
  manger: fix lkm detection (tiann#2654)
  ...

 Conflicts:
	kernel/core_hook.c
	kernel/selinux/rules.c
	kernel/throne_tracker.c

Change-Id: Iebf7dd870a7d9e35f4cecbf97fa13eeb174b7b5d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants