diff --git a/file_contexts b/file_contexts
index 3e41977..2a02a8c 100644
--- a/file_contexts
+++ b/file_contexts
@@ -15,7 +15,6 @@
/charger u:object_r:rootfs:s0
/init u:object_r:rootfs:s0
/sbin(/.*)? u:object_r:rootfs:s0
-/sbin/busybox u:object_r:rootfs:s0
# Empty directories
/lost\+found u:object_r:rootfs:s0
@@ -152,7 +151,6 @@
/system/bin/racoon u:object_r:racoon_exec:s0
/system/xbin/su u:object_r:su_exec:s0
/system/vendor/bin/gpsd u:object_r:gpsd_exec:s0
-/system/xbin/wget u:object_r:rootfs:s0
/system/bin/dnsmasq u:object_r:dnsmasq_exec:s0
/system/bin/hostapd u:object_r:hostapd_exec:s0
/system/bin/clatd u:object_r:clatd_exec:s0
@@ -256,7 +254,7 @@
/mnt/asec/[^/]+/lib(/.*)? u:object_r:asec_public_file:s0
/data/app-asec(/.*)? u:object_r:asec_image_file:s0
#line 1 "device/qcom/sepolicy/common/file_contexts"
-###################################
+##################################
# Dev nodes
#
/dev/adsprpc-smd u:object_r:qdsp_device:s0
@@ -274,6 +272,7 @@
/dev/rtc0 u:object_r:rtc_device:s0
/dev/sensors u:object_r:sensors_device:s0
/dev/smd.* u:object_r:smd_device:s0
+/dev/smd11 u:object_r:smd11_device:s0
/dev/smem_log u:object_r:smem_log_device:s0
/dev/ttyHSL0 u:object_r:console_device:s0
/dev/ttyHS[0-9]* u:object_r:serial_device:s0
@@ -290,6 +289,7 @@
/dev/block/bootdevice/by-name/fsc u:object_r:modem_efs_partition_device:s0
/dev/block/bootdevice/by-name/ssd u:object_r:ssd_device:s0
/dev/block/mmcblk0rpmb u:object_r:rpmb_device:s0
+/dev/sg.* u:object_r:sg_device:s0
/dev/ccid_bridge u:object_r:usb_uicc_device:s0
/dev/block/bootdevice/by-name/mdm1m9kefs1 u:object_r:efs_boot_dev:s0
/dev/block/bootdevice/by-name/mdm1m9kefs2 u:object_r:efs_boot_dev:s0
@@ -310,6 +310,8 @@
/dev/dpl_ctrl u:object_r:rmnet_device:s0
/dev/wcnss_ctrl u:object_r:wcnss_device:s0
/dev/wcnss_wlan u:object_r:wcnss_device:s0
+/dev/pta u:object_r:pta_device:s0
+/dev/mdss_rotator u:object_r:graphics_device:s0
/dev/hbtp_input u:object_r:hbtp_device:s0
/dev/jdi-bu21150 u:object_r:bu21150_device:s0
/dev/voice_svc u:object_r:voice_device:s0
@@ -318,6 +320,7 @@
/dev/coresight-tmc-etr u:object_r:qdss_device:s0
/dev/coresight-tmc-etr-stream u:object_r:qdss_device:s0
/dev/system_health_monitor u:object_r:system_health_monitor_device:s0
+/dev/block/bootdevice/by-name/frp u:object_r:frp_block_device:s0
###################################
# Dev socket nodes
@@ -345,6 +348,7 @@
/dev/socket/rild2-debug u:object_r:rild_debug_socket:s0
/dev/socket/rild3 u:object_r:rild_socket:s0
/dev/socket/rild3-debug u:object_r:rild_debug_socket:s0
+/dev/socket/msm_irqbalance u:object_r:msm_irqbalance_socket:s0
###################################
# System files
@@ -396,6 +400,7 @@
/system/bin/mdm_helper_proxy u:object_r:mdm_helper_exec:s0
/system/bin/ks u:object_r:mdm_helper_exec:s0
/system/bin/pm-service u:object_r:per_mgr_exec:s0
+/system/bin/pm-proxy u:object_r:per_mgr_exec:s0
/system/bin/usb_uicc_client u:object_r:usb_uicc_daemon_exec:s0
/system/bin/qcom-system-daemon u:object_r:qcomsysd_exec:s0
/system/xbin/qlogd u:object_r:qlogd_exec:s0
@@ -417,16 +422,20 @@
/system/bin/garden_app u:object_r:location_exec:s0
/system/bin/gpsone_daemon u:object_r:location_exec:s0
/system/vendor/bin/slim_ap_daemon u:object_r:location_exec:s0
+/system/bin/energy-awareness u:object_r:energyawareness_exec:s0
+/system/bin/dts_configurator u:object_r:dtsconfigurator_exec:s0
/system/vendor/bin/qti u:object_r:qti_exec:s0
/system/bin/wcnss_service u:object_r:wcnss_service_exec:s0
/system/vendor/bin/hbtp_daemon u:object_r:hbtp_exec:s0
+/system/bin/wcnss_filter u:object_r:wcnss_filter_exec:s0
###################################
# sysfs files
#
/sys/class/graphics/fb0/mdp/caps u:object_r:sysfs_graphics:s0
/sys/class/thermal(/.*)? u:object_r:sysfs_thermal:s0
-/sys/devices/.*bcl.*(/.*)? u:object_r:sysfs_thermal:s0
+/sys/devices/soc.0/qcom,bcl.*(/.*)? u:object_r:sysfs_thermal:s0
+/sys/devices/qcom,bcl.*(/.*)? u:object_r:sysfs_thermal:s0
/sys/devices/f9200000.*/power_supply/usb(/.*)? u:object_r:sysfs_usb_supply:s0
/sys/devices/msm_dwc3/power_supply/usb(/.*)? u:object_r:sysfs_usb_supply:s0
/sys/devices/msm_otg/power_supply/usb(/.*)? u:object_r:sysfs_usb_supply:s0
@@ -434,6 +443,7 @@
/sys/devices/qpnp-charger.*/power_supply/battery(/.*)? u:object_r:sysfs_battery_supply:s0
/sys/devices/system/cpu/cpu0/rq-stats/* u:object_r:sysfs_rqstats:s0
/sys/devices/virtual/graphics/fb([0-2])+/idle_time u:object_r:sysfs_graphics:s0
+/sys/devices/virtual/graphics/fb([0-2])+/dynamic_fps u:object_r:sysfs_graphics:s0
/sys/devices/virtual/graphics/fb([0-2])+/product_description u:object_r:sysfs_graphics:s0
/sys/devices/virtual/graphics/fb([0-2])+/vendor_name u:object_r:sysfs_graphics:s0
/sys/devices/virtual/hsicctl/hsicctl1[0-9]/modem_wait u:object_r:sysfs_hsic_modem_wait:s0
@@ -446,6 +456,8 @@
/sys/module/msm_thermal/core_control/cpus_offlined u:object_r:sysfs_mpdecision:s0
/sys/devices/f9a55000.*/power_supply/usb(/.*)? u:object_r:sysfs_usb_supply:s0
/sys/devices/virtual/graphics/fb([0-2])+/hpd u:object_r:sysfs_graphics:s0
+/sys/devices/virtual/graphics/fb([0-2])+/res_info u:object_r:sysfs_graphics:s0
+/sys/devices/virtual/graphics/fb([0-2])+/s3d_mode u:object_r:sysfs_graphics:s0
/sys/class/graphics/fb([0-2])+/mdp/caps u:object_r:sysfs_graphics:s0
/sys/class/graphics/fb([0-2])+/ad u:object_r:sysfs_graphics:s0
/sys/bus/platform/drivers/xhci_msm_hsic(/.*)? u:object_r:sysfs_hsic:s0
@@ -482,7 +494,9 @@
/data/misc/location(/.*)? u:object_r:location_data_file:s0
/data/FTM_AP(/.*)? u:object_r:mmi_data_file:s0
/data/misc/hbtp(/.*)? u:object_r:hbtp_log_file:s0
+/data/local/.Drm(/.*)? u:object_r:oma_drm_data_file:s0
/data/misc/qlogd(/.*)? u:object_r:qlogd_data_file:s0
+/data/misc/dts(/.*)? u:object_r:dts_data_file:s0
###################################
# persist files
@@ -492,6 +506,7 @@
/persist/data(/.*)? u:object_r:persist_drm_file:s0
/persist/data/tz(/.*)? u:object_r:persist_drm_file:s0
/persist/data/sfs(/.*)? u:object_r:persist_drm_file:s0
+/persist/display(/.*)? u:object_r:persist_display_file:s0
###################################
# oem files
@@ -657,3 +672,9 @@
# Lockscreen wallpaper
/data/system/users/[0-9]+/keyguard_wallpaper u:object_r:wallpaper_file:s0
+
+# LiveDisplay
+/sys/devices/virtual/graphics/fb0/aco u:object_r:livedisplay_sysfs:s0
+/sys/devices/virtual/graphics/fb0/cabc u:object_r:livedisplay_sysfs:s0
+/sys/devices/virtual/graphics/fb0/rgb u:object_r:livedisplay_sysfs:s0
+/sys/devices/virtual/graphics/fb0/sre u:object_r:livedisplay_sysfs:s0
diff --git a/fstab.qcom b/fstab.qcom
index 2a1cf3a..b1272b3 100644
--- a/fstab.qcom
+++ b/fstab.qcom
@@ -11,9 +11,9 @@
/dev/block/platform/msm_sdcc.1/by-name/mdm /firmware-mdm vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait
/dev/block/platform/msm_sdcc.1/by-name/efs /efs ext4 nosuid,nodev,noatime,noauto_da_alloc,journal_async_commit,errors=panic wait,check
/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 nosuid,nodev,noatime,noauto_da_alloc,journal_async_commit,errors=panic wait,check
-/dev/block/platform/msm_sdcc.1/by-name/cache /cache f2fs rw,nosuid,nodev,noatime,nodiratime,inline_xattr wait,check
+/dev/block/platform/msm_sdcc.1/by-name/cache /cache f2fs rw,nosuid,nodev,noatime,nodiratime,inline_xattr wait,check
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 nosuid,nodev,noatime,noauto_da_alloc,journal_async_commit,errors=panic wait,check,encryptable=footer
-/dev/block/platform/msm_sdcc.1/by-name/userdata /data f2fs rw,nosuid,nodev,noatime,nodiratime,inline_xattr wait,check,encryptable=footer
+/dev/block/platform/msm_sdcc.1/by-name/userdata /data f2fs rw,nosuid,nodev,noatime,nodiratime,inline_xattr wait,check,encryptable=footer
-/devices/platform/msm_sdcc.2/mmc_host/mmc2* auto auto defaults voldmanaged=sdcard1:auto
-/devices/platform/msm_hsusb_host/usb* auto auto defaults voldmanaged=usbdisk:auto
+/devices/platform/msm_sdcc.2/mmc_host/mmc2* auto auto defaults voldmanaged=sdcard1:auto,noemulatedsd
+/devices/platform/msm_hsusb_host/usb* auto auto defaults voldmanaged=usbdisk:auto,noemulatedsd
diff --git a/init b/init
index a7bf7cf..9f0ce03 100755
Binary files a/init and b/init differ
diff --git a/init.cm.rc b/init.cm.rc
deleted file mode 100755
index 6c10468..0000000
--- a/init.cm.rc
+++ /dev/null
@@ -1,49 +0,0 @@
-# Extras
-
-import /init.superuser.rc
-
-on init
- export ANDROID_CACHE /cache
- export TERMINFO /system/etc/terminfo
- export TERM linux
-
-on post-fs-data
- mkdir /cache/dalvik-cache 0771 system system
- chown system system /cache/dalvik-cache
- chmod 0771 /cache/dalvik-cache
- mkdir /data/.ssh 0750 root shell
-
- # Run sysinit
- start sysinit
-
-on boot
- chown system system /sys/block/mmcblk0/queue/scheduler
- chmod 0664 /sys/block/mmcblk0/queue/scheduler
- restorecon /sys/block/mmcblk0/queue/scheduler
-
- chown system system /dev/cpuctl/cpu.notify_on_migrate
- chmod 0664 /dev/cpuctl/cpu.notify_on_migrate
-
- # Define TCP delayed ack settings for WiFi & LTE
- chown system system /sys/kernel/ipv4/tcp_delack_seg
- chown system system /sys/kernel/ipv4/tcp_use_userconfig
- setprop net.tcp.delack.default 1
- setprop net.tcp.delack.wifi 20
- setprop net.tcp.delack.lte 8
- setprop net.tcp.usercfg.default 0
- setprop net.tcp.usercfg.wifi 1
- setprop net.tcp.usercfg.lte 1
-
-# adb over network
-on property:service.adb.tcp.port=5555
- stop adbd
- start adbd
-on property:service.adb.tcp.port=-1
- stop adbd
- start adbd
-
-# sysinit (/system/etc/init.d)
-service sysinit /system/bin/sysinit
- user root
- oneshot
- disabled
diff --git a/init.environ.rc b/init.environ.rc
index ee45f5c..32bd8a7 100755
--- a/init.environ.rc
+++ b/init.environ.rc
@@ -9,5 +9,5 @@ on init
export ASEC_MOUNTPOINT /mnt/asec
export LOOP_MOUNTPOINT /mnt/obb
export BOOTCLASSPATH /system/framework/core-libart.jar:/system/framework/conscrypt.jar:/system/framework/okhttp.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/apache-xml.jar:/system/framework/qcmediaplayer.jar
- export SYSTEMSERVERCLASSPATH /system/framework/services.jar:/system/framework/ethernet-service.jar:/system/framework/wifi-service.jar
+ export SYSTEMSERVERCLASSPATH /system/framework/org.cyanogenmod.platform.jar:/system/framework/org.cyanogenmod.hardware.jar:/system/framework/services.jar:/system/framework/ethernet-service.jar:/system/framework/wifi-service.jar
export LD_PRELOAD libsigchain.so
diff --git a/init.qcom.post_boot.sh b/init.qcom.post_boot.sh
deleted file mode 100755
index d0bd817..0000000
--- a/init.qcom.post_boot.sh
+++ /dev/null
@@ -1,204 +0,0 @@
-#!/system/bin/sh
-# Copyright (c) 2009-2012, The Linux Foundation. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# * Neither the name of The Linux Foundation nor
-# the names of its contributors may be used to endorse or promote
-# products derived from this software without specific prior written
-# permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-
-target=`getprop ro.board.platform`
-
-case "$target" in
- "msm8960")
- echo 1 > /sys/module/rpm_resources/enable_low_power/L2_cache
- echo 1 > /sys/module/rpm_resources/enable_low_power/pxo
- echo 1 > /sys/module/rpm_resources/enable_low_power/vdd_dig
- echo 1 > /sys/module/rpm_resources/enable_low_power/vdd_mem
- echo 1 > /sys/module/pm_8x60/modes/cpu0/retention/idle_enabled
- echo 1 > /sys/module/pm_8x60/modes/cpu1/retention/idle_enabled
- echo 1 > /sys/module/pm_8x60/modes/cpu2/retention/idle_enabled
- echo 1 > /sys/module/pm_8x60/modes/cpu3/retention/idle_enabled
- echo 1 > /sys/module/pm_8x60/modes/cpu0/power_collapse/suspend_enabled
- echo 1 > /sys/module/pm_8x60/modes/cpu1/power_collapse/suspend_enabled
- echo 1 > /sys/module/pm_8x60/modes/cpu2/power_collapse/suspend_enabled
- echo 1 > /sys/module/pm_8x60/modes/cpu3/power_collapse/suspend_enabled
- echo 1 > /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/suspend_enabled
- echo 1 > /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/suspend_enabled
- echo 1 > /sys/module/pm_8x60/modes/cpu2/standalone_power_collapse/suspend_enabled
- echo 1 > /sys/module/pm_8x60/modes/cpu3/standalone_power_collapse/suspend_enabled
- echo 1 > /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/idle_enabled
- echo 1 > /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/idle_enabled
- echo 1 > /sys/module/pm_8x60/modes/cpu2/standalone_power_collapse/idle_enabled
- echo 1 > /sys/module/pm_8x60/modes/cpu3/standalone_power_collapse/idle_enabled
- echo 1 > /sys/module/pm_8x60/modes/cpu0/power_collapse/idle_enabled
- echo 1 > /sys/devices/system/cpu/cpu1/online
- echo 1 > /sys/devices/system/cpu/cpu2/online
- echo 1 > /sys/devices/system/cpu/cpu3/online
- # set DCVS parameters for CPU
- echo 40000 > /sys/module/msm_dcvs/cores/cpu0/slack_time_max_us
- echo 40000 > /sys/module/msm_dcvs/cores/cpu0/slack_time_min_us
- echo 100000 > /sys/module/msm_dcvs/cores/cpu0/em_win_size_min_us
- echo 500000 > /sys/module/msm_dcvs/cores/cpu0/em_win_size_max_us
- echo 0 > /sys/module/msm_dcvs/cores/cpu0/slack_mode_dynamic
- echo 1000000 > /sys/module/msm_dcvs/cores/cpu0/disable_pc_threshold
- echo 25000 > /sys/module/msm_dcvs/cores/cpu1/slack_time_max_us
- echo 25000 > /sys/module/msm_dcvs/cores/cpu1/slack_time_min_us
- echo 100000 > /sys/module/msm_dcvs/cores/cpu1/em_win_size_min_us
- echo 500000 > /sys/module/msm_dcvs/cores/cpu1/em_win_size_max_us
- echo 0 > /sys/module/msm_dcvs/cores/cpu1/slack_mode_dynamic
- echo 1000000 > /sys/module/msm_dcvs/cores/cpu1/disable_pc_threshold
- echo 25000 > /sys/module/msm_dcvs/cores/cpu2/slack_time_max_us
- echo 25000 > /sys/module/msm_dcvs/cores/cpu2/slack_time_min_us
- echo 100000 > /sys/module/msm_dcvs/cores/cpu2/em_win_size_min_us
- echo 500000 > /sys/module/msm_dcvs/cores/cpu2/em_win_size_max_us
- echo 0 > /sys/module/msm_dcvs/cores/cpu2/slack_mode_dynamic
- echo 1000000 > /sys/module/msm_dcvs/cores/cpu2/disable_pc_threshold
- echo 25000 > /sys/module/msm_dcvs/cores/cpu3/slack_time_max_us
- echo 25000 > /sys/module/msm_dcvs/cores/cpu3/slack_time_min_us
- echo 100000 > /sys/module/msm_dcvs/cores/cpu3/em_win_size_min_us
- echo 500000 > /sys/module/msm_dcvs/cores/cpu3/em_win_size_max_us
- echo 0 > /sys/module/msm_dcvs/cores/cpu3/slack_mode_dynamic
- echo 1000000 > /sys/module/msm_dcvs/cores/cpu3/disable_pc_threshold
- # set DCVS parameters for GPU
- echo 20000 > /sys/module/msm_dcvs/cores/gpu0/slack_time_max_us
- echo 20000 > /sys/module/msm_dcvs/cores/gpu0/slack_time_min_us
- echo 0 > /sys/module/msm_dcvs/cores/gpu0/slack_mode_dynamic
- # set msm_mpdecision parameters
- echo 45000 > /sys/module/msm_mpdecision/slack_time_max_us
- echo 15000 > /sys/module/msm_mpdecision/slack_time_min_us
- echo 100000 > /sys/module/msm_mpdecision/em_win_size_min_us
- echo 1000000 > /sys/module/msm_mpdecision/em_win_size_max_us
- echo 3 > /sys/module/msm_mpdecision/online_util_pct_min
- echo 25 > /sys/module/msm_mpdecision/online_util_pct_max
- echo 97 > /sys/module/msm_mpdecision/em_max_util_pct
- echo 2 > /sys/module/msm_mpdecision/rq_avg_poll_ms
- echo 10 > /sys/module/msm_mpdecision/mp_em_rounding_point_min
- echo 85 > /sys/module/msm_mpdecision/mp_em_rounding_point_max
- echo 50 > /sys/module/msm_mpdecision/iowait_threshold_pct
- #set permissions for SSRM
- chown radio.system /sys/power/cpufreq_max_limit
- chown radio.system /sys/power/cpufreq_min_limit
- chown radio.system /sys/power/cpufreq_table
- chown radio.system /sys/devices/system/cpu/kernel_max
- chown radio.system /sys/class/power_supply/battery/siop_level
- chown radio.system /sys/class/lcd/panel/siop_enable
- chmod 664 /sys/power/cpufreq_max_limit
- chmod 664 /sys/power/cpufreq_min_limit
- chmod 664 /sys/power/cpufreq_table
- chmod 664 /sys/devices/system/cpu/kernel_max
- #set permissions for the nodes needed by display on/off hook
- chown -h system /sys/module/msm_dcvs/cores/cpu0/slack_time_max_us
- chown -h system /sys/module/msm_dcvs/cores/cpu0/slack_time_min_us
- chown -h system /sys/module/msm_mpdecision/slack_time_max_us
- chown -h system /sys/module/msm_mpdecision/slack_time_min_us
- chmod -h 664 /sys/module/msm_dcvs/cores/cpu0/slack_time_max_us
- chmod -h 664 /sys/module/msm_dcvs/cores/cpu0/slack_time_min_us
- chmod -h 664 /sys/module/msm_mpdecision/slack_time_max_us
- chmod -h 664 /sys/module/msm_mpdecision/slack_time_min_us
- soc_id=`cat /sys/devices/system/soc/soc0/id`
- case "$soc_id" in
- "130")
- echo 230 > /sys/class/gpio/export
- echo 228 > /sys/class/gpio/export
- echo 229 > /sys/class/gpio/export
- echo "in" > /sys/class/gpio/gpio230/direction
- echo "rising" > /sys/class/gpio/gpio230/edge
- echo "in" > /sys/class/gpio/gpio228/direction
- echo "rising" > /sys/class/gpio/gpio228/edge
- echo "in" > /sys/class/gpio/gpio229/direction
- echo "rising" > /sys/class/gpio/gpio229/edge
- echo 253 > /sys/class/gpio/export
- echo 254 > /sys/class/gpio/export
- echo 257 > /sys/class/gpio/export
- echo 258 > /sys/class/gpio/export
- echo 259 > /sys/class/gpio/export
- echo "out" > /sys/class/gpio/gpio253/direction
- echo "out" > /sys/class/gpio/gpio254/direction
- echo "out" > /sys/class/gpio/gpio257/direction
- echo "out" > /sys/class/gpio/gpio258/direction
- echo "out" > /sys/class/gpio/gpio259/direction
- chown -h media /sys/class/gpio/gpio253/value
- chown -h media /sys/class/gpio/gpio254/value
- chown -h media /sys/class/gpio/gpio257/value
- chown -h media /sys/class/gpio/gpio258/value
- chown -h media /sys/class/gpio/gpio259/value
- chown -h media /sys/class/gpio/gpio253/direction
- chown -h media /sys/class/gpio/gpio254/direction
- chown -h media /sys/class/gpio/gpio257/direction
- chown -h media /sys/class/gpio/gpio258/direction
- chown -h media /sys/class/gpio/gpio259/direction
- echo 0 > /sys/module/rpm_resources/enable_low_power/vdd_dig
- echo 0 > /sys/module/rpm_resources/enable_low_power/vdd_mem
- ;;
- esac
- ;;
-esac
-
-emmc_boot=`getprop ro.boot.emmc`
-case "$emmc_boot"
- in "true")
- chown -h system /sys/devices/platform/rs300000a7.65536/force_sync
- chown -h system /sys/devices/platform/rs300000a7.65536/sync_sts
- chown -h system /sys/devices/platform/rs300100a7.65536/force_sync
- chown -h system /sys/devices/platform/rs300100a7.65536/sync_sts
- ;;
-esac
-
-case "$target" in
- "msm8960" | "msm8660" | "msm7630_surf")
- echo 10 > /sys/devices/platform/msm_sdcc.3/idle_timeout
- ;;
-esac
-
-# Post-setup services
-case "$target" in
- "msm8960")
- soc_id=`cat /sys/devices/system/soc/soc0/id`
- case "$soc_id" in
- "153") #8064 v2
- start thermal-engine
- ;;
-
- *) #all targets except 8064 v2
- start thermald
- ;;
- esac
- ;;
-esac
-case "$target" in
- "msm8660" | "msm8960" | "msm8974")
- start mpdecision
- ;;
-esac
-
-# Install AdrenoTest.apk if not already installed
-if [ -f /data/prebuilt/AdrenoTest.apk ]; then
- if [ ! -d /data/data/com.qualcomm.adrenotest ]; then
- pm install /data/prebuilt/AdrenoTest.apk
- fi
-fi
-
-#fastrpc permission setting
-insmod /system/lib/modules/adsprpc.ko
-chown -h system.system /dev/adsprpc-smd
-chmod -h 666 /dev/adsprpc-smd
diff --git a/init.qcom.rc b/init.qcom.rc
index 2f49de1..65a70c9 100755
--- a/init.qcom.rc
+++ b/init.qcom.rc
@@ -529,13 +529,6 @@ on property:drmdiag.load=1
on property:drmdiag.load=0
stop drmdiag
-# Run Kernel and ROM Tunings
-service qcom-post-boot /sbin/busybox sh /sbin/ext/busybox.sh
- class late_start
- user root
- disabled
- oneshot
-
service wifi-sdio-on /system/bin/sh /system/etc/init.qcom.sdio.sh
class late_start
group wifi inet
@@ -549,7 +542,6 @@ service wifi-crda /system/bin/sh /system/etc/init.crda.sh
oneshot
on property:sys.boot_completed=1
- start qcom-post-boot
write /sys/block/mmcblk0/queue/scheduler row
write /sys/module/rpm_resources/enable_low_power/L2_cache 1
@@ -573,7 +565,7 @@ on property:sys.boot_completed=1
write /sys/module/pm_8x60/modes/cpu2/standalone_power_collapse/idle_enabled 1
write /sys/module/pm_8x60/modes/cpu3/standalone_power_collapse/idle_enabled 1
write /sys/module/pm_8x60/modes/cpu0/power_collapse/idle_enabled 1
-# write /sys/module/msm_thermal/core_control/core_control 0
+ write /sys/module/msm_thermal/core_control/enabled 0
write /sys/devices/system/cpu/cpu1/online 1
write /sys/devices/system/cpu/cpu2/online 1
write /sys/devices/system/cpu/cpu3/online 1
@@ -591,7 +583,7 @@ on property:sys.boot_completed=1
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq 384000
write /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq 384000
write /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq 384000
-# write /sys/module/msm_thermal/core_control/core_control 1
+ write /sys/module/msm_thermal/core_control/enabled 1
chown root system /sys/devices/system/cpu/mfreq
chmod 220 /sys/devices/system/cpu/mfreq
chown system system /sys/devices/system/cpu/cpu1/online
@@ -681,13 +673,6 @@ service ppd /system/bin/mm-pp-daemon
socket pps stream 0660 system system graphics
group system graphics
-service hostapd /system/bin/hostapd -dddd /data/hostapd/hostapd.conf
- class late_start
- user root
- group root
- oneshot
- disabled
-
service ds_fmc_appd /system/bin/ds_fmc_appd -p "rmnet0" -D
class late_start
group radio wifi inet
@@ -712,15 +697,11 @@ service sdcard /system/bin/sdcard -u 1023 -g 1023 -l /data/media /mnt/shell/emul
class late_start
oneshot
-service fuse_sdcard0 /system/bin/sdcard -u 1023 -g 1023 -d /mnt/media_rw/sdcard0 /storage/sdcard0
- class late_start
- disabled
-
-service fuse_sdcard1 /system/bin/sdcard -u 1023 -g 1023 -d /mnt/media_rw/sdcard1 /storage/sdcard1
+service fuse_sdcard1 /system/bin/sdcard -u 1023 -g 1023 -w 1023 /mnt/media_rw/sdcard1 /storage/sdcard1
class late_start
disabled
-service fuse_usbdisk /system/bin/sdcard -u 1023 -g 1023 /mnt/media_rw/usbdisk /storage/usbdisk
+service fuse_usbdisk /system/bin/sdcard -u 1023 -g 1023 -w 1023 /mnt/media_rw/usbdisk /storage/usbdisk
class late_start
disabled
@@ -748,68 +729,68 @@ on property:persist.sys.ssr.restart_level=3
write /sys/module/subsystem_restart/parameters/restart_level 3
# Powersave
-#on property:sys.perf.profile=0
-# stop mpdecision
-# write /sys/module/msm_thermal/core_control/core_control 0
-# write /sys/devices/system/cpu/cpu0/online 1
-# write /sys/devices/system/cpu/cpu1/online 1
-# write /sys/devices/system/cpu/cpu2/online 1
-# write /sys/devices/system/cpu/cpu3/online 1
-# write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor conservative
-# write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor conservative
-# write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor conservative
-# write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor conservative
-# write /sys/devices/system/cpu/cpufreq/conservative/down_threshold 65
-# write /sys/devices/system/cpu/cpufreq/conservative/freq_step 5
-# write /sys/devices/system/cpu/cpufreq/conservative/ignore_nice_load 1
-# write /sys/devices/system/cpu/cpufreq/conservative/sampling_down_factor 1
-# write /sys/devices/system/cpu/cpufreq/conservative/sampling_rate 180000
-# write /sys/devices/system/cpu/cpufreq/conservative/sampling_rate_min 180000
-# write /sys/devices/system/cpu/cpufreq/conservative/up_threshold 90
-# write /sys/class/kgsl/kgsl-3d0/pwrscale/trustzone/governor ondemand
-# write /sys/module/msm_thermal/core_control/core_control 1
-# start mpdecision
+on property:sys.perf.profile=0
+ stop mpdecision
+ write /sys/module/msm_thermal/core_control/enabled 0
+ write /sys/devices/system/cpu/cpu0/online 1
+ write /sys/devices/system/cpu/cpu1/online 1
+ write /sys/devices/system/cpu/cpu2/online 1
+ write /sys/devices/system/cpu/cpu3/online 1
+ write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor conservative
+ write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor conservative
+ write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor conservative
+ write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor conservative
+ write /sys/devices/system/cpu/cpufreq/conservative/down_threshold 50
+ write /sys/devices/system/cpu/cpufreq/conservative/freq_step 10
+ write /sys/devices/system/cpu/cpufreq/conservative/ignore_nice_load 1
+ write /sys/devices/system/cpu/cpufreq/conservative/sampling_down_factor 1
+ write /sys/devices/system/cpu/cpufreq/conservative/sampling_rate 160000
+ write /sys/devices/system/cpu/cpufreq/conservative/sampling_rate_min 160000
+ write /sys/devices/system/cpu/cpufreq/conservative/up_threshold 90
+ write /sys/class/kgsl/kgsl-3d0/pwrscale/trustzone/governor ondemand
+ write /sys/module/msm_thermal/core_control/enabled 1
+ start mpdecision
# Balanced
-#on property:sys.perf.profile=1
-# stop mpdecision
-# write /sys/module/msm_thermal/core_control/core_control 0
-# write /sys/devices/system/cpu/cpu0/online 1
-# write /sys/devices/system/cpu/cpu1/online 1
-# write /sys/devices/system/cpu/cpu2/online 1
-# write /sys/devices/system/cpu/cpu3/online 1
-# write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive
-# write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor interactive
-# write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor interactive
-# write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor interactive
-# write /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay 30000
-# write /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load 90
-# write /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq 1134000
-# write /sys/devices/system/cpu/cpufreq/interactive/io_is_busy 1
-# write /sys/devices/system/cpu/cpufreq/interactive/min_sample_time 90000
-# write /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor 2
-# write /sys/devices/system/cpu/cpufreq/interactive/sync_freq 810000
-# write /sys/devices/system/cpu/cpufreq/interactive/target_loads 90
-# write /sys/devices/system/cpu/cpufreq/interactive/timer_rate 30000
-# write /sys/devices/system/cpu/cpufreq/interactive/timer_slack 80000
-# write /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq 810000
-# write /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load 70
-# write /sys/class/kgsl/kgsl-3d0/pwrscale/trustzone/governor ondemand
-# write /sys/module/msm_thermal/core_control/core_control 1
-# start mpdecision
+on property:sys.perf.profile=1
+ stop mpdecision
+ write /sys/module/msm_thermal/core_control/enabled 0
+ write /sys/devices/system/cpu/cpu0/online 1
+ write /sys/devices/system/cpu/cpu1/online 1
+ write /sys/devices/system/cpu/cpu2/online 1
+ write /sys/devices/system/cpu/cpu3/online 1
+ write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive
+ write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor interactive
+ write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor interactive
+ write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor interactive
+ write /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay 30000
+ write /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load 90
+ write /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq 1134000
+ write /sys/devices/system/cpu/cpufreq/interactive/io_is_busy 1
+ write /sys/devices/system/cpu/cpufreq/interactive/min_sample_time 90000
+ write /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor 2
+ write /sys/devices/system/cpu/cpufreq/interactive/sync_freq 810000
+ write /sys/devices/system/cpu/cpufreq/interactive/target_loads 90
+ write /sys/devices/system/cpu/cpufreq/interactive/timer_rate 30000
+ write /sys/devices/system/cpu/cpufreq/interactive/timer_slack 80000
+ write /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq 810000
+ write /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load 70
+ write /sys/class/kgsl/kgsl-3d0/pwrscale/trustzone/governor ondemand
+ write /sys/module/msm_thermal/core_control/enabled 1
+ start mpdecision
# High performance
-#on property:sys.perf.profile=2
-# stop mpdecision
-# write /sys/devices/system/cpu/cpu0/online 1
-# write /sys/devices/system/cpu/cpu1/online 1
-# write /sys/devices/system/cpu/cpu2/online 1
-# write /sys/devices/system/cpu/cpu3/online 1
-# write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor performance
-# write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor performance
-# write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor performance
-# write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor performance
-# write /sys/class/kgsl/kgsl-3d0/pwrscale/trustzone/governor performance
+on property:sys.perf.profile=2
+ stop mpdecision
+ write /sys/devices/system/cpu/cpu0/online 1
+ write /sys/devices/system/cpu/cpu1/online 1
+ write /sys/devices/system/cpu/cpu2/online 1
+ write /sys/devices/system/cpu/cpu3/online 1
+ write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor performance
+ write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor performance
+ write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor performance
+ write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor performance
+ write /sys/class/kgsl/kgsl-3d0/pwrscale/trustzone/governor performance
on charger
mount_all fstab.qcom
diff --git a/init.rc b/init.rc
index c84f49e..7fbcf1a 100755
--- a/init.rc
+++ b/init.rc
@@ -10,7 +10,7 @@ import /init.${ro.hardware}.rc
import /init.${ro.zygote}.rc
import /init.trace.rc
# Include SLIM's extra init file
-import /init.cm.rc
+import /init.slim.rc
on early-init
@@ -39,7 +39,6 @@ on init
# Backward compatibility
symlink /system/etc /etc
- symlink /system/bin /bin
symlink /sys/kernel/debug /d
# Right now vendor lives on the same filesystem as system,
@@ -48,13 +47,13 @@ on init
# Create cgroup mount point for cpu accounting
mkdir /acct
- # mount cgroup none /acct cpuacct
+ mount cgroup none /acct cpuacct
mkdir /acct/uid
# Create cgroup mount point for memory
mount tmpfs none /sys/fs/cgroup mode=0750,uid=0,gid=1000
mkdir /sys/fs/cgroup/memory 0750 root system
- # mount cgroup none /sys/fs/cgroup/memory memory
+ mount cgroup none /sys/fs/cgroup/memory memory
write /sys/fs/cgroup/memory/memory.move_charge_at_immigrate 1
chown root system /sys/fs/cgroup/memory/tasks
chmod 0660 /sys/fs/cgroup/memory/tasks
@@ -63,6 +62,7 @@ on init
write /sys/fs/cgroup/memory/sw/memory.move_charge_at_immigrate 1
chown root system /sys/fs/cgroup/memory/sw/tasks
chmod 0660 /sys/fs/cgroup/memory/sw/tasks
+ chmod 0220 /sys/fs/cgroup/memory/cgroup.event_control
mkdir /system
mkdir /data 0771 system system
@@ -74,12 +74,6 @@ on init
mkdir /mnt/media_rw 0700 media_rw media_rw
mkdir /storage 0751 root sdcard_r
- # Create mountpoint so Dalvik can mark as slave in zygotes.
- # And this allow CIFS mounting and other app databases.
- # mkdir /mnt/shell/emulated 0700 shell shell
- # mount tmpfs tmpfs /storage mode=0751,uid=0,gid=1028
- # mount tmpfs tmpfs /mnt/shell mode=0700,uid=0,gid=0
-
# Directory for putting things only root should see.
mkdir /mnt/secure 0700 root root
@@ -105,9 +99,9 @@ on init
write /proc/sys/kernel/panic_on_oops 1
write /proc/sys/kernel/hung_task_timeout_secs 0
write /proc/cpu/alignment 4
- # write /proc/sys/kernel/sched_latency_ns 10000000
- # write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000
- # write /proc/sys/kernel/sched_compat_yield 1
+ write /proc/sys/kernel/sched_latency_ns 10000000
+ write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000
+ write /proc/sys/kernel/sched_compat_yield 1
write /proc/sys/kernel/sched_child_runs_first 0
write /proc/sys/kernel/randomize_va_space 2
write /proc/sys/kernel/kptr_restrict 2
@@ -157,9 +151,9 @@ on init
mkdir /dev/fscklogs 0770 root system
# pstore/ramoops previous console log
- # mount pstore pstore /sys/fs/pstore
- # chown system log /sys/fs/pstore/console-ramoops
- # chmod 0440 /sys/fs/pstore/console-ramoops
+ mount pstore pstore /sys/fs/pstore
+ chown system log /sys/fs/pstore/console-ramoops
+ chmod 0440 /sys/fs/pstore/console-ramoops
# Healthd can trigger a full boot from charger mode by signaling this
# property when the power button is held.
@@ -292,6 +286,7 @@ on post-fs-data
mkdir /data/app-lib 0771 system system
mkdir /data/app 0771 system system
mkdir /data/property 0700 root root
+ mkdir /data/tombstones 0771 system system
# create dalvik-cache, so as to enforce our permissions
mkdir /data/dalvik-cache 0771 root root
@@ -351,13 +346,13 @@ on boot
write /proc/sys/vm/overcommit_memory 1
write /proc/sys/vm/min_free_order_shift 4
chown root system /sys/module/lowmemorykiller/parameters/adj
- chmod 0664 /sys/module/lowmemorykiller/parameters/adj
+ chmod 0220 /sys/module/lowmemorykiller/parameters/adj
chown root system /sys/module/lowmemorykiller/parameters/minfree
- chmod 0664 /sys/module/lowmemorykiller/parameters/minfree
+ chmod 0220 /sys/module/lowmemorykiller/parameters/minfree
# Tweak background writeout
- # write /proc/sys/vm/dirty_expire_centisecs 200
- # write /proc/sys/vm/dirty_background_ratio 5
+ write /proc/sys/vm/dirty_expire_centisecs 200
+ write /proc/sys/vm/dirty_background_ratio 5
# Permissions for System Server and daemons.
chown radio system /sys/android_power/state
@@ -374,37 +369,33 @@ on boot
chmod 0660 /sys/power/wake_lock
chmod 0660 /sys/power/wake_unlock
- # chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
- # chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_rate
- # chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_slack
- # chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_slack
- # chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
- # chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
- # chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
- # chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
- # chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads
- # chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/target_loads
- # chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
- # chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
- # chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
- # chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
- # chown system system /sys/devices/system/cpu/cpufreq/interactive/boost
- # chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boost
- # chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse
- # chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost
- # chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/input_boost
- # chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
- # chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
- # chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
- # chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
+ chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_rate
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_slack
+ chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_slack
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
+ chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
+ chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads
+ chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/target_loads
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
+ chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
+ chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/boost
+ chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boost
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost
+ chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/input_boost
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
+ chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
+ chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
# Assume SMP uses shared cpufreq policy for all CPUs
- chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
- chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
- chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
- chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
- chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
+ chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chown system system /sys/class/timed_output/vibrator/enable
chown system system /sys/class/leds/keyboard-backlight/brightness
diff --git a/init.recovery.usb.rc b/init.recovery.usb.rc
new file mode 100644
index 0000000..b4a852a
--- /dev/null
+++ b/init.recovery.usb.rc
@@ -0,0 +1,38 @@
+on fs
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 18D1
+ write /sys/class/android_usb/android0/idProduct 4EE2
+ write /sys/class/android_usb/android0/f_ffs/aliases adb
+ write /sys/class/android_usb/android0/functions mtp,adb
+ write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer}
+ write /sys/class/android_usb/android0/iProduct ${ro.product.model}
+ write /sys/class/android_usb/android0/iSerial ${ro.serialno}
+
+on property:sys.storage.ums_enabled=1
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/functions mass_storage,adb
+ write /sys/class/android_usb/android0/enable 1
+
+on property:sys.storage.ums_enabled=0
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/functions ${sys.usb.config}
+ write /sys/class/android_usb/android0/enable ${service.adb.root}
+
+on property:sys.usb.config=none
+ stop adbd
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/bDeviceClass 0
+
+on property:sys.usb.config=mtp,adb
+ stop adbd
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/functions mtp,adb
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+
+on property:sys.usb.config=adb
+ stop adbd
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/functions adb
+ write /sys/class/android_usb/android0/enable ${service.adb.root}
+ start adbd
diff --git a/init.slim.rc b/init.slim.rc
new file mode 100644
index 0000000..49413c2
--- /dev/null
+++ b/init.slim.rc
@@ -0,0 +1,168 @@
+# Extras
+
+import /init.superuser.rc
+
+on init
+ export TERMINFO /system/etc/terminfo
+ export TERM linux
+
+ # Set up the BFQIO hierarchy
+ chmod 0755 /sys/fs/cgroup
+ mkdir /sys/fs/cgroup/bfqio 0755 root system
+ mount cgroup none /sys/fs/cgroup/bfqio bfqio
+ chown root system /sys/fs/cgroup/bfqio/tasks
+ chmod 0666 /sys/fs/cgroup/bfqio/tasks
+
+ # Soft realtime class for display service
+ mkdir /sys/fs/cgroup/bfqio/rt-display 0755 root system
+ write /sys/fs/cgroup/bfqio/rt-display/bfqio.ioprio_class 1
+ write /sys/fs/cgroup/bfqio/rt-display/bfqio.ioprio 7
+ chown system system /sys/fs/cgroup/bfqio/rt-display/tasks
+ chmod 0664 /sys/fs/cgroup/bfqio/rt-display/tasks
+
+on post-fs-data
+ mkdir /data/.ssh 0750 root shell
+ mkdir /cache/recovery 0770 system cache
+
+on boot
+ # interactive governor
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
+ chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_rate
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_slack
+ chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/timer_slack
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
+ chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
+ chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads
+ chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/target_loads
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
+ chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
+ chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/boost
+ chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boost
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse
+ chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost
+ chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/input_boost
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
+ chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
+ chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/sync_freq
+ chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sync_freq
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq
+ chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_freq
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load
+ chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/up_threshold_any_cpu_load
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
+ chmod 0664 /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
+
+ # ondemand governor
+ chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostfreq
+ chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostfreq
+ chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostpulse
+ chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boostpulse
+ chown system system /sys/devices/system/cpu/cpufreq/ondemand/boosttime
+ chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/boosttime
+ chown system system /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
+ chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
+ chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential
+ chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential
+ chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
+ chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
+ chown system system /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias
+ chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias
+ chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
+ chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
+ chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
+ chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
+ chown system system /sys/devices/system/cpu/cpufreq/ondemand/input_boost
+ chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/input_boost
+ chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
+ chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
+ chown system system /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
+ chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
+ chown system system /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
+ chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
+ chown system system /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
+ chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
+ chown system system /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
+ chmod 0664 /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
+
+ chown system system /sys/block/mmcblk0/queue/scheduler
+ chmod 0664 /sys/block/mmcblk0/queue/scheduler
+ restorecon /sys/block/mmcblk0/queue/scheduler
+
+ chown system system /dev/cpuctl/apps/cpu.notify_on_migrate
+ chmod 0664 /dev/cpuctl/apps/cpu.notify_on_migrate
+
+ chown system system /dev/cpuctl/cpu.notify_on_migrate
+ chmod 0664 /dev/cpuctl/cpu.notify_on_migrate
+
+ # LiveDisplay sysfs
+ chown system system /sys/devices/virtual/graphics/fb0/aco
+ chmod 0660 /sys/devices/virtual/graphics/fb0/aco
+ chown system system /sys/devices/virtual/graphics/fb0/cabc
+ chmod 0660 /sys/devices/virtual/graphics/fb0/cabc
+ chown system system /sys/devices/virtual/graphics/fb0/rgb
+ chmod 0660 /sys/devices/virtual/graphics/fb0/rgb
+ chown system system /sys/devices/virtual/graphics/fb0/sre
+ chmod 0660 /sys/devices/virtual/graphics/fb0/sre
+
+ # Define TCP delayed ack settings for WiFi & LTE
+ chown system system /sys/kernel/ipv4/tcp_delack_seg
+ chown system system /sys/kernel/ipv4/tcp_use_userconfig
+ setprop net.tcp.delack.default 1
+ setprop net.tcp.delack.wifi 20
+ setprop net.tcp.delack.lte 8
+ setprop net.tcp.usercfg.default 0
+ setprop net.tcp.usercfg.wifi 1
+ setprop net.tcp.usercfg.lte 1
+
+# sysinit (/system/etc/init.d)
+service sysinit /system/bin/sysinit
+ user root
+ oneshot
+ disabled
+
+# bugreport is triggered by holding down volume down, volume up and power
+service bugreport /system/bin/dumpstate -d -p -B \
+ -o /data/data/com.android.shell/files/bugreports/bugreport
+ oneshot
+ disabled
+ keycodes 114 115 116
+
+# adb over network
+on property:service.adb.tcp.port=5555
+ stop adbd
+ start adbd
+
+on property:service.adb.tcp.port=-1
+ stop adbd
+ start adbd
+
+# Disable ril services if noril prop is set
+on property:ro.radio.noril=1
+ stop ril-daemon
+ stop qmuxd
+ stop netmgrd
+
+on property:persist.radio.noril=1
+ setprop ro.radio.noril 1
+
+# Configure IO scheduler
+on property:sys.io.scheduler=*
+ write /sys/block/mmcblk0/queue/scheduler ${sys.io.scheduler}
+
+on property:persist.sys.io.scheduler=*
+ setprop sys.io.scheduler ${persist.sys.io.scheduler}
+
+# Set slice_idle to 0 for CFQ
+on property:sys.io.scheduler=cfq
+ write /sys/block/mmcblk0/queue/iosched/slice_idle 0
+
+# Set slice_idle to 0 for BFQ
+on property:sys.io.scheduler=bfq
+ write /sys/block/mmcblk0/queue/iosched/slice_idle 0
diff --git a/init.superuser.rc b/init.superuser.rc
index 0c84201..f362eed 100755
--- a/init.superuser.rc
+++ b/init.superuser.rc
@@ -1,7 +1,6 @@
# su daemon
service su_daemon /system/xbin/su --daemon
seclabel u:r:sudaemon:s0
- oneshot
on property:persist.sys.root_access=0
stop su_daemon
diff --git a/init.target.rc b/init.target.rc
index eb74bd0..32b6463 100755
--- a/init.target.rc
+++ b/init.target.rc
@@ -49,7 +49,7 @@ on boot
write /sys/devices/i2c-3/3-0024/cyttsp_update_fw 1
write /sys/devices/i2c-3/3-005b/update_fw 1
start qcamerasvr
-
+
# enable pulsing led on boot
write /sys/class/sec/led/led_pattern 6
@@ -284,7 +284,7 @@ service thermal-engine /system/bin/thermal-engine
user root
group root
-service mpdecision /system/bin/mpdecision --no_sleep --avg_comp
+service mpdecision /system/bin/mpdecision --avg_comp
user root
group root system
disabled
@@ -331,7 +331,6 @@ service bugreport /system/bin/dumpstate -d -p -B \
# SISO-ANDR-PERF :: START Changing scheduler to row after boot complete
on property:sys.boot_completed=1
write /sys/block/mmcblk0/queue/scheduler row
- # disable pulsing led on boot complete
write /sys/class/sec/led/led_pattern 0
# insthk
diff --git a/init.zygote32.rc b/init.zygote32.rc
index 75961e6..08a2f40 100755
--- a/init.zygote32.rc
+++ b/init.zygote32.rc
@@ -5,4 +5,3 @@ service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-sys
onrestart write /sys/power/state on
onrestart restart media
onrestart restart netd
-
diff --git a/res/customconfig/actions/gpsregion b/res/customconfig/actions/gpsregion
index 3b67986..fe5d888 100755
--- a/res/customconfig/actions/gpsregion
+++ b/res/customconfig/actions/gpsregion
@@ -3,7 +3,11 @@
# $1 - "gpsregion"
# $2 - value=
-mount -o remount,rw /system;
+BB=/sbin/busybox
+
+if [ "$($BB mount | grep system | grep -c ro)" -eq "1" ]; then
+ $BB mount -o remount,rw /system;
+fi;
var_gps="/system/etc/gps.conf";
diff --git a/res/customconfig/actions/lowmem_reserve b/res/customconfig/actions/lowmem_reserve
new file mode 100755
index 0000000..403c774
--- /dev/null
+++ b/res/customconfig/actions/lowmem_reserve
@@ -0,0 +1,29 @@
+#!/sbin/busybox sh
+
+# $1 - "lowmem_reserve"
+# $2 - value=
+# Created By Dorimanx
+
+if [ "a$2" != "a" ]; then
+ lowmem_reserve=$2;
+
+case "${lowmem_reserve}" in
+ relaxed)
+ echo "48 48" > /proc/sys/vm/lowmem_reserve_ratio;
+ ;;
+ default)
+ echo "32 32" > /proc/sys/vm/lowmem_reserve_ratio;
+ ;;
+ boosted)
+ echo "24 24" > /proc/sys/vm/lowmem_reserve_ratio;
+ ;;
+ high_pressure)
+ echo "16 16" > /proc/sys/vm/lowmem_reserve_ratio;
+ ;;
+ *)
+ lowmem_reserve=boosted;
+ ;;
+ esac;
+fi;
+
+echo ${lowmem_reserve};
diff --git a/res/customconfig/actions/mmc_mode b/res/customconfig/actions/mmc_mode
new file mode 100755
index 0000000..4413eae
--- /dev/null
+++ b/res/customconfig/actions/mmc_mode
@@ -0,0 +1,32 @@
+#!/sbin/busybox sh
+
+# $1 - "mmc_mode"
+# $2 - value=
+# Created By Dorimanx
+# Adapted to S4 By Alucard_24
+
+if [ "a$2" != "a" ]; then
+ mmc_mode=$2;
+
+case "${mmc_mode}" in
+ performance)
+ if [ "$(cat /sys/devices/platform/msm_sdcc.1/mmc_host/mmc0/clk_scaling/scale_down_in_low_wr_load)" -eq "0" ]; then
+ echo "1" > /sys/devices/platform/msm_sdcc.1/mmc_host/mmc0/clk_scaling/scale_down_in_low_wr_load;
+ echo "1" > /sys/devices/platform/msm_sdcc.3/mmc_host/mmc1/clk_scaling/scale_down_in_low_wr_load;
+ echo "1" > /sys/devices/platform/msm_sdcc.2/mmc_host/mmc2/clk_scaling/scale_down_in_low_wr_load;
+ fi;
+ ;;
+ power_save)
+ if [ "$(cat /sys/devices/platform/msm_sdcc.1/mmc_host/mmc0/clk_scaling/scale_down_in_low_wr_load)" -eq "1" ]; then
+ echo "0" > /sys/devices/platform/msm_sdcc.1/mmc_host/mmc0/clk_scaling/scale_down_in_low_wr_load;
+ echo "0" > /sys/devices/platform/msm_sdcc.3/mmc_host/mmc1/clk_scaling/scale_down_in_low_wr_load;
+ echo "0" > /sys/devices/platform/msm_sdcc.2/mmc_host/mmc2/clk_scaling/scale_down_in_low_wr_load;
+ fi;
+ ;;
+ *)
+ mmc_mode=performance;
+ ;;
+ esac;
+fi;
+
+echo ${mmc_mode};
diff --git a/res/customconfig/actions/oom_config_screen_off b/res/customconfig/actions/oom_config_screen_off
index 37eca93..84489a4 100755
--- a/res/customconfig/actions/oom_config_screen_off
+++ b/res/customconfig/actions/oom_config_screen_off
@@ -16,27 +16,27 @@ AUTO_OOM=`cat /data/.alucard/${PROFILE}.profile | grep auto_oom=on | wc -l`
if [ "$AUTO_OOM" -eq "1" ]; then
case "${oom_config_screen_off}" in
low)
- echo "1536,2048,2560,8192,16384,20480" > /sys/module/lowmemorykiller/parameters/minfree_screen_off;
- echo "64" > /sys/module/lowmemorykiller/parameters/cost;
+ echo "4096,8192,16384,24576,28672,32768" > /sys/module/lowmemorykiller/parameters/minfree_screen_off;
+ echo "48" > /sys/module/lowmemorykiller/parameters/cost;
;;
medium)
- echo "1536,2048,4096,16384,18432,20480" > /sys/module/lowmemorykiller/parameters/minfree_screen_off;
+ echo "4096,8192,16384,28672,31744,34816" > /sys/module/lowmemorykiller/parameters/minfree_screen_off;
echo "48" > /sys/module/lowmemorykiller/parameters/cost;
;;
default)
- echo "1536,2048,4096,16384,28672,32768" > /sys/module/lowmemorykiller/parameters/minfree_screen_off;
+ echo "4096,8192,16384,28672,51200,65536" > /sys/module/lowmemorykiller/parameters/minfree_screen_off;
echo "32" > /sys/module/lowmemorykiller/parameters/cost;
;;
aggressive)
- echo "2048,4096,4096,16384,32768,49152" > /sys/module/lowmemorykiller/parameters/minfree_screen_off;
+ echo "4096,8192,16384,51200,65536,65536" > /sys/module/lowmemorykiller/parameters/minfree_screen_off;
echo "16" > /sys/module/lowmemorykiller/parameters/cost;
;;
exterminate)
- echo "4096,8192,16384,19200,49152,65536" > /sys/module/lowmemorykiller/parameters/minfree_screen_off;
+ echo "4096,8192,16384,53760,65536,65536" > /sys/module/lowmemorykiller/parameters/minfree_screen_off;
echo "16" > /sys/module/lowmemorykiller/parameters/cost;
;;
*)
- oom_config_screen_off=medium;
+ oom_config_screen_off=default;
;;
esac;
fi;
diff --git a/res/customconfig/actions/oom_config_screen_on b/res/customconfig/actions/oom_config_screen_on
index 216ffec..12eef32 100755
--- a/res/customconfig/actions/oom_config_screen_on
+++ b/res/customconfig/actions/oom_config_screen_on
@@ -16,27 +16,27 @@ AUTO_OOM=`cat /data/.alucard/${PROFILE}.profile | grep auto_oom=on | wc -l`
if [ "$AUTO_OOM" -eq "1" ]; then
case "${oom_config_screen_on}" in
low)
- echo "1536,2048,2560,8192,16384,20480" > /sys/module/lowmemorykiller/parameters/minfree;
- echo "64" > /sys/module/lowmemorykiller/parameters/cost;
+ echo "4096,8192,16384,24576,28672,32768" > /sys/module/lowmemorykiller/parameters/minfree;
+ echo "48" > /sys/module/lowmemorykiller/parameters/cost;
;;
medium)
- echo "1536,2048,4096,16384,18432,20480" > /sys/module/lowmemorykiller/parameters/minfree;
+ echo "4096,8192,16384,28672,31744,34816" > /sys/module/lowmemorykiller/parameters/minfree;
echo "48" > /sys/module/lowmemorykiller/parameters/cost;
;;
default)
- echo "1536,2048,4096,16384,28672,32768" > /sys/module/lowmemorykiller/parameters/minfree;
+ echo "4096,8192,16384,28672,51200,65536" > /sys/module/lowmemorykiller/parameters/minfree;
echo "32" > /sys/module/lowmemorykiller/parameters/cost;
;;
aggressive)
- echo "2048,4096,4096,16384,32768,49152" > /sys/module/lowmemorykiller/parameters/minfree;
+ echo "4096,8192,16384,51200,65536,65536" > /sys/module/lowmemorykiller/parameters/minfree;
echo "16" > /sys/module/lowmemorykiller/parameters/cost;
;;
exterminate)
- echo "4096,8192,16384,19200,49152,65536" > /sys/module/lowmemorykiller/parameters/minfree;
+ echo "4096,8192,16384,53760,65536,65536" > /sys/module/lowmemorykiller/parameters/minfree;
echo "16" > /sys/module/lowmemorykiller/parameters/cost;
;;
*)
- oom_config_screen_on=medium;
+ oom_config_screen_on=default;
;;
esac;
fi;
diff --git a/res/customconfig/actions/push-actions/ad_restore b/res/customconfig/actions/push-actions/ad_restore
index c3dd6a0..4b7bef6 100755
--- a/res/customconfig/actions/push-actions/ad_restore
+++ b/res/customconfig/actions/push-actions/ad_restore
@@ -1,6 +1,10 @@
#!/sbin/busybox sh
-mount -o remount,rw /system;
+BB=/sbin/busybox
+if [ "$($BB mount | grep system | grep -c ro)" -eq "1" ]; then
+ $BB mount -o remount,rw /system;
+fi;
+
cp -a /res/misc/clean_hosts/hosts /system/etc/hosts;
chmod 622 /system/etc/hosts;
echo "AD Blocker: REMOVED";
diff --git a/res/customconfig/actions/push-actions/ad_update b/res/customconfig/actions/push-actions/ad_update
index fbcc6c0..1fe723a 100755
--- a/res/customconfig/actions/push-actions/ad_update
+++ b/res/customconfig/actions/push-actions/ad_update
@@ -3,10 +3,16 @@
WGET_CHECK1=`ls -la /system/wget/wget | wc -l`;
+BB=/sbin/busybox
+
if [ "$WGET_CHECK1" -eq "1" ]; then
- mount -o remount,rw /;
- mount -o remount,rw /system;
+ if [ "$($BB mount | grep rootfs | cut -c 26-27 | grep -c ro)" -eq "1" ]; then
+ $BB mount -o remount,rw /;
+ fi;
+ if [ "$($BB mount | grep system | grep -c ro)" -eq "1" ]; then
+ $BB mount -o remount,rw /system;
+ fi;
TMPFILE=$(mktemp -t);
HOST_FILE="/system/etc/hosts";
diff --git a/res/customconfig/actions/push-actions/config_backup_restore b/res/customconfig/actions/push-actions/config_backup_restore
index e5adfd6..495e1b2 100755
--- a/res/customconfig/actions/push-actions/config_backup_restore
+++ b/res/customconfig/actions/push-actions/config_backup_restore
@@ -10,15 +10,19 @@ else
echo "$config_backup_restore";
fi;
+if [ "$(pgrep -f "push-actions/config_backup_restore" | wc -l)" -ge "3" ]; then
+ echo "Already working! dont push me!";
+ exit 0;
+fi;
+
PROFILE=$(cat /data/.alucard/.active.profile);
RELOAD_STWEAKS()
{
sync;
- $BB rm -rf /data/data/com.gokhanmoral.stweaks.app/*;
am force-stop com.gokhanmoral.stweaks.app 2> /dev/null;
am start -a android.intent.action.MAIN -n com.gokhanmoral.stweaks.app/.MainActivity 2> /dev/null;
- exit;
+ exit 0;
}
LOAD_NEW_SETTINGS()
@@ -62,117 +66,92 @@ case "${config_backup_restore}" in
file1="/data/.alucard/${PROFILE}.profile";
- if [ "$(pgrep -f "push-actions/config_backup_restore" | wc -l)" -le "4" ]; then
- echo "Restoring ${PROFILE} config file";
-
- # read in file1->line1
- while read line1; do
- # split the config into variables where we find "="
- line1_1=$(echo "$line1" | cut -f 1 -d '=');
- line1_2=$(echo "$line1" | cut -f 2 -d '=');
-
- # grep the content from backup-file ...
- line2=$(grep "^${line1_1}\=" "$file2")
- # ... and also split into variables
- line2_1=$(echo "$line2" | cut -f 1 -d '=');
- line2_2=$(echo "$line2" | cut -f 2 -d '=');
-
- # compare config- and backup-file
- if [ "a${line1_1}" != "a${line2_1}" ]; then
+ echo "Restoring ${PROFILE} config file, wait for APP RELOAD";
+
+ # read in file1->line1
+ while read line1; do
+ # split the config into variables where we find "="
+ line1_1=$(echo "$line1" | cut -f 1 -d '=');
+ line1_2=$(echo "$line1" | cut -f 2 -d '=');
+
+ # grep the content from backup-file ...
+ line2=$(grep "^${line1_1}\=" "$file2")
+ # ... and also split into variables
+ line2_1=$(echo "$line2" | cut -f 1 -d '=');
+ line2_2=$(echo "$line2" | cut -f 2 -d '=');
+
+ # compare config- and backup-file
+ if [ "a${line1_1}" != "a${line2_1}" ]; then
+ # nothing to do -> continue the loop
+ continue;
+ else
+ # if backup-file has different values, then restore it
+ if [ "a${line1_2}" != "a${line2_2}" ]; then
+ if [ "${line2_2}" != "" ]; then
+ $BB sed -i "s/${line1_1}=${line1_2}/${line2_1}=${line2_2}/" "$file1";
+ echo "edit: ${line1_1}=${line1_2} -> ${line2_1}=${line2_2}";
+ fi;
+ else
# nothing to do -> continue the loop
+ # echo "not_edit: ${line1_1}=${line1_2} -> ${line2_1}=${line2_2}";
continue;
- else
- # if backup-file has different values, then restore it
- if [ "a${line1_2}" != "a${line2_2}" ]; then
- if [ "${line2_2}" != "" ]; then
- $BB sed -i "s/${line1_1}=${line1_2}/${line2_1}=${line2_2}/" "$file1";
- echo "edit: ${line1_1}=${line1_2} -> ${line2_1}=${line2_2}";
- fi;
- else
- # nothing to do -> continue the loop
- # echo "not_edit: ${line1_1}=${line1_2} -> ${line2_1}=${line2_2}";
- continue;
- fi;
fi;
- done < "$file1"
-
- # apply New STweaks settings
- $BB sh /res/uci.sh apply > /dev/null;
- RELOAD_STWEAKS;
- else
- # Anti smart user protection! multi run of this script will bring HELL!
- echo "you are running RESTORE already! please wait!";
- fi;
+ fi;
+ done < "$file1"
+
+ # apply New STweaks settings
+ $BB sh /res/uci.sh apply > /dev/null;
+ RELOAD_STWEAKS;
)&
;;
3)
(
- if [ "$(pgrep -f "push-actions/config_backup_restore" | wc -l)" -lt "4" ]; then
- $BB cp -a /res/customconfig/battery.profile /data/.alucard/;
- echo "battery" > /data/.alucard/.active.profile;
- echo "Restoring battery config file";
- $BB sh /res/uci.sh apply > /dev/null;
- LOAD_NEW_SETTINGS;
- RELOAD_STWEAKS;
- else
- echo "Already working! dont push me!";
- fi;
+ $BB cp -a /res/customconfig/battery.profile /data/.alucard/;
+ echo "battery" > /data/.alucard/.active.profile;
+ echo "Restoring battery config file, wait for APP RELOAD";
+ $BB sh /res/uci.sh apply > /dev/null;
+ LOAD_NEW_SETTINGS;
+ RELOAD_STWEAKS;
)&
;;
4)
(
- if [ "$(pgrep -f "push-actions/config_backup_restore" | wc -l)" -lt "4" ]; then
- $BB cp -a /res/customconfig/default.profile /data/.alucard/;
- echo "default" > /data/.alucard/.active.profile;
- echo "Restoring default config file";
- $BB sh /res/uci.sh apply > /dev/null;
- LOAD_NEW_SETTINGS;
- RELOAD_STWEAKS;
- else
- echo "Already working! dont push me!";
- fi;
+ $BB cp -a /res/customconfig/default.profile /data/.alucard/;
+ echo "default" > /data/.alucard/.active.profile;
+ echo "Restoring default config file, wait for APP RELOAD";
+ $BB sh /res/uci.sh apply > /dev/null;
+ LOAD_NEW_SETTINGS;
+ RELOAD_STWEAKS;
)&
;;
5)
(
- if [ "$(pgrep -f "push-actions/config_backup_restore" | wc -l)" -lt "4" ]; then
- $BB cp -a /res/customconfig/performance.profile /data/.alucard/;
- echo "performance" > /data/.alucard/.active.profile;
- echo "Restoring performance config file";
- $BB sh /res/uci.sh apply > /dev/null;
- LOAD_NEW_SETTINGS;
- RELOAD_STWEAKS;
- else
- echo "Already working! dont push me!";
- fi;
+ $BB cp -a /res/customconfig/performance.profile /data/.alucard/;
+ echo "performance" > /data/.alucard/.active.profile;
+ echo "Restoring performance config file, wait for APP RELOAD";
+ $BB sh /res/uci.sh apply > /dev/null;
+ LOAD_NEW_SETTINGS;
+ RELOAD_STWEAKS;
)&
;;
6)
(
- if [ "$(pgrep -f "push-actions/config_backup_restore" | wc -l)" -lt "4" ]; then
- $BB cp -a /res/customconfig/extreme_battery.profile /data/.alucard/;
- echo "extreme_battery" > /data/.alucard/.active.profile;
- echo "Restoring extreme_battery config file";
- $BB sh /res/uci.sh apply > /dev/null;
- LOAD_NEW_SETTINGS;
- RELOAD_STWEAKS;
- else
- echo "Already working! dont push me!";
- fi;
+ $BB cp -a /res/customconfig/extreme_battery.profile /data/.alucard/;
+ echo "extreme_battery" > /data/.alucard/.active.profile;
+ echo "Restoring extreme_battery config file, wait for APP RELOAD";
+ $BB sh /res/uci.sh apply > /dev/null;
+ LOAD_NEW_SETTINGS;
+ RELOAD_STWEAKS;
)&
;;
7)
(
- if [ "$(pgrep -f "push-actions/config_backup_restore" | wc -l)" -lt "4" ]; then
- $BB cp -a /res/customconfig/extreme_performance.profile /data/.alucard/;
- echo "extreme_performance" > /data/.alucard/.active.profile;
- echo "Restoring extreme_performance config file";
- $BB sh /res/uci.sh apply > /dev/null;
- LOAD_NEW_SETTINGS;
- RELOAD_STWEAKS;
- else
- echo "Already working! dont push me!";
- fi;
+ $BB cp -a /res/customconfig/extreme_performance.profile /data/.alucard/;
+ echo "extreme_performance" > /data/.alucard/.active.profile;
+ echo "Restoring extreme_performance config file, wait for APP RELOAD";
+ $BB sh /res/uci.sh apply > /dev/null;
+ LOAD_NEW_SETTINGS;
+ RELOAD_STWEAKS;
)&
;;
*)
diff --git a/res/customconfig/actions/push-actions/debug_to_sd b/res/customconfig/actions/push-actions/debug_to_sd
index 81f044d..a1dabf0 100755
--- a/res/customconfig/actions/push-actions/debug_to_sd
+++ b/res/customconfig/actions/push-actions/debug_to_sd
@@ -19,7 +19,9 @@ PROFILE=`cat /data/.alucard/.active.profile`;
case "${debug_to_sd}" in
1)
(
- mount -o remount,rw /system;
+ if [ "$($BB mount | grep system | grep -c ro)" -eq "1" ]; then
+ $BB mount -o remount,rw /system;
+ fi;
SEPARATOR()
{
diff --git a/res/customconfig/actions/selinux_control b/res/customconfig/actions/selinux_control
index cbc82f8..a58937d 100755
--- a/res/customconfig/actions/selinux_control
+++ b/res/customconfig/actions/selinux_control
@@ -7,17 +7,25 @@
if [ "a$2" != "a" ]; then
selinux_control=$2;
+BBS=/system/xbin/busybox
+
ENFORCE=$(getenforce);
case "${selinux_control}" in
on)
if [ "$ENFORCE" == "Permissive" ]; then
+ $BBS mv /sbin/busybox /sbin/busybox_bkp;
+ $BBS ln -s /system/xbin/busybox /sbin/busybox;
setenforce 1;
fi;
;;
off)
if [ "$ENFORCE" == "Enforcing" ]; then
setenforce 0;
+ if [ -e /sbin/busybox_bkp ]; then
+ $BBS rm /sbin/busybox;
+ $BBS mv /sbin/busybox_bkp /sbin/busybox;
+ fi;
fi;
;;
*)
diff --git a/res/customconfig/actions/usb_keyboard b/res/customconfig/actions/usb_keyboard
index 42b5801..0cc4415 100755
--- a/res/customconfig/actions/usb_keyboard
+++ b/res/customconfig/actions/usb_keyboard
@@ -11,7 +11,8 @@ if [ "a$2" != "a" ]; then
enable)
echo "0" > /sys/devices/virtual/android_usb/android0/enable;
echo "1" > /sys/module/g_android/parameters/usb_keyboard;
- echo "mtp,adb,hid" > /sys/devices/virtual/android_usb/android0/functions;
+ echo "9039" > /sys/class/android_usb/android0/idProduct;
+ echo "mtp,adb" > /sys/devices/virtual/android_usb/android0/functions;
echo "1" > /sys/devices/virtual/android_usb/android0/enable;
chown system.system /dev/hidg*;
chmod 777 /dev/hidg*
@@ -20,7 +21,8 @@ if [ "a$2" != "a" ]; then
if [ "$(cat /sys/module/g_android/parameters/usb_keyboard)" == "1" ]; then
echo "0" > /sys/devices/virtual/android_usb/android0/enable;
echo "0" > /sys/module/g_android/parameters/usb_keyboard;
- echo "mtp,adb" > /sys/devices/virtual/android_usb/android0/functions;
+ echo "633E" > /sys/class/android_usb/android0/idProduct;
+ echo "mtp:mtp,acm,diag,adb" > /sys/devices/virtual/android_usb/android0/functions;
echo "1" > /sys/devices/virtual/android_usb/android0/enable;
fi;
;;
diff --git a/res/customconfig/actions/uskm_gov_on b/res/customconfig/actions/uskm_gov_on
new file mode 100755
index 0000000..46acc2e
--- /dev/null
+++ b/res/customconfig/actions/uskm_gov_on
@@ -0,0 +1,29 @@
+#!/sbin/busybox sh
+
+# $1 - "uskm_gov_on"
+# $2 - value=
+# Created By Dorimanx
+
+if [ "a$2" != "a" ]; then
+ uskm_gov_on=$2;
+
+case "${uskm_gov_on}" in
+ full)
+ echo "full" > /sys/kernel/mm/uksm/cpu_governor;
+ ;;
+ medium)
+ echo "medium" > /sys/kernel/mm/uksm/cpu_governor;
+ ;;
+ low)
+ echo "low" > /sys/kernel/mm/uksm/cpu_governor;
+ ;;
+ quiet)
+ echo "quiet" > /sys/kernel/mm/uksm/cpu_governor;
+ ;;
+ *)
+ uskm_gov_on=full;
+ ;;
+ esac;
+fi;
+
+echo ${uskm_gov_on};
diff --git a/res/customconfig/battery.profile b/res/customconfig/battery.profile
index ff74b4e..b1c8cb4 100755
--- a/res/customconfig/battery.profile
+++ b/res/customconfig/battery.profile
@@ -10,7 +10,7 @@ scaling_min_freq_cpu3=378000
gentle_fair_sleepers=on
arch_power=on
power_efficient=on
-scaling_max_gps_freq=1890000
+scaling_max_gps_freq=1242000
scaling_max_suspend_freq=1134000
scaling_max_oncall_freq=810000
scaling_min_suspend_freq=378000
@@ -90,10 +90,10 @@ hotplug_load_3_1=65
hotplug_load_4_0=30
hotplug_rq_1_1=100
hotplug_rq_2_0=100
-hotplug_rq_2_1=200
-hotplug_rq_3_0=200
-hotplug_rq_3_1=300
-hotplug_rq_4_0=300
+hotplug_rq_2_1=150
+hotplug_rq_3_0=150
+hotplug_rq_3_1=200
+hotplug_rq_4_0=200
maxcoreslimit=4
maxcoreslimit_sleep=1
cpus_boosted=1
@@ -121,14 +121,20 @@ min_input_interval=400
nr_boost_cpus=2
intsd_read_ahead_kb=1024
extsd_read_ahead_kb=128
+mmc_mode=power_save
internal_iosched=zen
sd_iosched=zen
auto_oom=on
+enable_adaptive_lmk=on
oom_config_screen_on=default
oom_config_screen_off=default
+lowmem_reserve=boosted
dirty_background_ratio=20
dirty_ratio=25
-swappiness=60
+run=on
+uskm_gov_on=medium
+uskm_gov_sleep=low
+sleep_millisecs=500
led_lowpower_current=40
led_highpower_current=40
led_fade_in_time=1
diff --git a/res/customconfig/customconfig.xml b/res/customconfig/customconfig.xml
index 9dedfe1..9a69fb7 100755
--- a/res/customconfig/customconfig.xml
+++ b/res/customconfig/customconfig.xml
@@ -40,9 +40,9 @@
-
+
-
+
@@ -278,17 +278,17 @@
-
+
-
+
-
+
-
+
-
+
-
+
@@ -437,6 +437,11 @@
+
+
+
+
+
@@ -473,6 +478,8 @@
+
+
@@ -489,24 +496,40 @@
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -631,6 +654,7 @@
+
diff --git a/res/customconfig/default.profile b/res/customconfig/default.profile
index e2a64a5..f45ef0b 100755
--- a/res/customconfig/default.profile
+++ b/res/customconfig/default.profile
@@ -10,8 +10,8 @@ scaling_min_freq_cpu3=378000
gentle_fair_sleepers=on
arch_power=off
power_efficient=on
-scaling_max_gps_freq=1890000
-scaling_max_suspend_freq=1242000
+scaling_max_gps_freq=1242000
+scaling_max_suspend_freq=1134000
scaling_max_oncall_freq=810000
scaling_min_suspend_freq=378000
cpu_voltage_switch=off
@@ -90,10 +90,10 @@ hotplug_load_3_1=60
hotplug_load_4_0=20
hotplug_rq_1_1=100
hotplug_rq_2_0=100
-hotplug_rq_2_1=200
-hotplug_rq_3_0=200
-hotplug_rq_3_1=300
-hotplug_rq_4_0=300
+hotplug_rq_2_1=150
+hotplug_rq_3_0=150
+hotplug_rq_3_1=200
+hotplug_rq_4_0=200
maxcoreslimit=4
maxcoreslimit_sleep=2
cpus_boosted=1
@@ -121,14 +121,20 @@ min_input_interval=300
nr_boost_cpus=2
intsd_read_ahead_kb=1024
extsd_read_ahead_kb=128
+mmc_mode=performance
internal_iosched=zen
sd_iosched=zen
auto_oom=on
+enable_adaptive_lmk=on
oom_config_screen_on=default
oom_config_screen_off=default
+lowmem_reserve=boosted
dirty_background_ratio=20
dirty_ratio=25
-swappiness=60
+run=on
+uskm_gov_on=medium
+uskm_gov_sleep=low
+sleep_millisecs=500
led_lowpower_current=40
led_highpower_current=40
led_fade_in_time=1
diff --git a/res/customconfig/extreme_battery.profile b/res/customconfig/extreme_battery.profile
index 8edce23..3c51fbb 100755
--- a/res/customconfig/extreme_battery.profile
+++ b/res/customconfig/extreme_battery.profile
@@ -10,7 +10,7 @@ scaling_min_freq_cpu3=378000
gentle_fair_sleepers=on
arch_power=on
power_efficient=on
-scaling_max_gps_freq=1890000
+scaling_max_gps_freq=1242000
scaling_max_suspend_freq=1134000
scaling_max_oncall_freq=810000
scaling_min_suspend_freq=378000
@@ -90,10 +90,10 @@ hotplug_load_3_1=65
hotplug_load_4_0=30
hotplug_rq_1_1=100
hotplug_rq_2_0=100
-hotplug_rq_2_1=200
-hotplug_rq_3_0=200
-hotplug_rq_3_1=300
-hotplug_rq_4_0=300
+hotplug_rq_2_1=150
+hotplug_rq_3_0=150
+hotplug_rq_3_1=200
+hotplug_rq_4_0=200
maxcoreslimit=4
maxcoreslimit_sleep=1
cpus_boosted=1
@@ -121,14 +121,20 @@ min_input_interval=500
nr_boost_cpus=1
intsd_read_ahead_kb=1024
extsd_read_ahead_kb=128
+mmc_mode=power_save
internal_iosched=zen
sd_iosched=zen
auto_oom=on
+enable_adaptive_lmk=on
oom_config_screen_on=default
oom_config_screen_off=default
+lowmem_reserve=boosted
dirty_background_ratio=20
dirty_ratio=25
-swappiness=60
+run=on
+uskm_gov_on=medium
+uskm_gov_sleep=low
+sleep_millisecs=500
led_lowpower_current=40
led_highpower_current=40
led_fade_in_time=1
diff --git a/res/customconfig/extreme_performance.profile b/res/customconfig/extreme_performance.profile
index 9928c67..dafedcb 100755
--- a/res/customconfig/extreme_performance.profile
+++ b/res/customconfig/extreme_performance.profile
@@ -90,10 +90,10 @@ hotplug_load_3_1=65
hotplug_load_4_0=20
hotplug_rq_1_1=100
hotplug_rq_2_0=100
-hotplug_rq_2_1=200
-hotplug_rq_3_0=200
-hotplug_rq_3_1=300
-hotplug_rq_4_0=300
+hotplug_rq_2_1=150
+hotplug_rq_3_0=150
+hotplug_rq_3_1=200
+hotplug_rq_4_0=200
maxcoreslimit=4
maxcoreslimit_sleep=2
cpus_boosted=1
@@ -121,14 +121,20 @@ min_input_interval=150
nr_boost_cpus=4
intsd_read_ahead_kb=1024
extsd_read_ahead_kb=128
+mmc_mode=performance
internal_iosched=zen
sd_iosched=zen
auto_oom=on
+enable_adaptive_lmk=on
oom_config_screen_on=default
oom_config_screen_off=default
+lowmem_reserve=boosted
dirty_background_ratio=20
dirty_ratio=25
-swappiness=60
+run=on
+uskm_gov_on=medium
+uskm_gov_sleep=low
+sleep_millisecs=500
led_lowpower_current=40
led_highpower_current=40
led_fade_in_time=1
diff --git a/res/customconfig/performance.profile b/res/customconfig/performance.profile
index c44540a..af313a7 100755
--- a/res/customconfig/performance.profile
+++ b/res/customconfig/performance.profile
@@ -90,10 +90,10 @@ hotplug_load_3_1=65
hotplug_load_4_0=20
hotplug_rq_1_1=100
hotplug_rq_2_0=100
-hotplug_rq_2_1=200
-hotplug_rq_3_0=200
-hotplug_rq_3_1=300
-hotplug_rq_4_0=300
+hotplug_rq_2_1=150
+hotplug_rq_3_0=150
+hotplug_rq_3_1=200
+hotplug_rq_4_0=200
maxcoreslimit=4
maxcoreslimit_sleep=2
cpus_boosted=1
@@ -121,14 +121,20 @@ min_input_interval=200
nr_boost_cpus=4
intsd_read_ahead_kb=1024
extsd_read_ahead_kb=128
+mmc_mode=performance
internal_iosched=zen
sd_iosched=zen
auto_oom=on
+enable_adaptive_lmk=on
oom_config_screen_on=default
oom_config_screen_off=default
+lowmem_reserve=boosted
dirty_background_ratio=20
dirty_ratio=25
-swappiness=60
+run=on
+uskm_gov_on=medium
+uskm_gov_sleep=low
+sleep_millisecs=500
led_lowpower_current=40
led_highpower_current=40
led_fade_in_time=1
diff --git a/res/synapse/actions/live b/res/synapse/actions/live
index 587e602..50fae3f 100755
--- a/res/synapse/actions/live
+++ b/res/synapse/actions/live
@@ -68,6 +68,19 @@ case $1 in
Memory)
$BB echo `sh $DEVICE LiveMemory`;
;;
+ UKSMStats)
+ UKSM="$(expr `cat /sys/kernel/mm/uksm/run`)"
+ if [ UKSM -eq "1" ]; then
+ SAVEDMEM=`echo "Saved memory: $((\`cat /sys/kernel/mm/uksm/pages_sharing\`*4096/1024/1024)) MB"`
+ SHARDMEM=`echo "Shared memory: $((\`cat /sys/kernel/mm/uksm/pages_shared\`*4096/1024/1024)) MB"`
+ CANTBESHAREDMEM=`echo "Cannot be shared memory: $((\`cat /sys/kernel/mm/uksm/pages_unshared\`*4096/1024/1024)) MB"`
+ MAXCPU=`echo "UKSM Max Allowed CPU Usage: \`cat /sys/kernel/mm/uksm/max_cpu_percentage\`%"`
+ SLEEPMS=`echo "UKSM Sleep Millisecs: \`cat /sys/kernel/mm/uksm/sleep_millisecs\`"`
+ echo $SAVEDMEM@n$SHARDMEM@n$CANTBESHAREDMEM@n$MAXCPU@n$SLEEPMS
+ else
+ echo UKSM is Disabled.
+ fi
+ ;;
Time)
$BB echo `sh $DEVICE LiveTime $2 $3`;
;;
diff --git a/res/synapse/config.json.generate.status b/res/synapse/config.json.generate.status
index 3ad0be6..66cb1e5 100755
--- a/res/synapse/config.json.generate.status
+++ b/res/synapse/config.json.generate.status
@@ -4,125 +4,176 @@ cat << CTAG
{
name:STATUS,
elements:[
- { SLiveLabel:{
- title:"CPU0 Scaling Frequencies",
- description: "CPU0 Scaling Min Max frequencies are affected by thermal engine/driver and CPU Boost driver. You may enable and use MSM Limiter Driver below to make sure scaling frequencies are desired ranges most of the time.",
- refresh:2000,
- action:"live CPU0_MAX_MIN_Freq"
- }},
- { SLiveLabel:{
- title:"CPU1 Scaling Frequencies",
- description: "CPU1 Scaling Min Max frequencies are affected by thermal engine/driver and CPU Boost driver. You may enable and use MSM Limiter Driver below to make sure scaling frequencies are desired ranges most of the time.",
- refresh:2000,
- action:"live CPU1_MAX_MIN_Freq"
- }},
- { SLiveLabel:{
- title:"CPU2 Scaling Frequencies",
- description: "CPU2 Scaling Min Max frequencies are affected by thermal engine/driver and CPU Boost driver. You may enable and use MSM Limiter Driver below to make sure scaling frequencies are desired ranges most of the time.",
- refresh:2000,
- action:"live CPU2_MAX_MIN_Freq"
- }},
- { SLiveLabel:{
- title:"CPU3 Scaling Frequencies",
- description: "CPU3 Scaling Min Max frequencies are affected by thermal engine/driver and CPU Boost driver. You may enable and use MSM Limiter Driver below to make sure scaling frequencies are desired ranges most of the time.",
- refresh:2000,
- action:"live CPU3_MAX_MIN_Freq"
- }},
- { SLiveLabel:{
- title:"CPU Cores State",
- description: "Actual CORES state, Active or Sleeping.",
- refresh:1000,
- action:"live CPU_CORES_ON_OFF"
- }},
- { SLiveLabel:{
- title:"CPU Temperature:",
- refresh:3000,
- action:"live CPUTemperature"
- }},
- { SLiveLabel:{
- title:"Current Active CPU0 Governor",
- description: "Display Current Active CPU0 Governor",
- refresh:10000,
- action:"live DefaultCPU0Governor"
- }},
- { SLiveLabel:{
- title:"Current Active CPU1 Governor",
- description: "Display Current Active CPU1 Governor",
- refresh:10000,
- action:"live DefaultCPU1Governor"
- }},
- { SLiveLabel:{
- title:"Current Active CPU2 Governor",
- description: "Display Current Active CPU2 Governor",
- refresh:10000,
- action:"live DefaultCPU2Governor"
- }},
- { SLiveLabel:{
- title:"Current Active CPU3 Governor",
- description: "Display Current Active CPU3 Governor",
- refresh:10000,
- action:"live DefaultCPU3Governor"
- }},
- { SLiveLabel:{
- title:"Current Active CPU HotPlug",
- description: "Display Current Active CPU HotPlug Driver",
- refresh:8000,
- action:"live CPU_HOTPLUG"
- }},
- { SLiveLabel:{
- title:"Battery Temperature:",
- refresh:3000,
- action:"live BatteryTemperature"
- }},
- { SLiveLabel:{
- title:"Memory:",
- refresh:3000,
- action:"live Memory"
- }},
- { SLiveLabel:{
- title:"Uptime:",
- refresh:5000,
- action:"live UpTime"
- }},
- { SLiveLabel:{
- title:"Unused States:",
- refresh:5000,
- action:"live UnUsed"
- }},
- { SLiveLabel:{
- title:"Time in States:",
- refresh:5000,
- action:"live Time 0 9"
- }},
- { SLiveLabel:{
- refresh:5000,
- action:"live Time 10 19"
- }},
- { SLiveLabel:{
- title:"MMC0 IO Read Ahead Size:",
- refresh:10000,
- action:"live IntIOReadAheadSize"
- }},
- { SLiveLabel:{
- title:"MMC1 IO Read Ahead Size:",
- refresh:10000,
- action:"live ExtIOReadAheadSize"
- }},
- { SLiveLabel:{
- title:"MMC0 Current IO Scheduler:",
- refresh:10000,
- action:"live IntIOScheduler"
- }},
- { SLiveLabel:{
- title:"MMC1 Current IO Scheduler:",
- refresh:10000,
- action:"live ExtIOScheduler"
- }},
- { SLiveLabel:{
- title:"NET Current TCP Congestion:",
- refresh:10000,
- action:"live TCPCongestion"
- }},
+ { STitleBar:{
+ title:"CPU0 Scaling Frequencies"
+ }},
+ { SLiveLabel:{
+ description: "CPU0 Scaling Min Max frequencies are affected by thermal engine/driver and CPU Boost driver. You may enable and use MSM Limiter Driver below to make sure scaling frequencies are desired ranges most of the time.",
+ refresh:2000,
+ action:"live CPU0_MAX_MIN_Freq"
+ }},
+ { STitleBar:{
+ title:"CPU1 Scaling Frequencies"
+ }},
+ { SLiveLabel:{
+ description: "CPU1 Scaling Min Max frequencies are affected by thermal engine/driver and CPU Boost driver. You may enable and use MSM Limiter Driver below to make sure scaling frequencies are desired ranges most of the time.",
+ refresh:2000,
+ action:"live CPU1_MAX_MIN_Freq"
+ }},
+ { STitleBar:{
+ title:"CPU2 Scaling Frequencies"
+ }},
+ { SLiveLabel:{
+ description: "CPU2 Scaling Min Max frequencies are affected by thermal engine/driver and CPU Boost driver. You may enable and use MSM Limiter Driver below to make sure scaling frequencies are desired ranges most of the time.",
+ refresh:2000,
+ action:"live CPU2_MAX_MIN_Freq"
+ }},
+ { STitleBar:{
+ title:"CPU3 Scaling Frequencies"
+ }},
+ { SLiveLabel:{
+ description: "CPU3 Scaling Min Max frequencies are affected by thermal engine/driver and CPU Boost driver. You may enable and use MSM Limiter Driver below to make sure scaling frequencies are desired ranges most of the time.",
+ refresh:2000,
+ action:"live CPU3_MAX_MIN_Freq"
+ }},
+ { STitleBar:{
+ title:"CPU Cores State"
+ }},
+ { SLiveLabel:{
+ description: "Actual CORES state, Active or Sleeping.",
+ refresh:1000,
+ action:"live CPU_CORES_ON_OFF"
+ }},
+ { STitleBar:{
+ title:"CPU Temperature:"
+ }},
+ { SLiveLabel:{
+ refresh:3000,
+ action:"live CPUTemperature"
+ }},
+ { STitleBar:{
+ title:"Current Active CPU0 Governor"
+ }},
+ { SLiveLabel:{
+ description: "Display Current Active CPU0 Governor",
+ refresh:10000,
+ action:"live DefaultCPU0Governor"
+ }},
+ { STitleBar:{
+ title:"Current Active CPU1 Governor"
+ }},
+ { SLiveLabel:{
+ description: "Display Current Active CPU1 Governor",
+ refresh:10000,
+ action:"live DefaultCPU1Governor"
+ }},
+ { STitleBar:{
+ title:"Current Active CPU2 Governor"
+ }},
+ { SLiveLabel:{
+ description: "Display Current Active CPU2 Governor",
+ refresh:10000,
+ action:"live DefaultCPU2Governor"
+ }},
+ { STitleBar:{
+ title:"Current Active CPU3 Governor"
+ }},
+ { SLiveLabel:{
+ description: "Display Current Active CPU3 Governor",
+ refresh:10000,
+ action:"live DefaultCPU3Governor"
+ }},
+ { STitleBar:{
+ title:"Current Active CPU HotPlug"
+ }},
+ { SLiveLabel:{
+ description: "Display Current Active CPU HotPlug Driver",
+ refresh:8000,
+ action:"live CPU_HOTPLUG"
+ }},
+ { STitleBar:{
+ title:"Battery Temperature:"
+ }},
+ { SLiveLabel:{
+ refresh:3000,
+ action:"live BatteryTemperature"
+ }},
+ { STitleBar:{
+ title:"Memory:"
+ }},
+ { SLiveLabel:{
+ refresh:3000,
+ action:"live Memory"
+ }},
+ { STitleBar:{
+ title:"Uptime:"
+ }},
+ { SLiveLabel:{
+ refresh:5000,
+ action:"live UpTime"
+ }},
+ { STitleBar:{
+ title:"Ultra Kernel Samepage Merging:"
+ }},
+ { SLiveLabel:{
+ title:"UKSM Stats:",
+ description:"Memory samepage merging is not quick process. So, stats may show 0 MB initially.",
+ refresh:3000,
+ action:"live UKSMStats"
+ }},
+ { STitleBar:{
+ title:"Unused States:"
+ }},
+ { SLiveLabel:{
+ refresh:5000,
+ action:"live UnUsed"
+ }},
+ { STitleBar:{
+ title:"Time in States:"
+ }},
+ { SLiveLabel:{
+ refresh:5000,
+ action:"live Time 0 9"
+ }},
+ { SLiveLabel:{
+ refresh:5000,
+ action:"live Time 10 19"
+ }},
+ { STitleBar:{
+ title:"MMC0 IO Read Ahead Size:"
+ }},
+ { SLiveLabel:{
+ refresh:10000,
+ action:"live IntIOReadAheadSize"
+ }},
+ { STitleBar:{
+ title:"MMC1 IO Read Ahead Size:"
+ }},
+ { SLiveLabel:{
+ refresh:10000,
+ action:"live ExtIOReadAheadSize"
+ }},
+ { STitleBar:{
+ title:"MMC0 Current IO Scheduler:"
+ }},
+ { SLiveLabel:{
+ refresh:10000,
+ action:"live IntIOScheduler"
+ }},
+ { STitleBar:{
+ title:"MMC1 Current IO Scheduler:"
+ }},
+ { SLiveLabel:{
+ refresh:10000,
+ action:"live ExtIOScheduler"
+ }},
+ { STitleBar:{
+ title:"NET Current TCP Congestion:"
+ }},
+ { SLiveLabel:{
+ refresh:10000,
+ action:"live TCPCongestion"
+ }},
]
}
CTAG
diff --git a/res/user_uci_test_run.sh b/res/user_uci_test_run.sh
index 7e153f5..0a434f0 100755
--- a/res/user_uci_test_run.sh
+++ b/res/user_uci_test_run.sh
@@ -3,8 +3,15 @@
# by Gokhan Moral and Voku and Dorimanx and Alucard24
# stop uci.sh from running all the PUSH Buttons in stweaks on boot
-/sbin/busybox mount -o remount,rw /;
-/sbin/busybox mount -o remount,rw /system;
+BB=/sbin/busybox
+
+if [ "$($BB mount | grep rootfs | cut -c 26-27 | grep -c ro)" -eq "1" ]; then
+ $BB mount -o remount,rw /;
+fi;
+if [ "$($BB mount | grep system | grep -c ro)" -eq "1" ]; then
+ $BB mount -o remount,rw /system;
+fi;
+
chown -R root:system /res/customconfig/actions/;
chmod -R 06755 /res/customconfig/actions/;
mv /res/customconfig/actions/push-actions/* /res/no-push-on-boot/;
diff --git a/sbin/adbd b/sbin/adbd
index b022b3d..e2713f0 100755
Binary files a/sbin/adbd and b/sbin/adbd differ
diff --git a/sbin/ext/busybox.sh b/sbin/ext/busybox.sh
index aee9803..671afff 100755
--- a/sbin/ext/busybox.sh
+++ b/sbin/ext/busybox.sh
@@ -2,8 +2,12 @@
BB=/sbin/busybox
-$BB mount -o remount,rw /system;
-$BB mount -o remount,rw /;
+if [ "$($BB mount | $BB grep rootfs | $BB cut -c 26-27 | $BB grep -c ro)" -eq "1" ]; then
+ $BB mount -o remount,rw /;
+fi;
+if [ "$($BB mount | $BB grep system | $BB grep -c ro)" -eq "1" ]; then
+ $BB mount -o remount,rw /system;
+fi;
CLEAN_BUSYBOX()
{
diff --git a/sbin/ext/cortexbrain-tune.sh b/sbin/ext/cortexbrain-tune.sh
index 7a22582..3f033c2 100755
--- a/sbin/ext/cortexbrain-tune.sh
+++ b/sbin/ext/cortexbrain-tune.sh
@@ -56,7 +56,7 @@ IO_TWEAKS()
echo "$internal_iosched" > "$i"/queue/scheduler;
echo "0" > "$i"/queue/rotational;
echo "0" > "$i"/queue/iostats;
- echo "1" > "$i"/queue/rq_affinity;
+ echo "2" > "$i"/queue/nomerges;
done;
# This controls how many requests may be allocated
@@ -71,8 +71,6 @@ IO_TWEAKS()
echo "$intsd_read_ahead_kb" > /sys/block/mmcblk0/queue/read_ahead_kb;
echo "$intsd_read_ahead_kb" > /sys/block/mmcblk0/bdi/read_ahead_kb;
- # echo "64" > /sys/block/mmcblk1/queue/nr_requests; # default: 64
-
echo "$extsd_read_ahead_kb" > /sys/block/mmcblk1/queue/read_ahead_kb;
echo "45" > /proc/sys/fs/lease-break-time;
@@ -98,13 +96,6 @@ KERNEL_TWEAKS()
else
echo "kernel_tweaks disabled";
fi;
- if [ "$cortexbrain_memory" == "on" ]; then
- echo "32 32" > /proc/sys/vm/lowmem_reserve_ratio;
-
- log -p i -t "$FILE_NAME" "*** MEMORY_TWEAKS ***: enabled";
- else
- echo "memory_tweaks disabled";
- fi;
}
KERNEL_TWEAKS;
@@ -129,13 +120,15 @@ SYSTEM_TWEAKS;
MEMORY_TWEAKS()
{
if [ "$cortexbrain_memory" == "on" ]; then
- echo "$dirty_background_ratio" > /proc/sys/vm/dirty_background_ratio; # default: 10
- echo "$dirty_ratio" > /proc/sys/vm/dirty_ratio; # default: 20
+ echo "$dirty_background_ratio" > /proc/sys/vm/dirty_background_ratio; # default: 20
+ echo "$dirty_ratio" > /proc/sys/vm/dirty_ratio; # default: 25
echo "4" > /proc/sys/vm/min_free_order_shift; # default: 4
echo "1" > /proc/sys/vm/overcommit_memory; # default: 1
echo "50" > /proc/sys/vm/overcommit_ratio; # default: 50
echo "3" > /proc/sys/vm/page-cluster; # default: 3
- echo "4096" > /proc/sys/vm/min_free_kbytes;
+ echo "8192" > /proc/sys/vm/min_free_kbytes; #default: 2572
+ # mem calc here in pages. so 16384 x 4 = 64MB reserved for fast access by kernel and VM
+ echo "32768" > /proc/sys/vm/mmap_min_addr; #default: 32768
log -p i -t "$FILE_NAME" "*** MEMORY_TWEAKS ***: enabled";
else
@@ -585,6 +578,18 @@ MOUNT_SD_CARD()
# run dual mount on boot
MOUNT_SD_CARD;
+UKSM_CONTROL()
+{
+ local state="$1";
+
+ if [ "$state" == "awake" ]; then
+ echo "$uskm_gov_on" > /sys/kernel/mm/uksm/cpu_governor;
+ elif [ "$state" == "sleep" ]; then
+ echo "$uskm_gov_sleep" > /sys/kernel/mm/uksm/cpu_governor;
+ fi;
+ log -p i -t "$FILE_NAME" "*** UKSM_CONTROL $state ***: done";
+}
+
WORKQUEUE_CONTROL()
{
local state="$1";
@@ -609,6 +614,7 @@ AWAKE_MODE()
# not on call, check if was powerd by USB on sleep, or didnt sleep at all
if [ "$USB_POWER" -eq "0" ]; then
WORKQUEUE_CONTROL "awake";
+ UKSM_CONTROL "awake";
echo "0" > /data/alu_cortex_sleep;
else
# Was powered by USB, and half sleep
@@ -617,6 +623,10 @@ AWAKE_MODE()
log -p i -t "$FILE_NAME" "*** USB_POWER_WAKE: done ***";
fi;
# Didn't sleep, and was not powered by USB
+ if [ "$auto_oom" == "on" ]; then
+ sleep 1;
+ $BB sh /res/uci.sh oom_config_screen_on $oom_config_screen_on;
+ fi;
}
# ==============================================================
@@ -632,12 +642,13 @@ SLEEP_MODE()
if [ "$android_logger" -eq "3" ]; then
CHARGING=1;
else
- CHARGING=`cat /sys/class/power_supply/battery/batt_charging_source`;
+ CHARGING=$(cat /sys/class/power_supply/battery/batt_charging_source);
fi;
# check if we powered by USB, if not sleep
if [ "$CHARGING" -eq "1" ]; then
WORKQUEUE_CONTROL "sleep";
+ UKSM_CONTROL "sleep";
echo "1" > /data/alu_cortex_sleep;
log -p i -t "$FILE_NAME" "*** SLEEP mode ***";
else
@@ -657,13 +668,13 @@ cortexbrain_background_process=1;
if [ "$cortexbrain_background_process" -eq "1" ] && [ "$(pgrep -f "/sbin/ext/cortexbrain-tune.sh" | wc -l)" -eq "2" ]; then
(while true; do
- while [ "$(cat /sys/power/autosleep)" != "off" ]; do
+ while [ "$(cat /sys/module/powersuspend/parameters/sleep_state)" != "0" ]; do
sleep "3";
done;
# AWAKE State. all system ON
AWAKE_MODE;
- while [ "$(cat /sys/power/autosleep)" != "mem" ]; do
+ while [ "$(cat /sys/module/powersuspend/parameters/sleep_state)" != "1" ]; do
sleep "3";
done;
# SLEEP state. All system to power save
diff --git a/sbin/ext/install.sh b/sbin/ext/install.sh
deleted file mode 100755
index 74e1704..0000000
--- a/sbin/ext/install.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/sbin/busybox sh
-
-BB=/sbin/busybox
-
-cd /;
-
-fi;
-
-STWEAKS_CHECK=$($BB find /data/app/ -name com.gokhanmoral.stweaks* | wc -l);
-
-if [ "$STWEAKS_CHECK" -eq "1" ]; then
- $BB rm -f /data/app/com.gokhanmoral.stweaks* > /dev/null 2>&1;
- $BB rm -f /data/data/com.gokhanmoral.stweaks*/* > /dev/null 2>&1;
-fi;
-
-if [ -f /system/priv-app/STweak*.apk ]; then
- $BB rm /system/priv-app/STweak*.apk;
-fi;
-
-if [ -f /system/app/STweaks.apk ]; then
- stmd5sum=$($BB md5sum /system/app/STweaks.apk | $BB awk '{print $1}');
- stmd5sum_kernel=$($BB cat /res/stweaks_md5);
- if [ "$stmd5sum" != "$stmd5sum_kernel" ]; then
- $BB rm -f /system/app/STweaks.apk > /dev/null 2>&1;
- $BB rm -f /data/data/com.gokhanmoral.stweaks*/* > /dev/null 2>&1;
- $BB cp /res/misc/payload/STweaks.apk /system/app/;
- $BB chown root.root /system/app/STweaks.apk;
- $BB chmod 644 /system/app/STweaks.apk;
- fi;
-else
- $BB rm -r /data/data/com.gokhanmoral.*weak*/* > /dev/null 2>&1;
- $BB cp -a /res/misc/payload/STweaks.apk /system/app/;
- $BB chown root.root /system/app/STweaks.apk;
- $BB chmod 644 /system/app/STweaks.apk;
-fi;
diff --git a/sbin/ext/post-init.sh b/sbin/ext/post-init.sh
index b024763..9cb5649 100755
--- a/sbin/ext/post-init.sh
+++ b/sbin/ext/post-init.sh
@@ -7,39 +7,39 @@ BB=/sbin/busybox
# protect init from oom
echo "-1000" > /proc/1/oom_score_adj;
-PIDOFINIT=$(pgrep -f "/sbin/ext/post-init.sh");
-for i in $PIDOFINIT; do
- echo "-600" > /proc/"$i"/oom_score_adj;
-done;
-
OPEN_RW()
{
- ROOTFS_MOUNT=$(mount | grep rootfs | cut -c26-27 | grep -c rw)
- SYSTEM_MOUNT=$(mount | grep system | cut -c69-70 | grep -c rw)
- if [ "$ROOTFS_MOUNT" -eq "0" ]; then
+ if [ "$($BB mount | grep rootfs | cut -c 26-27 | grep -c ro)" -eq "1" ]; then
$BB mount -o remount,rw /;
fi;
- if [ "$SYSTEM_MOUNT" -eq "0" ]; then
+ if [ "$($BB mount | grep system | grep -c ro)" -eq "1" ]; then
$BB mount -o remount,rw /system;
fi;
}
OPEN_RW;
-# run ROM scripts
-$BB sh /init.qcom.post_boot.sh;
-
-# fix storage folder owner
-# $BB chown system.sdcard_rw /storage;
+selinux_status=$(grep -c "selinux=1" /proc/cmdline);
+if [ "$selinux_status" -eq "1" ]; then
+ restorecon -RF /system
+ if [ -e /system/bin/app_process32_xposed ]; then
+ chcon u:object_r:zygote_exec:s0 /system/bin/app_process32_xposed
+ fi;
+ umount /firmware;
+ mount -t vfat -o ro,context=u:object_r:firmware_file:s0,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337 /dev/block/platform/msm_sdcc.1/by-name/modem /firmware
+fi;
-# Boot with ROW I/O Gov
-$BB echo "row" > /sys/block/mmcblk0/queue/scheduler;
+# run ROM scripts
+if [ -f /system/etc/init.qcom.post_boot.sh ]; then
+ $BB chmod 755 /system/etc/init.qcom.post_boot.sh;
+ $BB sh /system/etc/init.qcom.post_boot.sh;
+fi;
# clean old modules from /system and add new from ramdisk
# create init.d folder if missing
if [ ! -d /system/etc/init.d ]; then
mkdir -p /system/etc/init.d/
- $BB chmod 755 /system/etc/init.d/;
+ $BB chmod -R 755 /system/etc/init.d/;
fi;
OPEN_RW;
@@ -55,17 +55,9 @@ if [ ! -e /cpufreq ]; then
$BB ln -s /sys/devices/system/cpu/cpufreq/all_cpus/ /all_cpus;
fi;
-# cleaning
-$BB rm -rf /cache/lost+found/* 2> /dev/null;
-$BB rm -rf /data/lost+found/* 2> /dev/null;
-$BB rm -rf /data/tombstones/* 2> /dev/null;
-
-OPEN_RW;
-
CRITICAL_PERM_FIX()
{
# critical Permissions fix
- $BB chown -R system:system /data/anr;
$BB chown -R root:root /tmp;
$BB chown -R root:root /res;
$BB chown -R root:root /sbin;
@@ -73,9 +65,8 @@ CRITICAL_PERM_FIX()
$BB chmod -R 777 /tmp/;
$BB chmod -R 775 /res/;
$BB chmod -R 06755 /sbin/ext/;
- $BB chmod -R 0777 /data/anr/;
- $BB chmod -R 0400 /data/tombstones;
- $BB chmod 06755 /sbin/busybox
+ $BB chmod 06755 /sbin/busybox;
+ $BB chmod 06755 /system/xbin/busybox;
}
CRITICAL_PERM_FIX;
@@ -104,14 +95,6 @@ $BB chmod 666 /sys/kernel/intelli_plug/*
$BB chmod 666 /sys/class/kgsl/kgsl-3d0/max_gpuclk
$BB chmod 666 /sys/devices/platform/kgsl-3d0/kgsl/kgsl-3d0/pwrscale/trustzone/governor
-# make sure our max gpu clock is set via sysfs
-echo 450000000 > /sys/class/kgsl/kgsl-3d0/max_gpuclk
-
-# Fix ROM dev wrong sets.
-setprop persist.adb.notify 0
-setprop pm.sleep_mode 1
-setprop persist.service.btui.use_aptx 1
-
if [ ! -d /data/.alucard ]; then
$BB mkdir -p /data/.alucard;
fi;
@@ -120,8 +103,8 @@ fi;
# just set numer $RESET_MAGIC + 1 and profiles will be reset one time on next boot with new kernel.
# incase that ADMIN feel that something wrong with global STweaks config and profiles, then ADMIN can add +1 to CLEAN_ALU_DIR
# to clean all files on first boot from /data/.alucard/ folder.
-RESET_MAGIC=11;
-CLEAN_ALU_DIR=5;
+RESET_MAGIC=4;
+CLEAN_ALU_DIR=1;
if [ ! -e /data/.alucard/reset_profiles ]; then
echo "$RESET_MAGIC" > /data/.alucard/reset_profiles;
@@ -179,15 +162,18 @@ $BB chmod -R 0777 /data/.alucard/;
read_defaults;
read_config;
+# Load parameters for Synapse
+DEBUG=/data/.alucard/;
+BUSYBOX_VER=$(busybox | grep "BusyBox v" | cut -c0-15);
+echo "$BUSYBOX_VER" > $DEBUG/busybox_ver;
+
# start CORTEX by tree root, so it's will not be terminated.
sed -i "s/cortexbrain_background_process=[0-1]*/cortexbrain_background_process=1/g" /sbin/ext/cortexbrain-tune.sh;
if [ "$(pgrep -f "cortexbrain-tune.sh" | wc -l)" -eq "0" ]; then
$BB nohup $BB sh /sbin/ext/cortexbrain-tune.sh > /data/.alucard/cortex.txt &
fi;
-# # Apps Install
OPEN_RW;
-# $BB sh /sbin/ext/install.sh;
if [ "$stweaks_boot_control" == "yes" ]; then
# apply Synapse monitor
@@ -217,39 +203,34 @@ MODULES_LOAD()
fi;
}
-# enable kmem interface for everyone by GM
-echo "0" > /proc/sys/kernel/kptr_restrict;
-
# disable debugging on some modules
if [ "$android_logger" -ge "1" ]; then
echo "N" > /sys/module/kernel/parameters/initcall_debug;
-# echo "0" > /sys/module/alarm/parameters/debug_mask;
-# echo "0" > /sys/module/alarm_dev/parameters/debug_mask;
-# echo "0" > /sys/module/binder/parameters/debug_mask;
- echo "0" > /sys/module/xt_qtaguid/parameters/debug_mask;
-# echo "0" > /sys/kernel/debug/clk/debug_suspend;
-# echo "0" > /sys/kernel/debug/msm_vidc/debug_level;
-# echo "0" > /sys/module/ipc_router/parameters/debug_mask;
-# echo "0" > /sys/module/msm_serial_hs/parameters/debug_mask;
-# echo "0" > /sys/module/msm_show_resume_irq/parameters/debug_mask;
+# echo "0" > /sys/module/smd/parameters/debug_mask
+# echo "0" > /sys/module/rpm_regulator_smd/parameters/debug_mask
+# echo "0" > /sys/module/ipc_router/parameters/debug_mask
+# echo "0" > /sys/module/event_timer/parameters/debug_mask
+# echo "0" > /sys/module/msm_serial_hs/parameters/debug_mask
+# echo "0" > /sys/module/powersuspend/parameters/debug_mask
+# echo "0" > /sys/module/msm_hotplug/parameters/debug_mask
+# echo "0" > /sys/module/cpufreq_limit/parameters/debug_mask
+# echo "0" > /sys/module/rpm_smd/parameters/debug_mask
+# echo "0" > /sys/module/smd_pkt/parameters/debug_mask
+ echo "0" > /sys/module/xt_qtaguid/parameters/debug_mask
+# echo "0" > /sys/module/binder/parameters/debug_mask
+# echo "0" > /sys/module/msm_show_resume_irq/parameters/debug_mask
+# echo "0" > /sys/module/alarm_dev/parameters/debug_mask
# echo "0" > /sys/module/pm_8x60/parameters/debug_mask;
+# echo "0" > /sys/module/spm_v2/parameters/debug_mask
+# echo "0" > /sys/module/alu_t_boost/parameters/debug_mask
+# echo "0" > /sys/module/ipc_router_smd_xprt/parameters/debug_mask
+# echo "0" > /sys/module/x_tables/parameters/debug_mask
fi;
OPEN_RW;
-# for ntfs automounting
-if [ ! -d /mnt/ntfs ]; then
- $BB mkdir /mnt/ntfs
- $BB mount -t tmpfs -o mode=0777,gid=1000 tmpfs /mnt/ntfs
-fi;
-
-
-# Turn off CORE CONTROL, to boot on all cores!
-$BB chmod 666 /sys/module/msm_thermal/core_control/*
-echo "0" > /sys/module/msm_thermal/core_control/core_control;
-
# Start any init.d scripts that may be present in the rom or added by the user
-$BB chmod 755 /system/etc/init.d/*;
+$BB chmod -R 755 /system/etc/init.d/;
if [ "$init_d" == "on" ]; then
(
$BB nohup $BB run-parts /system/etc/init.d/ > /data/.alucard/init.d.txt &
@@ -262,6 +243,8 @@ else
fi;
fi;
+OPEN_RW;
+
# Fix critical perms again after init.d mess
CRITICAL_PERM_FIX;
@@ -273,31 +256,84 @@ fi;
echo "0" > /cputemp/freq_limit_debug;
-sleep 40;
-
-# Temporary GooglePlayService fix.
-if [ "$gpservicefix" == "yes" ]; then
- pm enable com.google.android.gms/.update.SystemUpdateActivity
- pm enable com.google.android.gms/.update.SystemUpdateService
- pm enable com.google.android.gms/.update.SystemUpdateService$ActiveReceiver
- pm enable com.google.android.gms/.update.SystemUpdateService$Receiver
- pm enable com.google.android.gms/.update.SystemUpdateService$SecretCodeReceiver
- pm enable com.google.android.gsf/.update.SystemUpdateActivity
- pm enable com.google.android.gsf/.update.SystemUpdatePanoActivity
- pm enable com.google.android.gsf/.update.SystemUpdateService
- pm enable com.google.android.gsf/.update.SystemUpdateService$Receiver
- pm enable com.google.android.gsf/.update.SystemUpdateService$SecretCodeReceiver
+# tune I/O controls to boost I/O performance
+
+#This enables the user to disable the lookup logic involved with IO
+#merging requests in the block layer. By default (0) all merges are
+#enabled. When set to 1 only simple one-hit merges will be tried. When
+#set to 2 no merge algorithms will be tried (including one-hit or more
+#complex tree/hash lookups).
+if [ "$(cat /sys/devices/msm_sdcc.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0/queue/nomerges)" != "2" ]; then
+ echo "2" > /sys/devices/msm_sdcc.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0/queue/nomerges;
+ echo "2" > /sys/devices/msm_sdcc.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0rpmb/queue/nomerges;
fi;
-# tune I/O controls to boost I/O performance
-echo "1" > /sys/devices/msm_sdcc.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0/queue/nomerges;
-echo "1" > /sys/devices/msm_sdcc.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0rpmb/queue/nomerges;
-echo "2" > /sys/devices/msm_sdcc.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0/queue/rq_affinity;
-echo "2" > /sys/devices/msm_sdcc.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0rpmb/queue/rq_affinity;
+#If this option is '1', the block layer will migrate request completions to the
+#cpu "group" that originally submitted the request. For some workloads this
+#provides a significant reduction in CPU cycles due to caching effects.
+#For storage configurations that need to maximize distribution of completion
+#processing setting this option to '2' forces the completion to run on the
+#requesting cpu (bypassing the "group" aggregation logic).
+if [ "$(cat /sys/devices/msm_sdcc.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0/queue/rq_affinity)" != "1" ]; then
+ echo "1" > /sys/devices/msm_sdcc.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0/queue/rq_affinity;
+ echo "1" > /sys/devices/msm_sdcc.1/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0rpmb/queue/rq_affinity;
+fi;
+
+(
+ sleep 30;
+
+ # Reload usb driver to open MTP and fix fast charge.
+ CHARGER_STATE=$(cat /sys/class/power_supply/battery/batt_charging_source);
+ if [ "$CHARGER_STATE" -gt "1" ]; then
+ stop adbd
+ sleep 1;
+ start adbd
+ fi;
+
+ if [ "$gpservicefix" == "yes" ]; then
+ # stop google service and restart it on boot. this remove high cpu load and ram leak!
+ if [ "$($BB pidof com.google.android.gms | wc -l)" -eq "1" ]; then
+ $BB kill "$($BB pidof com.google.android.gms)";
+ fi;
+ if [ "$($BB pidof com.google.android.gms.unstable | wc -l)" -eq "1" ]; then
+ $BB kill "$($BB pidof com.google.android.gms.unstable)";
+ fi;
+ if [ "$($BB pidof com.google.android.gms.persistent | wc -l)" -eq "1" ]; then
+ $BB kill "$($BB pidof com.google.android.gms.persistent)";
+ fi;
+ if [ "$($BB pidof com.google.android.gms.wearable | wc -l)" -eq "1" ]; then
+ $BB kill "$($BB pidof com.google.android.gms.wearable)";
+ fi;
+
+ # Google Services battery drain fixer by Alcolawl@xda
+ # http://forum.xda-developers.com/google-nexus-5/general/script-google-play-services-battery-t3059585/post59563859
+ pm enable com.google.android.gms/.update.SystemUpdateActivity
+ pm enable com.google.android.gms/.update.SystemUpdateService
+ pm enable com.google.android.gms/.update.SystemUpdateService$ActiveReceiver
+ pm enable com.google.android.gms/.update.SystemUpdateService$Receiver
+ pm enable com.google.android.gms/.update.SystemUpdateService$SecretCodeReceiver
+ pm enable com.google.android.gsf/.update.SystemUpdateActivity
+ pm enable com.google.android.gsf/.update.SystemUpdatePanoActivity
+ pm enable com.google.android.gsf/.update.SystemUpdateService
+ pm enable com.google.android.gsf/.update.SystemUpdateService$Receiver
+ pm enable com.google.android.gsf/.update.SystemUpdateService$SecretCodeReceiver
+ fi;
+
+ # Update UKSM in case ROM changed to other setting.
+ if [ "$run" == "on" ]; then
+ echo "1" > /sys/kernel/mm/uksm/run;
+ else
+ echo "0" > /sys/kernel/mm/uksm/run;
+ fi;
+ echo "100" > /sys/kernel/mm/ksm/pages_to_scan;
+ echo "$sleep_millisecs" > /sys/kernel/mm/uksm/sleep_millisecs;
-# script finish here, so let me know when
-TIME_NOW=$(date)
-echo "$TIME_NOW" > /data/boot_log_dm
+ # stop core control if need to
+ echo "$core_control" > /sys/module/msm_thermal/core_control/core_control;
-$BB mount -o remount,ro /system;
+ # script finish here, so let me know when
+ TIME_NOW=$(date)
+ echo "$TIME_NOW" > /data/boot_log_dm
+ $BB mount -o remount,ro /system;
+)&
diff --git a/sbin/healthd b/sbin/healthd
index c547b5a..59ee239 100755
Binary files a/sbin/healthd and b/sbin/healthd differ
diff --git a/sbin/mkfs.f2fs b/sbin/mkfs.f2fs
index ae910ca..5be0245 100755
Binary files a/sbin/mkfs.f2fs and b/sbin/mkfs.f2fs differ
diff --git a/seapp_contexts b/seapp_contexts
index ece5911..8ad05fe 100644
--- a/seapp_contexts
+++ b/seapp_contexts
@@ -8,7 +8,6 @@ user=shell domain=shell type=shell_data_file
user=_isolated domain=isolated_app
user=_app seinfo=platform domain=platform_app type=app_data_file
user=_app domain=untrusted_app type=app_data_file
-user=system domain=wfd_app seinfo=platform name=com.qualcomm.wfd.service:wfd_service type=system_data_file
user=gps domain=location_app type=location_app_data_file
user=system seinfo=platform name=com.qualcomm.services.location domain=location_app type=location_app_data_file
user=system seinfo=platform name=com.qualcomm.location.XT domain=location_app type=location_app_data_file
diff --git a/selinux_version b/selinux_version
index 364f3e2..d25185b 100644
--- a/selinux_version
+++ b/selinux_version
@@ -1 +1 @@
-samsung/slim_jfltexx/jfltexx:5.1.1/LMY47V/31f9a6ec6f:userdebug/test-keys
\ No newline at end of file
+samsung/slim_jflte/jflte:5.1.1/LMY48Y/e7ae74d767:userdebug/test-keys
diff --git a/sepolicy b/sepolicy
index 301f942..567e65b 100644
Binary files a/sepolicy and b/sepolicy differ
diff --git a/service_contexts b/service_contexts
index 024ac66..f02b52d 100644
--- a/service_contexts
+++ b/service_contexts
@@ -84,7 +84,6 @@ phone2 u:object_r:radio_service:s0
phone u:object_r:radio_service:s0
power u:object_r:system_server_service:s0
print u:object_r:system_server_service:s0
-profile u:object_r:system_server_service:s0
processinfo u:object_r:system_server_service:s0
procstats u:object_r:system_server_service:s0
radio.phonesubinfo u:object_r:radio_service:s0
@@ -136,8 +135,13 @@ dun u:object_r:dun_service:s0
DigitalPen u:object_r:digitalpen_service:s0
qti.ims.connectionmanagerservice u:object_r:imscm_service:s0
com.qti.snapdragon.sdk.display.IColorService u:object_r:color_service:s0
+#line 1 "device/samsung/jf-common/sepolicy/service_contexts"
+xprivacy453 u:object_r:system_server_service:s0
#line 1 "vendor/slim/sepolicy/service_contexts"
+cmhw u:object_r:system_server_service:s0
edgegestureservice u:object_r:system_server_service:s0
themes u:object_r:system_server_service:s0
torch u:object_r:system_server_service:s0
killswitch u:object_r:system_server_service:s0
+profile u:object_r:system_server_service:s0
+cmhardware u:object_r:system_server_service:s0
diff --git a/ueventd.rc b/ueventd.rc
index 9b9bbcb..4023ea6 100644
--- a/ueventd.rc
+++ b/ueventd.rc
@@ -37,7 +37,6 @@ subsystem adf
/dev/uhid 0660 system net_bt_stack
/dev/uinput 0660 system net_bt_stack
/dev/alarm 0664 system radio
-/dev/hidg* 0777 system system
/dev/rtc0 0640 system system
/dev/tty0 0660 root system
/dev/graphics/* 0660 system graphics