2015-11-17 11:05:58 -04:00
|
|
|
# AnyKernel2 Ramdisk Mod Script
|
2014-02-28 21:50:22 -04:00
|
|
|
# osm0sis @ xda-developers
|
|
|
|
|
|
|
|
|
|
## AnyKernel setup
|
2017-04-10 20:01:33 -03:00
|
|
|
# begin properties
|
2018-05-30 00:01:57 -03:00
|
|
|
properties() { '
|
2018-07-16 14:27:08 -03:00
|
|
|
kernel.string=ExampleKernel by osm0sis @ xda-developers
|
2014-02-28 21:50:22 -04:00
|
|
|
do.devicecheck=1
|
2014-08-26 14:53:42 -03:00
|
|
|
do.modules=0
|
2014-02-28 21:50:22 -04:00
|
|
|
do.cleanup=1
|
2017-02-17 22:26:44 +01:00
|
|
|
do.cleanuponabort=0
|
2014-02-28 21:50:22 -04:00
|
|
|
device.name1=maguro
|
|
|
|
|
device.name2=toro
|
|
|
|
|
device.name3=toroplus
|
2014-10-14 16:37:48 -03:00
|
|
|
device.name4=
|
|
|
|
|
device.name5=
|
2018-05-30 00:01:57 -03:00
|
|
|
'; } # end properties
|
2014-02-28 21:50:22 -04:00
|
|
|
|
|
|
|
|
# shell variables
|
|
|
|
|
block=/dev/block/platform/omap/omap_hsmmc.0/by-name/boot;
|
2016-11-25 08:34:22 -04:00
|
|
|
is_slot_device=0;
|
2017-11-22 13:32:06 -04:00
|
|
|
ramdisk_compression=auto;
|
2014-02-28 21:50:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
## AnyKernel methods (DO NOT CHANGE)
|
2016-11-30 23:10:37 -04:00
|
|
|
# import patching functions/variables - see for reference
|
|
|
|
|
. /tmp/anykernel/tools/ak2-core.sh;
|
2014-02-28 21:50:22 -04:00
|
|
|
|
|
|
|
|
|
2017-10-14 13:36:23 -03:00
|
|
|
## AnyKernel file attributes
|
|
|
|
|
# set permissions/ownership for included ramdisk files
|
2017-10-14 13:34:00 -03:00
|
|
|
chmod -R 750 $ramdisk/*;
|
2018-07-13 01:27:54 -03:00
|
|
|
chmod -R 755 $ramdisk/sbin;
|
2017-11-25 18:20:24 -04:00
|
|
|
chown -R root:root $ramdisk/*;
|
2014-03-01 16:01:59 -04:00
|
|
|
|
|
|
|
|
|
2014-02-28 21:50:22 -04:00
|
|
|
## AnyKernel install
|
|
|
|
|
dump_boot;
|
|
|
|
|
|
|
|
|
|
# begin ramdisk changes
|
|
|
|
|
|
|
|
|
|
# init.rc
|
|
|
|
|
backup_file init.rc;
|
|
|
|
|
replace_string init.rc "cpuctl cpu,timer_slack" "mount cgroup none /dev/cpuctl cpu" "mount cgroup none /dev/cpuctl cpu,timer_slack";
|
|
|
|
|
|
|
|
|
|
# init.tuna.rc
|
|
|
|
|
backup_file init.tuna.rc;
|
2015-11-17 11:05:58 -04:00
|
|
|
insert_line init.tuna.rc "nodiratime barrier=0" after "mount_all /fstab.tuna" "\tmount ext4 /dev/block/platform/omap/omap_hsmmc.0/by-name/userdata /data remount nosuid nodev noatime nodiratime barrier=0";
|
2018-07-16 14:27:08 -03:00
|
|
|
append_file init.tuna.rc "bootscript" init.tuna;
|
2014-02-28 21:50:22 -04:00
|
|
|
|
|
|
|
|
# fstab.tuna
|
|
|
|
|
backup_file fstab.tuna;
|
2017-10-14 13:34:00 -03:00
|
|
|
patch_fstab fstab.tuna /system ext4 options "noatime,barrier=1" "noatime,nodiratime,barrier=0";
|
|
|
|
|
patch_fstab fstab.tuna /cache ext4 options "barrier=1" "barrier=0,nomblk_io_submit";
|
|
|
|
|
patch_fstab fstab.tuna /data ext4 options "data=ordered" "nomblk_io_submit,data=writeback";
|
2014-02-28 21:50:22 -04:00
|
|
|
append_file fstab.tuna "usbdisk" fstab;
|
|
|
|
|
|
|
|
|
|
# end ramdisk changes
|
|
|
|
|
|
|
|
|
|
write_boot;
|
|
|
|
|
|
|
|
|
|
## end install
|
|
|
|
|
|