-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanykernel.sh
More file actions
executable file
·91 lines (82 loc) · 2.62 KB
/
anykernel.sh
File metadata and controls
executable file
·91 lines (82 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
### AnyKernel3 Ramdisk Mod Script
## osm0sis @ xda-developers & GitHub @ Xiaomichael
### AnyKernel setup
# global properties
properties() { '
kernel.string=KernelSU by KernelSU Developers | Modified by cctv18 | Build by Lan
do.devicecheck=0
do.modules=0
do.systemless=0
do.cleanup=1
do.cleanuponabort=0
device.name1=
device.name2=
device.name3=
device.name4=
device.name5=
supported.versions=
supported.patchlevels=
supported.vendorpatchlevels=
'; } # end properties
### AnyKernel install
## boot shell variables
block=boot
is_slot_device=auto
ramdisk_compression=auto
patch_vbmeta_flag=auto
no_magisk_check=1
# import functions/variables and setup patching - see for reference (DO NOT REMOVE)
. tools/ak3-core.sh
set -a
. infoes.prop
set +a
kernel_version=$(cat /proc/version | awk -F '-' '{print $1}' | awk '{print $3}')
if [ $force_nongki = false ]; then
case $kernel_version in
5.1*) ksu_supported=true ;;
6.1*) ksu_supported=true ;;
6.6*) ksu_supported=true ;;
*) ksu_supported=false ;;
esac
else
case $kernel_version in
5.1*) ksu_supported=true ;;
6.1*) ksu_supported=true ;;
6.6*) ksu_supported=true ;;
5.4*) ksu_supported=true ;;
4.4*) ksu_supported=true ;;
4.1*) ksu_supported=true ;;
*) ksu_supported=false ;;
esac
fi
ui_print " " " -> KernelSU GKI 支持状态: $( [ "$ksu_supported" = true ] && echo 支持 || echo 不支持 )"
$ksu_supported || abort " -> 非 GKI 设备,请使用其他方式安装"
ui_print "内核构建者: Coolapk@Furrybluelan"
ui_print "内核修改者: Coolapk@Scctv18"
if ! [ $kernel_info -eq "" ]; then
ui_print "本内核信息:"
ui_print "$kernel_info"
fi
# boot install
if [ -L "/dev/block/bootdevice/by-name/init_boot_a" -o -L "/dev/block/by-name/init_boot_a" ]; then
split_boot # for devices with init_boot ramdisk
flash_boot # for devices with init_boot ramdisk
else
dump_boot # use split_boot to skip ramdisk unpack, e.g. for devices with init_boot ramdisk
write_boot # use flash_boot to skip ramdisk repack, e.g. for devices with init_boot ramdisk
fi
## end boot install
# 优先选择模块路径
if [ -f "$AKHOME/zram.zip" ]; then
MODULE_PATH="$AKHOME/zram.zip"
KSUD_PATH="/data/adb/ksud"
if [ -f "$KSUD_PATH" ]; then
ui_print "正在安装 ZRAM 模块"
/data/adb/ksud module install "$MODULE_PATH"
ui_print "ZRAM 模块安装成功"
else
ui_print "没有找到 KSUD,停止 ZRAM 模块安装(如果之前未安装过 KernelSU 则出现此提示为正常现象)"
fi
else
ui_print "没有找到 ZRAM 模块,可能是内核未配置"
fi