Skip to content
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

自编译qgki内核KernelSU无法提供root权限 #887

Closed
williammmmmmmmm opened this issue Aug 18, 2023 · 2 comments
Closed

自编译qgki内核KernelSU无法提供root权限 #887

williammmmmmmmm opened this issue Aug 18, 2023 · 2 comments

Comments

@williammmmmmmmm
Copy link

Describe the bug
I build an qgki kernel for my device. Unfortunately it can not provide root privilege in shell, although ksumanager show that ksu service is working and i had open superuser button in shell profile.
KernelSU管理器显示ksud工作中,超级用户授权给了之后不生效,模块安装了重启后也同样是不生效。

To Reproduce
Steps to reproduce the behaviour:

  1. kernel sourse I used (使用的内核源码):https://github.com/FlowerSea0208/kernel_xiaomi_mars
  2. build command(使用的编译方式):
DATE=$(date +"%Y%m%d")
VERSION=$(git rev-parse --short HEAD)
KERNEL_NAME=FlowerKernel-"$DATE"

export KERNEL_PATH=$PWD
export ANYKERNEL_PATH=~/Anykernel3
export CLANG_PATH=~/prelude-clang
export PATH=${CLANG_PATH}/bin:${PATH}
export CLANG_TRIPLE=aarch64-linux-gnu-
export ARCH=arm64
export SUBARCH=arm64

echo "===================Setup Environment==================="
git clone --depth=1 https://gitlab.com/jjpprrrr/prelude-clang $CLANG_PATH
git clone https://github.com/FlowerSea0208/AnyKernel3 $ANYKERNEL_PATH

echo "=========================Clean========================="
rm -rf $KERNEL_PATH/out/ *.zip
make mrproper && git reset --hard HEAD

echo "=========================setup KernelSU========================="
curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -

echo "=========================Build========================="
make -j$(nproc) O=out CC="ccache clang" CXX="ccache clang++" CROSS_COMPILE=$CLANG_PATH/bin/aarch64-linux-gnu- CROSS_COMPILE_ARM32=$CLANG_PATH/bin/arm-linux-gnueabi- LD=ld.lld vendor/mars_defconfig
make -j$(nproc) O=out CC="ccache clang" CXX="ccache clang++" CROSS_COMPILE=$CLANG_PATH/bin/aarch64-linux-gnu- CROSS_COMPILE_ARM32=$CLANG_PATH/bin/arm-linux-gnueabi- LD=ld.lld 2>&1 | tee out/kernel.log

if [ ! -e $KERNEL_PATH/out/arch/arm64/boot/Image ]; then
    echo "=======================FAILED!!!======================="
    exit -1>/dev/null 2>&1
fi

echo "=========================Patch========================="
rm -r $ANYKERNEL_PATH/modules $ANYKERNEL_PATH/patch $ANYKERNEL_PATH/ramdisk
cp $KERNEL_PATH/anykernel.sh $ANYKERNEL_PATH/
cp $KERNEL_PATH/out/arch/arm64/boot/Image $ANYKERNEL_PATH/
cd $ANYKERNEL_PATH
zip -r $KERNEL_NAME *
mv $KERNEL_NAME.zip $KERNEL_PATH/out/
cd $KERNEL_PATH
#rm -rf $CLANG_PATH
rm -rf $ANYKERNEL_PATH
echo $KERNEL_NAME.zip
  1. kernel build without error,flash it to device. (编译正常执行,无报错。拿到内核后用anykernel刷入或者自己pack内核fastboot flash)
  2. As in the screenshot,it doesn't work. (正常开机后app内如截图显示工作中,但无法提供管理员权限)

Expected behaviour
It shoult provide root privilege normally.

Screenshots
If applicable, add screenshots to help explain your problem.
Screenshot_20230720-143003_KernelSU
Screenshot_20230720-143215_KernelSU
image

Smartphone (please complete the following information):

  • Device: xiaomi 11 ultra
  • OS: crDroid
  • Version 9.7

Additional context
Is there something wrong with my steps? Thanks to everyone's support.
大佬们帮帮我,我在crDroid9.5的内核也遇到过同样的问题,我使用kprobe外加手动修改内核然后去掉部分声明语句解决,但我总感觉这样不太对。希望大佬们给小弟指条明路,谢谢你们😍🤩
附上ksu日志:
KernelSU_bugreport_2023-07-20_14_31.tar.gz

@tiann
Copy link
Owner

tiann commented Aug 19, 2023

[    1.323332] KernelSU: ksud: execve_kp: -2
[    1.333608] KernelSU: ksud: vfs_read_kp: 0
[    1.358094] KernelSU: ksud: input_handle_event_kp: -2

如果用 kprobe 不正常,推荐使用手动集成。

@tiann tiann closed this as not planned Won't fix, can't repro, duplicate, stale Aug 19, 2023
@mortaza01
Copy link

brother please give me kernelsu supported kernel for mi 11 ultra

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

No branches or pull requests

3 participants