Skip to content

Commit

Permalink
customize.sh: Add blocklist config check
Browse files Browse the repository at this point in the history
Co-Authored-By: セリカ・シルフィル <64072399+natsumerinchan@users.noreply.github.com>
  • Loading branch information
natsumerinchan committed Mar 25, 2023
1 parent 30d5fe0 commit 9e30816
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 10 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,26 @@ case "$kernel_version" in
esac
```

- 要求内核开启某些配置
- 内核配置依赖项
```
config_list="
config_dependencylist="
CONFIG_MODULES
CONFIG_KPROBES
CONFIG_HAVE_KPROBES
CONFIG_KPROBE_EVENTS
"
```

- 内核配置黑名单

(注:此功能默认被禁用,如有需求请将`# check_blocklist`取消注释)
```
config_blocklist="
CONFIG_LTO
CONFIG_THINLTO
"
```

### 4、修改module.prop
这个无需多讲,爱怎么改就怎么改

Expand Down
39 changes: 33 additions & 6 deletions customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,41 @@ else
fi

# Check Kernel Configs
ui_print "- Check Kernel Configs..."
config_list="
config_dependencylist="
CONFIG_MODULES
CONFIG_KPROBES
CONFIG_HAVE_KPROBES
CONFIG_KPROBE_EVENTS
"
for config_name in $config_list
do
(zcat /proc/config.gz | grep "$config_name=y") || abort "! Your Kernel has not enabled $config_name !"
done

config_blocklist="
CONFIG_LTO
CONFIG_THINLTO
"

check_dependencylist() {
ui_print "- Checking Dependencylist Kernel Configs..."
for config_name in $config_dependencylist
do
if [ ! $(zcat /proc/config.gz | grep "$config_name=y") ]; then
abort "! Your Kernel has not enabled $config_name !"
else
ui_print "- $config_name=y"
fi
done
}

check_blocklist() {
ui_print "- Checking Blocklist Kernel Configs..."
for config_name in $config_blocklist
do
if [ $(zcat /proc/config.gz | grep "$config_name=y") ]; then
abort "! Your Kernel has not disabled $config_name !"
else
ui_print "- $config_name has been disabled."
fi
done
}

check_dependencylist
# check_blocklist
4 changes: 2 additions & 2 deletions module.prop
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
id=Kernel_Module_Loader
name=Kernel Module Loader
version=v1.0.0
versionCode=100
version=v1.0.1
versionCode=101
author=natsumerinchan
description=利用Magisk/KernelSU在开机后加载内核模块

0 comments on commit 9e30816

Please sign in to comment.