forked from osm0sis/AnyKernel3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanykernel.sh
More file actions
executable file
·82 lines (61 loc) · 1.78 KB
/
anykernel.sh
File metadata and controls
executable file
·82 lines (61 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
77
78
79
80
81
# AnyKernel2 Ramdisk Mod Script
# osm0sis @ xda-developers
## AnyKernel setup
# begin properties
properties() {
kernel.string=FGO Patch
do.devicecheck=0
do.modules=0
do.cleanup=1
do.cleanuponabort=0
device.name1=kenzo
device.name2=
device.name3=
device.name4=
device.name5=
} # end properties
# shell variables
#block=/dev/block/bootdevice/by-name/boot;
is_slot_device=0;
## AnyKernel methods (DO NOT CHANGE)
# import patching functions/variables - see for reference
. /tmp/anykernel/tools/ak2-core.sh;
#detect boot
find_boot_image() {
if [ -z "$block" ]; then
for PARTITION in kern-a KERN-A android_boot ANDROID_BOOT kernel KERNEL boot BOOT lnx LNX; do
block=`readlink /dev/block/by-name/$PARTITION || readlink /dev/block/platform/*/by-name/$PARTITION || readlink /dev/block/platform/*/*/by-name/$PARTITION`
if [ ! -z "$block" ]; then break; fi
done
fi
if [ -z "$block" ]; then
FSTAB="/etc/recovery.fstab"
[ ! -f "$FSTAB" ] && FSTAB="/etc/recovery.fstab.bak"
[ -f "$FSTAB" ] && block=`grep -E '\b/boot\b' "$FSTAB" | grep -oE '/dev/[a-zA-Z0-9_./-]*'`
fi
if [ -z "$block" ]; then
ui_print " ";
ui_print "Unable to determine active boot slot. Aborting...";
exit 1;
fi;
}
## AnyKernel permissions
# set permissions for included ramdisk files
#chmod -R 755 $ramdisk
#chmod 644 $ramdisk/sbin/media_profiles.xml
## AnyKernel install
find_boot_image;
ui_print "[#] Updating default.prop..."
dump_boot;
# begin ramdisk changes
# update default.prop
patch_prop "default.prop" "ro.debuggable" "0"
patch_prop "default.prop" "persist.sys.usb.config" "mtp"
# end ramdisk changes
write_boot;
ui_print "[#] Done"
# start system changes
ui_print "[#] Updating build.prop..."
patch_prop "/system/build.prop" "ro.build.type" "user"
ui_print "[#] Done"
## end install