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
This commit is contained in:
@@ -270,7 +270,7 @@ pub fn exec_post_fs_data() -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn exec_common_scripts(dir: &str, wait: bool) -> 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() {
|
if !script_dir.exists() {
|
||||||
info!("{} not exists, skip", script_dir.display());
|
info!("{} not exists, skip", script_dir.display());
|
||||||
return Ok(());
|
return Ok(());
|
||||||
|
|||||||
@@ -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:
|
In KernelSU, startup scripts are divided into two types based on their storage location: general scripts and module scripts:
|
||||||
|
|
||||||
- General 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`)
|
- 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.
|
- 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
|
- 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.
|
- `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.
|
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.
|
|
||||||
:::
|
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ set_perm_recursive <directory> <owner> <group> <dirpermission> <filepermission>
|
|||||||
在 KernelSU 中,启动脚本根据存放位置的不同还分为两种:通用脚本和模块脚本。
|
在 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`)时才会被执行。
|
- 只有在脚本被设置为可执行(`chmod +x script.sh`)时才会被执行。
|
||||||
- 在 `post-fs-data.d` 中的脚本以 post-fs-data 模式运行,在 `service.d` 中的脚本以 late_start 服务模式运行。
|
- 在 `post-fs-data.d` 中的脚本以 post-fs-data 模式运行,在 `service.d` 中的脚本以 late_start 服务模式运行。
|
||||||
- 模块**不应**在安装过程中添加通用脚本。
|
- 模块**不应**在安装过程中添加通用脚本。
|
||||||
@@ -237,7 +237,3 @@ set_perm_recursive <directory> <owner> <group> <dirpermission> <filepermission>
|
|||||||
- `post-fs-data.sh` 以 post-fs-data 模式运行,而 `service.sh` 则以 late_start 服务模式运行。
|
- `post-fs-data.sh` 以 post-fs-data 模式运行,而 `service.sh` 则以 late_start 服务模式运行。
|
||||||
|
|
||||||
所有启动脚本都将在 KernelSU 的 BusyBox ash shell 中运行,并启用“独立模式”。
|
所有启动脚本都将在 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 脚本的运行时机,脚本的运行模式等。
|
|
||||||
:::
|
|
||||||
|
|||||||
Reference in New Issue
Block a user