Docs update (#1143)

This commit is contained in:
weishu
2023-11-14 13:56:21 +08:00
committed by GitHub
parent 9223558197
commit 0617c4440b
14 changed files with 68 additions and 67 deletions

View File

@@ -12,11 +12,11 @@ Certainly, yes.
## Does KernelSU support modules?
Yes, But it is in early version, it may be buggy. Please wait for it to be stable :)
Yes, check [Module Page](module.md) please.
## Does KernelSU support Xposed?
Yes, [Dreamland](https://github.com/canyie/Dreamland) and [TaiChi](https://taichi.cool) work now. For LSPosed, you can make it work by [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext)
Yes, you can use LSPosed on [ZygiskNext](https://github.com/Dr-TSNG/ZygiskNext)
## Does KernelSU support Zygisk?
@@ -49,19 +49,20 @@ It is possible, KernelSU is backported to kernel 4.14 now, for older kernel, you
## How to integrate KernelSU for old kernel?
Please refer [guide](how-to-integrate-for-non-gki)
Please refer [Guide](how-to-integrate-for-non-gki)
## Why my Android version is 13, and the kernel shows "android12-5.10"?
The Kernel version has nothing to do with Android version, if you need to flash kernel, always use the kernel version, Android version is not so important.
## Is there any --mount-master/global mount namespace in KernelSU?
There isn't now(maybe in the future), But there are many ways to switch to global mount namespace manully, such as:
1. `nsenter -t 1 -m sh` to get a shell in global mount namespace.
2. Add `nsenter --mount=/proc/1/ns/mnt` to the command you want to execute, then the command is executed in global mount namespace. KernelSU is also [using this way](https://github.com/tiann/KernelSU/blob/77056a710073d7a5f7ee38f9e77c9fd0b3256576/manager/app/src/main/java/me/weishu/kernelsu/ui/util/KsuCli.kt#L115)
## I am GKI1.0, can i use this?
GKI1 is completely different from GKI2, you must compile kernel by yourself.
## How can i make `/system` RW?
We do not recommend you to modify the system partition directly. You should use the [module](module.md) to modify it systemlessly. If you insist on doing this, check [magisk_overlayfs](https://github.com/HuskyDG/magic_overlayfs).
## Can KernelSU modify hosts? How can i use AdAday
Of course. But KernelSU doesn't have builtin hosts support, you can install [systemless-hosts](https://github.com/symbuzzer/systemless-hosts-KernelSU-module) to do it.

View File

@@ -44,22 +44,20 @@ tools/bazel build --config=fast //common:kernel_aarch64_dist
If you can build the kernel successfully, then build KernelSU is so easy, Select any one run in Kernel source root dir:
- Latest tag(stable)
::: code-group
```sh
```sh[Latest tag(stable)]
curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -
```
- main branch(dev)
```sh
```sh[ main branch(dev)]
curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s main
```
- Select tag(Such as v0.5.2)
```sh
```sh[Select tag(Such as v0.5.2)]
curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.5.2
```
:::
And then rebuild the kernel and you will get a kernel image with KernelSU!

View File

@@ -46,27 +46,27 @@ If kprobe does not work in your kernel (may be an upstream or kernel bug below 4
First, add KernelSU to your kernel source tree:
- Latest tag(stable)
::: code-group
```sh
```sh[Latest tag(stable)]
curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -
```
- main branch(dev)
```sh
```sh[ main branch(dev)]
curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s main
```
- Select tag(Such as v0.5.2)
```sh
```sh[Select tag(Such as v0.5.2)]
curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/main/kernel/setup.sh" | bash -s v0.5.2
```
:::
Then, add KernelSU calls to the kernel source, here is a patch to refer:
```diff
::: code-group
```diff[exec.c]
diff --git a/fs/exec.c b/fs/exec.c
index ac59664eaecf..bdd585e1d2cc 100644
--- a/fs/exec.c
@@ -92,7 +92,7 @@ index ac59664eaecf..bdd585e1d2cc 100644
return __do_execve_file(fd, filename, argv, envp, flags, NULL);
}
```
```diff
```diff[open.c]
diff --git a/fs/open.c b/fs/open.c
index 05036d819197..965b84d486b8 100644
--- a/fs/open.c
@@ -123,7 +123,7 @@ index 05036d819197..965b84d486b8 100644
if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */
return -EINVAL;
```
```diff
```diff[read_write.c]
diff --git a/fs/read_write.c b/fs/read_write.c
index 650fc7e0f3a6..55be193913b6 100644
--- a/fs/read_write.c
@@ -146,7 +146,7 @@ index 650fc7e0f3a6..55be193913b6 100644
return -EBADF;
if (!(file->f_mode & FMODE_CAN_READ))
```
```diff
```diff[stat.c]
diff --git a/fs/stat.c b/fs/stat.c
index 376543199b5a..82adcef03ecc 100644
--- a/fs/stat.c
@@ -170,6 +170,8 @@ index 376543199b5a..82adcef03ecc 100644
return -EINVAL;
```
:::
You should find the four functions in kernel source:
1. do_faccessat, usually in `fs/open.c`
@@ -262,3 +264,7 @@ index 45306f9ef247..815091ebfca4 100755
```
Finally, build your kernel again, KernelSU should work well.
:::info Entering safe mode accidiently?
If you use manual integration and do not disable `CONFIG_KPROBES`, then the user may trigger safe mode by pressing the volume down button after booting! Therefore if using manual integration you need to disable `CONFIG_KPROBES`!
:::