ksud, kernel: update explanation and fix some issues (#194)

This commit is contained in:
skbeh
2023-02-04 13:16:51 +08:00
committed by GitHub
parent 4da829792f
commit 9f4a8d3dfc
3 changed files with 12 additions and 14 deletions

View File

@@ -1,6 +1,5 @@
#! /bin/bash
set -x
#!/bin/sh
set -eux
GKI_ROOT=$(pwd)
@@ -11,8 +10,8 @@ if test -d "$GKI_ROOT/common/drivers"; then
elif test -d "$GKI_ROOT/drivers"; then
DRIVER_DIR="$GKI_ROOT/drivers"
else
echo "[ERROR] "drivers/" directory is not found."
echo "[+] You should modify this scrpit by yourself."
echo '[ERROR] "drivers/" directory is not found.'
echo '[+] You should modify this scrpit by yourself.'
exit 127
fi
@@ -26,9 +25,9 @@ echo "[+] Copy kernel su driver to $DRIVER_DIR"
test -e "$DRIVER_DIR/kernelsu" || ln -sf "$GKI_ROOT/KernelSU/kernel" "$DRIVER_DIR/kernelsu"
echo "[+] Add kernel su driver to Makefile"
echo '[+] Add kernel su driver to Makefile'
DRIVER_MAKEFILE=$DRIVER_DIR/Makefile
grep -q "kernelsu" $DRIVER_MAKEFILE || echo "obj-y += kernelsu/" >> $DRIVER_MAKEFILE
grep -q "kernelsu" "$DRIVER_MAKEFILE" || echo "obj-y += kernelsu/" >>"$DRIVER_MAKEFILE"
echo "[+] Done."
echo '[+] Done.'

View File

@@ -1,7 +1,8 @@
#!/system/bin/sh
############################################
# KernelSU installer script
# Credit to Magisk!!!
# mostly from module_installer.sh
# and util_functions.sh in Magisk
############################################
umask 022
@@ -418,8 +419,5 @@ NVBASE=/data/adb/ksu
TMPDIR=/dev/tmp
# Some modules dependents on this
MAGISK_VER=25.2
MAGISK_VER_CODE=25200
# KSU to recognize
KSU=true
export MAGISK_VER=25.2
export MAGISK_VER_CODE=25200

View File

@@ -40,6 +40,7 @@ fn exec_install_script(module_file: &str) -> Result<()> {
"PATH",
format!("{}:{}", env_var("PATH").unwrap(), defs::BINARY_DIR),
)
.env("KSU", "true")
.env("OUTFD", "1")
.env("ZIPFILE", realpath)
.stderr(Stdio::null())