Rohail33 / Realking_kernel_sm8250

RealKing-kernel for Kona (SM8250): Currently supports ~~ Xiaomi: Poco-F3/Mi11x/K40, Mi10t/pro, Poco F4/K40s. {For Both MiUi and Aosp Roms} and Oneplus 8 series and 9R : opkona ( for both oos and aosp )
https://www.pling.com/p/1858015/
Other
78 stars 50 forks source link

Integrate with kprobe #17

Closed zfdx123 closed 4 months ago

zfdx123 commented 7 months ago

I noticed that the kernel code seems to use a patch to handle kernel implementation of ksu, but after testing it seems more convenient to use kprobe, would you consider switching to kprobe to reduce maintenance costs?

我注意到内核代码似乎使用了修补来处理内核实现ksu,但是经过测试使用kprobe似乎更方便,是否考虑跟换为kprobe降低维护成本?

Rohail33 commented 7 months ago

I noticed that the kernel code seems to use a patch to handle kernel implementation of ksu, but after testing it seems more convenient to use kprobe, would you consider switching to kprobe to reduce maintenance costs?

我注意到内核代码似乎使用了修补来处理内核实现ksu,但是经过测试使用kprobe似乎更方便,是否考虑跟换为kprobe降低维护成本?

Well since Ksu isn't officially supported for non gki kernels... We are forced to use the manual patching to implement ksu... + Kprobes are broken on non mainline kernels it seems.

zfdx123 commented 7 months ago

I noticed that the kernel code seems to use a patch to handle kernel implementation of ksu, but after testing it seems more convenient to use kprobe, would you consider switching to kprobe to reduce maintenance costs? 我注意到内核代码似乎使用了修补来处理内核实现ksu,但是经过测试使用kprobe似乎更方便,是否考虑跟换为kprobe降低维护成本?

Well since Ksu isn't officially supported for non gki kernels... We are forced to use the manual patching to implement ksu... + Kprobes are broken on non mainline kernels it seems.

It is not allowed to use two schemes at the same time in the official document, so I think we can get rid of the previously patched code and only use Kprobes, so that we can better choose whether to use ksu or not, just control it at compile time.

Rohail33 commented 6 months ago

I noticed that the kernel code seems to use a patch to handle kernel implementation of ksu, but after testing it seems more convenient to use kprobe, would you consider switching to kprobe to reduce maintenance costs? 我注意到内核代码似乎使用了修补来处理内核实现ksu,但是经过测试使用kprobe似乎更方便,是否考虑跟换为kprobe降低维护成本?

Well since Ksu isn't officially supported for non gki kernels... We are forced to use the manual patching to implement ksu... + Kprobes are broken on non mainline kernels it seems.

It is not allowed to use two schemes at the same time in the official document, so I think we can get rid of the previously patched code and only use Kprobes, so that we can better choose whether to use ksu or not, just control it at compile time.

okeh thanks for pointing this out, gonna switch to kprobes, if they work fine on kona :)

zfdx123 commented 6 months ago

I noticed that the kernel code seems to use a patch to handle kernel implementation of ksu, but after testing it seems more convenient to use kprobe, would you consider switching to kprobe to reduce maintenance costs? 我注意到内核代码似乎使用了修补来处理内核实现ksu,但是经过测试使用kprobe似乎更方便,是否考虑跟换为kprobe降低维护成本?

Well since Ksu isn't officially supported for non gki kernels... We are forced to use the manual patching to implement ksu... + Kprobes are broken on non mainline kernels it seems.

It is not allowed to use two schemes at the same time in the official document, so I think we can get rid of the previously patched code and only use Kprobes, so that we can better choose whether to use ksu or not, just control it at compile time.

okeh thanks for pointing this out, gonna switch to kprobes, if they work fine on kona :)

Thank you, dear developer. This is a piece of test code integrated with kprobes.

git clone https://github.com/tiann/KernelSU kernel-source/KernelSU
cd kernel-source
echo "CONFIG_KPROBES=y" >> ${{ inputs.config_path }}${{ inputs.config_name }}
echo "CONFIG_HAVE_KPROBES=y" >> ${{ inputs.config_path }}${{ inputs.config_name }}
echo "CONFIG_KPROBE_EVENTS=y" >> ${{ inputs.config_path }}${{ inputs.config_name }}
git config --global user.email "robot@example.com"
git config --global user.name "robot"
git add ${{ inputs.config_path }}${{ inputs.config_name }}
git commit -m "KUS"
./KernelSU/kernel/setup.sh main

https://github.com/zfdx123/build-k40-ksu/blob/f06a7706ad9a9aa6bda06f91c3e25df28c53713d/.github/workflows/build.yml#L81

zfdx123 commented 6 months ago

I think this can reduce some upstream conflicts and solve some unnecessary problems.