From ba4ffa759858d32794e74da876342e7f54586993 Mon Sep 17 00:00:00 2001 From: tiann Date: Mon, 27 Mar 2023 10:51:25 +0800 Subject: [PATCH] ksud: Since we have forbidden module running when Magisk installed, we can now move common script from /data/adb/ksu/post-fs-data.d -> /data/adb/post-fs-data.d and /data/adb/ksu/service.d -> /data/adb/service.d --- userspace/ksud/src/module.rs | 2 +- website/docs/guide/module.md | 6 +----- website/docs/zh_CN/guide/module.md | 6 +----- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/userspace/ksud/src/module.rs b/userspace/ksud/src/module.rs index 4cdb6e93..5f626d3a 100644 --- a/userspace/ksud/src/module.rs +++ b/userspace/ksud/src/module.rs @@ -270,7 +270,7 @@ pub fn exec_post_fs_data() -> Result<()> { } pub fn exec_common_scripts(dir: &str, wait: bool) -> Result<()> { - let script_dir = Path::new(defs::WORKING_DIR).join(dir); + let script_dir = Path::new(defs::ADB_DIR).join(dir); if !script_dir.exists() { info!("{} not exists, skip", script_dir.display()); return Ok(()); diff --git a/website/docs/guide/module.md b/website/docs/guide/module.md index 2cd4270f..fc78ff7a 100644 --- a/website/docs/guide/module.md +++ b/website/docs/guide/module.md @@ -221,7 +221,7 @@ In KernelSU, scripts are divided into two types based on their running mode: pos In KernelSU, startup scripts are divided into two types based on their storage location: general scripts and module scripts: - General Scripts - - Placed in `/data/adb/ksu/post-fs-data.d` or `/data/adb/ksu/service.d` + - Placed in `/data/adb/post-fs-data.d` or `/data/adb/service.d` - Only executed if the script is set as executable (`chmod +x script.sh`) - Scripts in `post-fs-data.d` runs in post-fs-data mode, and scripts in `service.d` runs in late_start service mode. - Modules should **NOT** add general scripts during installation @@ -231,7 +231,3 @@ In KernelSU, startup scripts are divided into two types based on their storage l - `post-fs-data.sh` runs in post-fs-data mode, and `service.sh` runs in late_start service mode. All boot scripts will run in KernelSU's BusyBox `ash` shell with "Standalone Mode" enabled. - -::: tip difference with Magisk -KernelSU's general modules are stored in `/data/adb/ksu/post-fs-data.d` and `/data/adb/ksu/service.d`, while Magisk's general modules are stored in `/data/adb/post-fs-data.d` and `/data/adb/service.d`. Apart from this difference, they are completely identical (this may be changed to make them identical in the future). This includes the timing of the execution of post-fs-data and late_start scripts, as well as the running mode of the scripts. -::: diff --git a/website/docs/zh_CN/guide/module.md b/website/docs/zh_CN/guide/module.md index ae79d870..971f234f 100644 --- a/website/docs/zh_CN/guide/module.md +++ b/website/docs/zh_CN/guide/module.md @@ -226,7 +226,7 @@ set_perm_recursive 在 KernelSU 中,启动脚本根据存放位置的不同还分为两种:通用脚本和模块脚本。 - 通用脚本 - - 放置在 `/data/adb/ksu/post-fs-data.d` 或 `/data/adb/ksu/service.d` 中。 + - 放置在 `/data/adb/post-fs-data.d` 或 `/data/adb/service.d` 中。 - 只有在脚本被设置为可执行(`chmod +x script.sh`)时才会被执行。 - 在 `post-fs-data.d` 中的脚本以 post-fs-data 模式运行,在 `service.d` 中的脚本以 late_start 服务模式运行。 - 模块**不应**在安装过程中添加通用脚本。 @@ -237,7 +237,3 @@ set_perm_recursive - `post-fs-data.sh` 以 post-fs-data 模式运行,而 `service.sh` 则以 late_start 服务模式运行。 所有启动脚本都将在 KernelSU 的 BusyBox ash shell 中运行,并启用“独立模式”。 - -::: tip 与 Magisk 的差异 -KernelSU 的通用模块存放在 `/data/adb/ksu/post-fs-data.d` 和 `/data/adb/ksu/service.d`,而 Magisk 的通用模块存放在 `/data/adb/post-fs-data.d` 和 `/data/adb/service.d`;除此之外二者是完全一样的(后面可能会改成一样的)。包括 post-fs-data 和 late_start 脚本的运行时机,脚本的运行模式等。 -:::