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 @@ + + + + + + +