Repository navigation
Expand file tree
/
Copy pathanykernel.sh
More file actions
76 lines (60 loc) · 1.78 KB
/
Copy pathanykernel.sh
File metadata and controls
76 lines (60 loc) · 1.78 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
# AnyKernel2 Ramdisk Mod Script
# osm0sis @ xda-developers
## AnyKernel setup
# begin properties
properties() {'
kernel.string=Revolution Kernel by Revolution Techs Team
do.devicecheck=1
do.modules=0
do.cleanup=1
do.cleanuponabort=0
device.name1=beryllium
device.name2=dipper
device.name3=polaris
supported.versions=9,9.0
'} # end properties
# shell variables
block=/dev/block/bootdevice/by-name/boot;
is_slot_device=auto;
ramdisk_compression=auto;
## AnyKernel methods (DO NOT CHANGE)
# import patching functions/variables - see for reference
. /tmp/anykernel/tools/ak2-core.sh;
## AnyKernel file attributes
# set permissions/ownership for included ramdisk files
chmod -R 750 $ramdisk/*;
chown -R root:root $ramdisk/*;
LD_PATH=/system/lib
if [ -d /system/lib64 ]; then
LD_PATH=/system/lib64
fi
exec_util() {
LD_LIBRARY_PATH=/system/lib64 $UTILS $1
}
set_con() {
exec_util "chcon -h u:object_r:"$1":s0 $2"
exec_util "chcon u:object_r:"$1":s0 $2"
}
## Trim partitions
#ui_print " "
#ui_print "Triming cache & data partitions..."
#fstrim -v /cache;
#fstrim -v /data;
ui_print "Decompressing image kernel..."
ui_print "This might take some seconds."
## AnyKernel install
dump_boot;
# ramdisk patch
umount /vendor || true
mount -o rw /dev/block/bootdevice/by-name/vendor /vendor
exec_util "cp -a /tmp/anykernel/ramdisk/init.simple.sh /vendor/bin/"
set_con qti_init_shell_exec /vendor/bin/init.simple.sh
umount /vendor || true
# end ramdisk changes
# Set magisk policy
ui_print "Setting up magisk policy for SELinux...";
$bin/magiskpolicy --load sepolicy --save sepolicy "allow init rootfs file execute_no_trans";
$bin/magiskpolicy --load sepolicy_debug --save sepolicy_debug "allow init rootfs file execute_no_trans";
ui_print "Regenerating image kernel and installing..."
write_boot;
## end install