forked from osm0sis/AnyKernel3
-
Notifications
You must be signed in to change notification settings - Fork 1
/
anykernel.sh
executable file
·73 lines (60 loc) · 1.77 KB
/
anykernel.sh
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
# AnyKernel3 Ramdisk Mod Script
# osm0sis @ xda-developers
## AnyKernel setup
# begin properties
properties() { '
kernel.string=# mcd-kernel for OnePlus 6/T by mcdachpappe #
do.devicecheck=1
do.modules=0
do.systemless=1
do.cleanup=1
do.cleanuponabort=0
device.name1=OnePlus6
device.name2=enchilada
device.name3=OnePlus6T
device.name4=fajita
device.name5=
supported.versions=10 - 13
supported.patchlevels=
'; } # end properties
# shell variables
block=/dev/block/bootdevice/by-name/boot;
is_slot_device=1;
ramdisk_compression=auto;
patch_vbmeta_flag=auto;
## AnyKernel methods (DO NOT CHANGE)
# import patching functions/variables - see for reference
. tools/ak3-core.sh;
## Trim data partition
$BB fstrim -v /data;
## Select the correct image to flash / Detect first appearance in build.prop only
USERFLAVOR="$(grep -m 1 "^ro.build.user" /system/build.prop | cut -d= -f2):$(grep -m 1 "^ro.build.flavor" /system/build.prop | cut -d= -f2)";
case "$USERFLAVOR" in
"OnePlus:OnePlus6-user" | "OnePlus:OnePlus6T-user" | "jenkins:qssi-user")
OS="oos";
OS_STRING="OxygenOS";
;;
*)
OS="custom";
OS_STRING="a custom ROM";
;;
esac;
ui_print " " "You are on $OS_STRING!";
# Move kernel image
if [ -f $home/kernels/$OS/Image.gz-dtb ]; then
mv $home/kernels/$OS/Image.gz-dtb $home/Image.gz-dtb;
else
ui_print " " "There is no kernel for your OS in this zip! Aborting..."; exit 1;
fi;
## AnyKernel boot install
dump_boot;
# Reset cmdline
patch_cmdline "pre_android_S" "";
# Get Android version
android_version=$(file_getprop /system/build.prop "ro.build.version.release");
# Patch cmdline, if on custom ROM Android 11 (R) and below
if [ "$OS" = "custom" ] && [ "$android_version" \< "12" ]; then
patch_cmdline "pre_android_S" "pre_android_S";
fi;
write_boot;
## end boot install