forked from Panchajanya1999/AnyKernel3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanykernel.sh
More file actions
executable file
·79 lines (60 loc) · 1.94 KB
/
anykernel.sh
File metadata and controls
executable file
·79 lines (60 loc) · 1.94 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
# AnyKernel3 Ramdisk Mod Script
# osm0sis @ xda-developers
## AnyKernel setup
# begin properties
properties() { '
kernel.string=Azure by panchajanya1999 @ xda-developers
do.devicecheck=1
do.modules=0
do.systemless=0
do.cleanup=1
do.cleanuponabort=0
device.name1=violet
device.name2=redfin
device.name3=coral
device.name4=
device.name5=
supported.versions=11,12
supported.patchlevels=
'; } # end properties
# shell variables
block=/dev/block/bootdevice/by-name/boot;
is_slot_device=0;
ramdisk_compression=none;
## AnyKernel methods (DO NOT CHANGE)
# import patching functions/variables - see for reference
. tools/ak3-core.sh;
## AnyKernel install
dump_boot;
if mountpoint -q /data; then
# Optimize F2FS extension list (@arter97)
for list_path in $(find /sys/fs/f2fs* -name extension_list); do
ui_print " • Optimizing F2FS extension list"
echo "Updating extension list: $list_path"
echo "Clearing extension list"
hot_count="$(grep -n 'hot file extens' $list_path | cut -d':' -f1)"
list_len="$(cat $list_path | wc -l)"
cold_count="$((list_len - hot_count))"
cold_list="$(head -n$((hot_count - 1)) $list_path | grep -v ':')"
hot_list="$(tail -n$cold_count $list_path)"
for ext in $cold_list; do
[ ! -z $ext ] && echo "[c]!$ext" > $list_path
done
for ext in $hot_list; do
[ ! -z $ext ] && echo "[h]!$ext" > $list_path
done
echo "Writing new extension list"
for ext in $(cat $home/f2fs-cold.list | grep -v '#'); do
[ ! -z $ext ] && echo "[c]$ext" > $list_path
done
for ext in $(cat $home/f2fs-hot.list); do
[ ! -z $ext ] && echo "[h]$ext" > $list_path
done
done
fi
#patch fstab for mounting data partition
patch_fstab /vendor/etc/fstab.qcom /data f2fs options "fsync_mode=nobarrier" "fsync_mode=posix,atgc,background_gc=sync"
#patch fstab for system partion
patch_fstab /vendor/etc/fstab.qcom / ext4 options "barrier=1" "nobarrier,i_version"
write_boot;
## end install