android_device_samsung_mond.../rootdir/etc/init.qcom.rc

1043 lines
44 KiB
Plaintext
Executable File

# Copyright (c) 2009-2012, Code Aurora Forum. All rights reserved.
# 2017-2018, The LineageOS Project. 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 Code Aurora 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.
#
import /vendor/etc/init/hw/init.qcom.usb.rc
on early-init
mount debugfs debugfs /sys/kernel/debug
chmod 0755 /sys/kernel/debug
# Increase max readahead size to 512 KB
write /sys/block/mmcblk0/queue/read_ahead_kb 512
write /sys/block/mmcblk0/queue/scheduler noop
write /sys/block/zram0/comp_algorithm lz4
symlink /data/tombstones /tombstones
on init
write /proc/sys/vm/page-cluster 0
on fs
mount_all /vendor/etc/fstab.qcom
swapon_all /vendor/etc/fstab.qcom
restorecon_recursive /efs
write /sys/kernel/boot_adsp/boot 1
setprop qcom.audio.init complete
# Adaptive LMK
write /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk 1
write /sys/module/lowmemorykiller/parameters/vmpressure_file_min 53059
# GnssConfiguration doesn't actually look at gps.conf, just the debug file
mount none /system/etc/gps.conf /system/etc/gps_debug.conf bind
on post-fs
# for controlling write performance boosting
chown system radio /sys/block/mmcblk0/bkops_en
chmod 0664 /sys/block/mmcblk0/bkops_en
on post-fs-data
mkdir /data/misc/bluetooth 0770 bluetooth bluetooth
# Create the directories used by the Wireless subsystem
mkdir /data/vendor/wifi 0770 wifi wifi
mkdir /data/vendor/wifi/wpa 0770 wifi wifi
mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi
# Create the directories used by CnE subsystem
mkdir /data/connectivity 0771 system system
chown system system /data/connectivity
# for WIFI TRP/TIS
chown system root /data/.psm.info
chmod 0664 /data/.psm.info
# for WIFI Antena Selection
chown system root /data/.ant.info
chmod 0664 /data/.ant.info
# for WIFI Version
write /data/.wifiver.info 0
chown system root /data/.wifiver.info
chmod 0664 /data/.wifiver.info
restorecon /data/.wifiver.info
# for WIFI Cert
chmod 0664 /data/.bustxglom.info
chmod 0664 /data/.roamoff.info
chmod 0664 /data/.frameburst.info
chmod 0664 /data/.txbf.info
# for WIFI MAC address
mkdir /efs/wifi 0775 radio system
chown system wifi /efs/wifi/.mac.info
chmod 0660 /efs/wifi/.mac.info
restorecon /efs/wifi/.mac.info
# for WIFI Front End Module
chown system system /data/.cid.info
chmod 0664 /data/.cid.info
# Create directory used by audio subsystem
mkdir /data/misc/audio 0770 audio audio
chmod 0664 /sys/devices/platform/msm_sdcc.1/polling
chmod 0664 /sys/devices/platform/msm_sdcc.2/polling
chmod 0664 /sys/devices/platform/msm_sdcc.3/polling
chmod 0664 /sys/devices/platform/msm_sdcc.4/polling
# Chown polling nodes as needed from UI running on system server
chown system system /sys/devices/platform/msm_sdcc.1/polling
chown system system /sys/devices/platform/msm_sdcc.2/polling
chown system system /sys/devices/platform/msm_sdcc.3/polling
chown system system /sys/devices/platform/msm_sdcc.4/polling
# For disabling softkeys *FIXME*
chown root system /sys/class/leds/button-backlight/max_brightness
chmod 0664 /sys/class/leds/button-backlight/max_brightness
chown system system /sys/class/sec/sec_touchkey/tsp_keys_enabled
chmod 0660 /sys/class/sec/sec_touchkey/tsp_keys_enabled
# Torch
chmod 0666 /sys/class/leds/torch-sec1/brightness
chown system camera /sys/class/leds/torch-sec1/brightness
#Create the symlink to qcn wpa_supplicant folder for ar6000 wpa_supplicant
mkdir /data/system 0775 system system
#Create directory from IMS services
mkdir /data/shared 0755
chown system system /data/shared
#Create directory for FOTA
mkdir /data/fota 0771
chown system system /data/fota
# Create /data/time folder for time-services
mkdir /data/time/ 0700 system system
mkdir /data/bluetooth 0770 bluetooth bluetooth
# Enable the setgid bit on the directory
chmod 2770 /data/bluetooth
mkdir /data/audio/ 0770 media audio
# Enable the setgid bit on the directory
chmod 2770 /data/audio
# Gpio DVS
chown radio system /sys/class/secgpio_check/secgpio_check_all/secgpio_ctrl
mkdir /data/tombstones 0771 system system
mkdir /tombstones/modem 0771 system system
mkdir /tombstones/lpass 0771 system system
mkdir /tombstones/wcnss 0771 system system
mkdir /tombstones/dsps 0771 system system
mkdir /tombstones/mdm 0771 system system
# create directory for ril data
mkdir /data/misc/radio 0775 radio radio
mkdir /data/misc/radio/hatp 0775 radio system
# drm and related files in EFS
mkdir /efs/drm 0774 drm system
mkdir /efs/drm/sdrm 0774 drm system
mkdir /efs/drm/sdrm/data_agent 0774 drm system
restorecon /efs/drm
restorecon /efs/drm/sdrm
restorecon /efs/drm/sdrm/data_agent
# DivX DRM
mkdir /efs/.files 0775
mkdir /efs/.files/.dx1 0775
mkdir /efs/.files/.dm33 0775
mkdir /efs/.files/.mp301 0775
chown media system /efs/.files/.dx1
chown media system /efs/.files/.dm33
chown media system /efs/.files/.mp301
chmod 0775 /efs/.files/.dx1
chmod 0775 /efs/.files/.dm33
chmod 0775 /efs/.files/.mp301
# h2k permission
chmod 0644 /efs/redata.bin
chown radio radio /efs/h2k.dat
chmod 0644 /efs/h2k.dat
# DRK permission
mkdir /efs/prov 0770 radio system
chown radio system /efs/prov/libdevkm.lock
chmod 0660 /efs/prov/libd
#OTG Test
chown system radio /sys/class/host_notify/usb_otg/booster
chmod 0660 /sys/class/host_notify/usb_otg/booster
# wifi
mkdir /efs/wifi 0775 system system
# Permission for fast dormacy for RIL
chown system radio /sys/devices/virtual/sec/bamdmux/waketime
# for TRP/TIS
write /data/.psm.info 1
chown system root /data/.psm.info
chmod 0660 /data/.psm.info
# symlink to bugreport storage location
symlink /data/data/com.android.shell/files/bugreports /data/bugreports
# Permissions for svc led
chown system system /sys/class/sec/led/led_r
chown system system /sys/class/sec/led/led_g
chown system system /sys/class/sec/led/led_b
chown system system /sys/class/sec/led/led_pattern
chown system system /sys/class/sec/led/led_blink
chown system system /sys/class/sec/led/led_lowpower
# IR_LED
chown system radio /sys/class/sec/sec_ir/ir_send
chown system radio /sys/class/sec/sec_ir/ir_send_result
# Flash
chown system camera /sys/class/flash/flash/flash_power
chmod 660 /sys/class/flash/flash/flash_power
# Create directories for perfd
mkdir /data/misc/perfd 2755 root system
mkdir /data/system/perfd 2770 root system
# Remove symlinks to avoid issues with migrate after nandroid restores
# Will be recreated at end of boot
rm /data/data/com.android.providers.telephony/databases
rm /data/data/com.android.providers.telephony/shared_prefs
setprop vold.post_fs_data_done 1
on early-boot
# set RLIMIT_MEMLOCK to 64MB
setrlimit 8 67108864 67108864
# Allow subsystem (modem etc) debugging
write /sys/module/subsystem_restart/parameters/enable_debug ${persist.sys.ssr.enable_debug}
on boot
chown bluetooth bluetooth /sys/module/bluetooth_power/parameters/power
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
chown bluetooth bluetooth /proc/bluetooth/sleep/btwake
chown bluetooth bluetooth /proc/bluetooth/sleep/proto
chown bluetooth bluetooth /proc/bluetooth/sleep/lpm
chown bluetooth bluetooth /proc/bluetooth/sleep/btwrite
chown bluetooth bluetooth /sys/module/hci_uart/parameters/ath_lpm
chown bluetooth bluetooth /sys/module/hci_uart/parameters/ath_btwrite
chown system system /sys/module/sco/parameters/disable_esco
chown bluetooth bluetooth /sys/module/hci_smd/parameters/hcismd_set
chown system system /sys/module/radio_iris_transport/parameters/fmsmd_set
chmod 0660 /sys/module/bluetooth_power/parameters/power
chmod 0660 /sys/module/hci_smd/parameters/hcismd_set
chmod 0660 /sys/module/radio_iris_transport/parameters/fmsmd_set
chmod 0660 /sys/class/rfkill/rfkill0/state
chmod 0660 /proc/bluetooth/sleep/btwake
chmod 0660 /proc/bluetooth/sleep/proto
chmod 0644 /proc/bluetooth/sleep/btwrite
chmod 0644 /proc/bluetooth/sleep/lpm
chown bluetooth bluetooth /dev/ttyHS0
chmod 0660 /sys/module/hci_uart/parameters/ath_lpm
chmod 0660 /sys/module/hci_uart/parameters/ath_btwrite
chmod 0660 /dev/ttyHS0
chown bluetooth bluetooth /sys/devices/platform/msm_serial_hs.0/clock
chmod 0660 /sys/devices/platform/msm_serial_hs.0/clock
#Create QMUX deamon socket area
mkdir /dev/socket/qmux_radio 0770 radio radio
chmod 2770 /dev/socket/qmux_radio
mkdir /dev/socket/qmux_audio 0770 media audio
chmod 2770 /dev/socket/qmux_audio
mkdir /dev/socket/qmux_bluetooth 0770 bluetooth bluetooth
chmod 2770 /dev/socket/qmux_bluetooth
mkdir /dev/socket/qmux_gps 0770 gps gps
chmod 2770 /dev/socket/qmux_gps
# Allow QMUX daemon to assign port open wait time
chown radio radio /sys/devices/virtual/hsicctl/hsicctl0/modem_wait
# 4.3 requires this
chmod 0644 /proc/cmdline
#Set SUID bit for usbhub
chmod 4755 /system/bin/usbhub
chmod 755 /system/bin/usbhub_init
#Remove SUID bit for iproute2 ip tool
chmod 0755 /system/bin/ip
chmod 0444 /sys/devices/platform/msm_hsusb/gadget/usb_state
#For bridgemgr daemon to inform the USB driver of the correct transport
chown radio radio /sys/class/android_usb/f_rmnet_smd_sdio/transport
# create symlink for fb1 as HDMI
symlink /dev/graphics/fb1 /dev/graphics/hdmi
# Remove write permissions to video related nodes
chmod 0664 /sys/devices/virtual/graphics/fb0/idle_time
chmod 0664 /sys/devices/virtual/graphics/fb1/hpd
chmod 0664 /sys/devices/virtual/graphics/fb1/video_mode
chown system system /sys/class/graphics/fb1/format_3d
chmod 0664 /sys/devices/virtual/graphics/fb1/format_3d
chown system graphics /sys/class/graphics/fb1/vscr_info
chmod 0664 /sys/devices/virtual/graphics/fb1/vscr_info
#HDMID Permission for sys nodes
chmod 0664 /sys/class/graphics/fb1/video_mode
chmod 0664 /sys/class/graphics/fb1/format_3d
chown system graphics /sys/class/graphics/fb1/connected
chown system graphics /sys/class/graphics/fb1/edid_modes
chown system graphics /sys/class/graphics/fb1/power_state
chmod 0664 /sys/class/graphics/fb1/hpd
chown system graphics /sys/class/graphics/fb1/hpd
chmod 0664 /sys/class/graphics/fb1/vendor_name
chown system graphics /sys/class/graphics/fb1/vendor_name
chmod 0664 /sys/class/graphics/fb1/product_description
chown system graphics /sys/class/graphics/fb1/product_description
chown system graphics /sys/class/graphics/fb1/hdcp_present
chown system graphics /sys/class/graphics/fb1/hdmi_mode
chmod 0660 /sys/class/graphics/fb1/power_state
# Change owner and group for media server and surface flinger
chown system system /sys/devices/virtual/graphics/fb1/format_3d
# Allow RIL daemon to assign port open fd_wakelock
chown system radio /sys/devices/virtual/sec/mdm_hsic_pm/waketime
#To allow interfaces to get v6 address when tethering is enabled
write /proc/sys/net/ipv6/conf/rmnet0/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet1/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet2/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet3/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet4/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet5/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet6/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet7/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet_usb0/accept_ra 2
# To prevent out of order acknowledgements from making
# connection tracking to treat them as not belonging to
# the connection they belong to.
# Otherwise, a weird issue happens in which some long
# connections on high-throughput links get dropped when
# an ack packet comes out of order
write /proc/sys/net/netfilter/nf_conntrack_tcp_be_liberal 1
# Set the console loglevel to < KERN_INFO
# Set the default message loglevel to KERN_INFO
# modified by SEC, SEC use a loglevel path with another way.
# write /proc/sys/kernel/printk "6 6 1 7"
# Flash storage isn't a good entropy source, and only causes locking
# overhead in the kernel. Turn it off.
write /sys/block/mmcblk0/queue/add_random 0
# MUIC
chown radio system /sys/class/sec/switch/usb_sel
chown radio system /sys/class/sec/switch/usb_state
chown radio system /sys/class/sec/switch/uart_sel
chown radio system /sys/class/sec/switch/chg_type
chown radio system /sys/class/sec/switch/apo_factory
chown system radio /sys/class/sec/switch/adc
chown system radio /sys/class/sec/switch/otg_test
# bcmtch15xxx TSP
chown system system /sys/class/input/input0/enabled
chown radio system /sys/devices/system/cpu/kernel_max
chmod 664 /sys/devices/system/cpu/kernel_max
chown radio system /sys/class/kgsl/kgsl-3d0/max_pwrlevel
chmod 664 /sys/class/kgsl/kgsl-3d0/max_pwrlevel
chown radio system /sys/class/kgsl/kgsl-3d0/min_pwrlevel
chmod 664 /sys/class/kgsl/kgsl-3d0/min_pwrlevel
chown radio system /sys/class/kgsl/kgsl-3d0/gpu_available_frequencies
chmod 664 /sys/class/kgsl/kgsl-3d0/gpu_available_frequencies
chown radio system /sys/class/devfreq/qcom,cpubw.43/available_frequencies
chmod 664 /sys/class/devfreq/qcom,cpubw.43/available_frequencies
chown radio system /sys/class/devfreq/qcom,cpubw.43/available_governors
chmod 664 /sys/class/devfreq/qcom,cpubw.43/available_governors
chown radio system /sys/class/devfreq/qcom,cpubw.43/governor
chmod 664 /sys/class/devfreq/qcom,cpubw.43/governor
chown radio system /sys/class/devfreq/qcom,cpubw.43/max_freq
chmod 664 /sys/class/devfreq/qcom,cpubw.43/max_freq
chown radio system /sys/class/devfreq/qcom,cpubw.43/min_freq
chmod 664 /sys/class/devfreq/qcom,cpubw.43/min_freq
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
# SEC PM sysfs node
chown system radio /sys/devices/system/soc/soc0/soc_iddq
chmod 0444 /sys/devices/system/soc/soc0/soc_iddq
chown system radio /sys/devices/system/soc/soc0/soc_pvs
chmod 0444 /sys/devices/system/soc/soc0/soc_pvs
# Assume SMP uses shared cpufreq policy for all CPUs
chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chmod 0660 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
# Auto Brightness
chown system system /sys/class/backlight/panel/auto_brightness
chmod 0660 /sys/class/backlight/panel/auto_brightness
# LCD mdnie and panel work
chown system system /sys/class/mdnie/mdnie/lcdtype
chown system system /sys/class/mdnie/mdnie/lcd_power
chown system system /sys/class/mdnie/mdnie/scenario
chmod 0660 /sys/class/mdnie/mdnie/scenario
chown system system /sys/class/mdnie/mdnie/tuning
chown system system /sys/class/mdnie/mdnie/outdoor
chown system system /sys/class/mdnie/mdnie/mdnie_temp
chown system system /sys/class/mdnie/mdnie/mode
chown system system /sys/class/mdnie/mdnie/negative
chown system system /sys/class/mdnie/mdnie/playspeed
chown system system /sys/class/mdnie/mdnie/accessibility
chown system system /sys/class/mdnie/mdnie/cabc
chown system system /sys/class/mdnie/mdnie/bypass
chown system system /sys/class/lcd/panel/window_type
chown radio system /sys/class/lcd/panel/power_reduce
chown radio system /sys/class/lcd/panel/siop_enable
chown radio system /sys/class/lcd/panel/temperature
chown radio system /sys/class/lcd/panel/tuning
chown system system /sys/class/lcd/panel/window_type
chown radio system /sys/class/lcd/panel/power_reduce
chown radio system /sys/class/lcd/panel/siop_enable
chown radio system /sys/class/lcd/panel/temperature
chown radio system /sys/class/lcd/panel/tuning
chown radio system /sys/class/lcd/panel/lux
chown radio system /sys/class/lcd/panel/partial_disp
chmod 0660 /sys/class/lcd/panel/partial_disp
# LCD DYNAMIC FPS USE TE
chown system system /sys/class/lcd/panel/dynamic_fps_use_te
chmod 0660 /sys/class/lcd/panel/dynamic_fps_use_te
# LCD HMT
chown radio system /sys/class/lcd/panel/hmt_on
chown radio system /sys/class/lcd/panel/hmt_bright
chown radio system /sys/class/lcd/panel/hmt_dual_scan
chown radio system /sys/class/lcd/panel/hmt_aid
chown radio system /sys/class/lcd/panel/hmt_change_fps
chown radio system /sys/class/lcd/panel/hmt_hbm
chown radio system /sys/class/lcd/panel/hmt
chown radio system /sys/class/lcd/panel/force_500cd
chmod 0660 /sys/class/lcd/panel/hmt_on
chmod 0660 /sys/class/lcd/panel/hmt_bright
chmod 0660 /sys/class/lcd/panel/hmt_dual_scan
chmod 0660 /sys/class/lcd/panel/hmt_aid
chmod 0660 /sys/class/lcd/panel/hmt_change_fps
chmod 0660 /sys/class/lcd/panel/hmt_hbm
chmod 0660 /sys/class/lcd/panel/hmt
# LCD ALPM Mode
chown system system /sys/class/lcd/panel/alpm
chmod 0660 /sys/class/lcd/panel/alpm
# Auto Brightness
chown system system /sys/class/backlight/panel/auto_brightness
chmod 0660 /sys/class/backlight/panel/auto_brightness
# Permissions for TCON
chown system system /sys/class/tcon/tcon/lux
chown system system /sys/class/tcon/tcon/auto_br
chown system media_rw /sys/class/tcon/tcon/mode
chown system radio /sys/class/tcon/tcon/black_test
chown system radio /sys/class/tcon/tcon/tcon_test
chown system system /sys/class/leds/keyboard-backlight/brightness
chown system system /sys/class/leds/lcd-backlight/brightness
chown system system /sys/class/leds/button-backlight/brightness
chown system system /sys/class/leds/jogball-backlight/brightness
chown system system /sys/class/leds/red/brightness
chown system system /sys/class/leds/green/brightness
chown system system /sys/class/leds/blue/brightness
chown system system /sys/class/leds/red/device/grpfreq
chown system system /sys/class/leds/red/device/grppwm
chown system system /sys/class/leds/red/device/blink
chown system system /sys/module/sco/parameters/disable_esco
chown system system /sys/kernel/ipv4/tcp_wmem_min
chown system system /sys/kernel/ipv4/tcp_wmem_def
chown system system /sys/kernel/ipv4/tcp_wmem_max
chown system system /sys/kernel/ipv4/tcp_rmem_min
chown system system /sys/kernel/ipv4/tcp_rmem_def
chown system system /sys/kernel/ipv4/tcp_rmem_max
chown root radio /proc/cmdline
# Adjust YUV to RGB Conversion(CSC_Conversion)
chown system media_rw /sys/class/graphics/fb0/csc_cfg
chmod 0660 /sys/class/graphics/fb0/csc_cfg
#OTG Test
chown system radio /sys/class/host_notify/usb_otg/booster
chmod 0660 /sys/class/host_notify/usb_otg/booster
#Essential node for usbservice
mkdir /dev/bus/ 0755 root root
mkdir /dev/bus/usb 0755 root root
# Permissions for InputDevices.
chown system radio /sys/class/sec/tsp/cmd
chown system system /sys/class/sec/sec_touchkey/brightness
chmod 0660 /sys/class/sec/tsp/input/enabled
chown system system /sys/class/sec/tsp/input/enabled
# Permissions for Camera
chown root system /sys/class/camera/rear/rear_camantibanding
chown system system /sys/class/camera/rear/rear_camfw
chown system system /sys/class/camera/rear/rear_camfw_full
chown system system /sys/class/camera/rear/rear_camfw_load
chown system radio /sys/class/camera/rear/rear_latest_module_check
chown system system /sys/class/camera/rear/rear_camtype
chown system system /sys/class/camera/rear/rear_corever
chown system system /sys/class/camera/rear/rear_companionfw_full
chown system system /sys/class/camera/rear/rear_calcheck
chown system system /sys/class/camera/rear/rear_fwcheck
chown system system /sys/class/camera/rear/isp_core
chown system radio /sys/class/camera/flash/rear_flash
chown system system /sys/class/camera/front/front_camfw
chown system system /sys/class/camera/front/front_camtype
#OTG Test
chown system radio /sys/class/host_notify/usb_otg/booster
chmod 0660 /sys/class/host_notify/usb_otg/booster
# Permissions for Audio
chown system system /sys/devices/fe12f000.slim/es705-codec-gen0/keyword_grammar_path
chown system system /sys/devices/fe12f000.slim/es705-codec-gen0/keyword_net_path
# Accelerometer_sensor
chown system radio /sys/class/sensors/accelerometer_sensor/raw_data
chown system radio /sys/class/sensors/accelerometer_sensor/calibration
chown system radio /sys/class/sensors/accelerometer_sensor/reactive_alert
chown system radio /sys/class/sensors/accelerometer_sensor/vendor
chown system radio /sys/class/sensors/accelerometer_sensor/name
chown system radio /sys/class/sensors/accelerometer_sensor/selftest
chown system radio /sys/class/sensors/accelerometer_sensor/lowpassfilter
# Proximity_sensor
chown system radio /sys/class/sensors/proximity_sensor/state
chown system radio /sys/class/sensors/proximity_sensor/raw_data
chown system radio /sys/class/sensors/proximity_sensor/prox_avg
chown system radio /sys/class/sensors/proximity_sensor/prox_cal
chown system radio /sys/class/sensors/proximity_sensor/prox_cal2
chown system radio /sys/class/sensors/proximity_sensor/prox_offset_pass
chown system radio /sys/class/sensors/proximity_sensor/prox_thresh
chown system radio /sys/class/sensors/proximity_sensor/vendor
chown system radio /sys/class/sensors/proximity_sensor/name
chown system radio /sys/class/sensors/proximity_sensor/thresh_high
chown system radio /sys/class/sensors/proximity_sensor/thresh_low
chown system radio /sys/class/sensors/proximity_sensor/barcode_emul_en
# Light_sensor
chown system radio /sys/class/sensors/light_sensor/lux
chown system radio /sys/class/sensors/light_sensor/raw_data
chown system radio /sys/class/sensors/light_sensor/vendor
chown system radio /sys/class/sensors/light_sensor/name
# Gyro_sensor
chown system radio /sys/class/sensors/gyro_sensor/power_on
chown system radio /sys/class/sensors/gyro_sensor/power_off
chown system radio /sys/class/sensors/gyro_sensor/temperature
chown system radio /sys/class/sensors/gyro_sensor/selftest
chown system radio /sys/class/sensors/gyro_sensor/selftest_dps
chown system radio /sys/class/sensors/gyro_sensor/vendor
chown system radio /sys/class/sensors/gyro_sensor/name
# Barometer_sensor
chown system radio /sys/class/sensors/barometer_sensor/sea_level_pressure
chown system radio /sys/class/sensors/barometer_sensor/vendor
chown system radio /sys/class/sensors/barometer_sensor/name
chown system radio /sys/class/sensors/barometer_sensor/calibration
chown system radio /sys/class/sensors/barometer_sensor/temperature
# Magnetic_sensor
chown system radio /sys/class/sensors/magnetic_sensor/selftest
chown system radio /sys/class/sensors/magnetic_sensor/raw_data
chown system radio /sys/class/sensors/magnetic_sensor/adc
chown system radio /sys/class/sensors/magnetic_sensor/dac
chown system radio /sys/class/sensors/magnetic_sensor/vendor
chown system radio /sys/class/sensors/magnetic_sensor/name
chown system radio /sys/class/sensors/magnetic_sensor/status
chown system input /system/etc/param.dat
chown system input /system/etc/alp_cal.dat
chown system system /system/etc/calib_SI_matrix_data_file.dat
# Temphumidity_sensor
chown system radio /sys/class/sensors/temphumidity_sensor/vendor
chown system radio /sys/class/sensors/temphumidity_sensor/name
chown system radio /sys/class/sensors/temphumidity_sensor/engine_ver
chown system radio /sys/class/sensors/temphumidity_sensor/engine_ver2
chown system radio /sys/class/sensors/temphumidity_sensor/cp_thm
chown system radio /sys/class/sensors/temphumidity_sensor/send_accuracy
chown system radio /sys/class/sensors/temphumidity_sensor/batt_temperature
# HRM_sensor
chown system radio /sys/class/sensors/hrm_sensor/eol_test
chown system radio /sys/class/sensors/hrm_sensor/eol_test_result
chown system radio /sys/class/sensors/hrm_sensor/eol_test_status
chown system radio /sys/class/sensors/hrm_sensor/hr_range
chown system radio /sys/class/sensors/hrm_sensor/hr_range2
chown system radio /sys/class/sensors/hrm_sensor/look_mode_ir
chown system radio /sys/class/sensors/hrm_sensor/look_mode_red
chown system radio /sys/class/sensors/hrm_sensor/led_current
chown system radio /sys/class/sensors/hrm_sensor/int_pin_check
chown system radio /sys/class/sensors/hrm_sensor/lib_ver
chown system radio /sys/class/sensors/hrm_sensor/hrm_flush
chown system radio /sys/class/sensors/hrm_sensor/eol_lib_ver
chown system radio /sys/class/sensors/hrm_sensor/elf_lib_ver
chown system radio /sys/class/sensors/hrm_sensor/adpd_reg_read
chown system radio /sys/class/sensors/hrm_sensor/adpd_reg_write
chown system radio /sys/class/sensors/hrm_sensor/adpd_mode
chown system radio /sys/class/sensors/hrm_sensor/adpd_configuration
chown system radio /sys/class/sensors/hrm_sensor/adpd_stat
chown system radio /sys/class/sensors/hrm_sensor/name
chown system radio /sys/class/sensors/hrm_sensor/vendor
chown system radio /sys/class/sensors/hrm_sensor/device_id
# UV_sensor
chown system radio /sys/class/sensors/uv_sensor/raw_data
# SensorHub
chown system radio /sys/class/sensors/ssp_sensor/enable
chown system radio /sys/class/sensors/ssp_sensor/mcu_rev
chown system radio /sys/class/sensors/ssp_sensor/mcu_name
chown system radio /sys/class/sensors/ssp_sensor/mcu_test
chown system radio /sys/class/sensors/ssp_sensor/mcu_reset
chown system radio /sys/class/sensors/ssp_sensor/mcu_update
chown system radio /sys/class/sensors/ssp_sensor/mcu_update2
chown system radio /sys/class/sensors/ssp_sensor/mcu_update_ums
chown system radio /sys/class/sensors/ssp_sensor/mcu_dump
chown system radio /sys/class/sensors/ssp_sensor/mcu_sleep_test
chown system radio /sys/class/sensors/ssp_sensor/ori_poll_delay
chown system radio /sys/class/sensors/ssp_sensor/mag_poll_delay
chown system radio /sys/class/sensors/ssp_sensor/uncal_mag_poll_delay
chown system radio /sys/class/sensors/ssp_sensor/temp_humi_poll_delay
chown system radio /sys/class/sensors/ssp_sensor/accel_poll_delay
chown system radio /sys/class/sensors/ssp_sensor/rot_poll_delay
chown system radio /sys/class/sensors/ssp_sensor/game_rot_poll_delay
chown system radio /sys/class/sensors/ssp_sensor/step_det_poll_delay
chown system radio /sys/class/sensors/ssp_sensor/gyro_poll_delay
chown system radio /sys/class/sensors/ssp_sensor/uncalib_gyro_poll_delay
chown system radio /sys/class/sensors/ssp_sensor/ssp_flush
chown system radio /sys/class/sensors/ssp_sensor/shake_cam
chmod 0600 /dev/batch_io
chown system system /dev/batch_io
# IIO devices for SensorHub
chown system system /sys/bus/iio/devices/iio:device0/buffer/length
chown system system /sys/bus/iio/devices/iio:device0/buffer/enable
chown system system /sys/bus/iio/devices/iio:device1/buffer/length
chown system system /sys/bus/iio/devices/iio:device1/buffer/enable
chown system system /sys/bus/iio/devices/iio:device2/buffer/length
chown system system /sys/bus/iio/devices/iio:device2/buffer/enable
chown system system /sys/bus/iio/devices/iio:device3/buffer/length
chown system system /sys/bus/iio/devices/iio:device3/buffer/enable
chown system system /sys/bus/iio/devices/iio:device4/buffer/length
chown system system /sys/bus/iio/devices/iio:device4/buffer/enable
chown system system /sys/bus/iio/devices/iio:device5/buffer/length
chown system system /sys/bus/iio/devices/iio:device5/buffer/enable
# Gesture_sensor
chown system radio /sys/class/sensors/gesture_sensor/vendor
chown system radio /sys/class/sensors/gesture_sensor/name
chown system radio /sys/class/sensors/gesture_sensor/raw_data
chown system radio /sys/class/sensors/gesture_sensor/ir_current
chown system radio /sys/class/sensors/gesture_sensor/selftest
# SHTC1 BULK
chmod 0600 /dev/shtc1_sensor
chown system system /dev/shtc1_sensor
# Permissions for SSRM
chmod 0664 /sys/devices/platform/sec-thermistor/temperature
chmod 0664 /sys/class/power_supply/battery/siop_level
chmod 0664 /sys/class/power_supply/battery/test_charge_current
chown radio system /sys/devices/platform/sec-thermistor/temperature
chown radio system /sys/class/power_supply/battery/siop_level
chown radio system /sys/class/power_supply/battery/test_charge_current
# MOBEAM
chown system radio /sys/class/sec/sec_barcode_emul/vendor
chown system radio /sys/class/sec/sec_barcode_emul/name
chown system radio /sys/class/sec/sec_barcode_emul/barcode_send
chown system radio /sys/class/sec/sec_barcode_emul/barcode_led_status
chown system radio /sys/class/sec/sec_barcode_emul/barcode_ver_check
# Permissions for Charging
chown system radio /sys/class/power_supply/battery/batt_reset_soc
chown system radio /sys/class/power_supply/battery/update
chown system radio /sys/class/power_supply/battery/factory_mode
chown system radio /sys/class/power_supply/battery/batt_slate_mode
chown sdcard_rw sdcard_rw /sys/class/power_supply/battery/call
chown sdcard_rw sdcard_rw /sys/class/power_supply/battery/video
chown sdcard_rw sdcard_rw /sys/class/power_supply/battery/music
chown sdcard_rw sdcard_rw /sys/class/power_supply/battery/browser
chown sdcard_rw sdcard_rw /sys/class/power_supply/battery/hotspot
chown sdcard_rw sdcard_rw /sys/class/power_supply/battery/camera
chown system radio /sys/class/power_supply/battery/talk_wcdma
chown system radio /sys/class/power_supply/battery/talk_gsm
chown system radio /sys/class/power_supply/battery/call
chown system radio /sys/class/power_supply/battery/data_call
chown system radio /sys/class/power_supply/battery/gps
chown system radio /sys/class/power_supply/battery/wifi
chown system radio /sys/class/power_supply/battery/lte
chown system radio /sys/class/power_supply/battery/wc_enable
chown system radio /sys/class/power_supply/battery/lcd
chown system radio /sys/class/power_supply/ps/status
chmod 0664 /sys/class/power_supply/ps/status
# Permission for fast dormancy for RIL
chown system radio /sys/devices/virtual/sec/bamdmux/waketime
# Permissions for gpio_keys
chown system radio /sys/class/sec/sec_key/wakeup_keys
write /sys/class/sec/sec_key/wakeup_keys 114,115,116,172
# Permissions for gpio_keys
chown system radio /sys/class/sec/sec_key/hall_irq_ctrl
# Assign TCP buffer thresholds to be ceiling value of technology maximums
# Increased technology maximums should be reflected here.
write /proc/sys/net/core/rmem_max 8388608
write /proc/sys/net/core/wmem_max 8388608
# HDCP 2.x
mkdir /data/system/hdcp2 0775 system system
# h2k permission
chown radio system /efs/redata.bin
chmod 0644 /efs/h2k.dat
mkdir /data/misc/radio/hatp 0775 radio system
# Vibrator
chmod 0660 /sys/class/timed_output/vibrator/pwm_value
chown system system /sys/class/timed_output/vibrator/pwm_value
chmod 0440 /sys/class/timed_output/vibrator/pwm_max
chown system system /sys/class/timed_output/vibrator/pwm_max
chmod 0440 /sys/class/timed_output/vibrator/pwm_min
chown system system /sys/class/timed_output/vibrator/pwm_min
chmod 0440 /sys/class/timed_output/vibrator/pwm_default
chown system system /sys/class/timed_output/vibrator/pwm_default
chmod 0440 /sys/class/timed_output/vibrator/pwm_threshold
chown system system /sys/class/timed_output/vibrator/pwm_threshold
chown system system /sys/class/timed_output/vibrator/enable
# Panel color temperature
chmod 0660 /sys/class/lcd/panel/panel_colors
chown system system /sys/class/lcd/panel/panel_colors
# permission for Input Device(Touchkey).
chmod 0660 /sys/class/input/input1/enabled
chown system system /sys/class/input/input1/enabled
chmod 0660 /sys/class/input/input2/enabled
chown system system /sys/class/input/input2/enabled
chown radio system /sys/class/sec/sec_touchkey/touch_sensitivity
chown radio system /sys/class/sec/sec_touchkey/touchkey_firm_update
chown system radio /sys/class/sec/sec_touchkey/glove_mode
chown system radio /sys/class/sec/sec_touchkey/flip_mode
chown system radio /sys/class/sec/sec_touchkey/1mm_mode
chown system radio /sys/class/sec/sec_touchkey/boost_level
# permissions for bluetooth.
setprop ro.bt.bdaddr_path "/efs/bluetooth/bt_addr"
chown bluetooth bluetooth ro.bt.bdaddr_path
chown bluetooth bluetooth /dev/ttyHS0
chmod 0660 /dev/ttyHS0
chmod 0660 /sys/class/rfkill/rfkill0/state
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
# bluetooth LPM
chmod 0660 /proc/bluetooth/sleep/lpm
chmod 0220 /proc/bluetooth/sleep/btwrite
chown bluetooth bluetooth /proc/bluetooth/sleep/lpm
chown bluetooth bluetooth /proc/bluetooth/sleep/btwrite
chmod 0600 /dev/btlock
chown bluetooth bluetooth /dev/btlock
# DualWave
chown system system /sys/kernel/DualWave/sound/DUALWAVE_CONFIG
# bluetooth LPM
chmod 0660 /proc/bluetooth/sleep/lpm
chmod 0220 /proc/bluetooth/sleep/btwrite
chown bluetooth bluetooth /proc/bluetooth/sleep/lpm
chown bluetooth bluetooth /proc/bluetooth/sleep/btwrite
# Sensors
chown system system /efs/prox_cal
chmod 0640 /efs/prox_cal
restorecon /efs/prox_cal
chown system system /efs/FactoryApp/baro_delta
chmod 0640 /efs/FactoryApp/baro_delta
restorecon /efs/FactoryApp/baro_delta
chown system system /efs/gyro_cal_data
chmod 0640 /efs/gyro_cal_data
restorecon /efs/gyro_cal_data
# Set permissions for firmware path control
chown wifi wifi /sys/module/dhd/parameters/firmware_path
chown wifi wifi /sys/module/dhd/parameters/nvram_path
# Wifi firmware reload path
chown wifi wifi /sys/module/bcmdhd/parameters/firmware_path
chown wifi wifi /sys/module/wlan/parameters/fwpath
# Services begin here
service adsprpcd /vendor/bin/adsprpcd
class main
user media
group media
service qcamerasvr /vendor/bin/mm-qcamera-daemon
class main
user camera
group camera system inet input graphics bluetooth
service qseecomd /vendor/bin/qseecomd
class core
user root
group root
service mpdecision /vendor/bin/mpdecision --avg_comp
class main
user root
group root readproc
disabled
service thermal-engine /vendor/bin/thermal-engine
class main
user root
socket thermal-send-client stream 0666 system system
socket thermal-recv-client stream 0660 system system
socket thermal-recv-passive-client stream 0666 system system
group root
service audiod /system/bin/audiod
class late_start
user system
group system
service irsc_util /vendor/bin/irsc_util "/vendor/etc/sec_config"
class main
user root
oneshot
service rfs_access /vendor/bin/rfs_access
class core
user system
group system net_raw
service rmt_storage /vendor/bin/rmt_storage
class core
user root
group system wakelock
service qmuxd /vendor/bin/qmuxd
class core
user radio
group radio audio bluetooth gps oem_2950 log
service macloader /vendor/bin/macloader
class late_start
oneshot
user system
group system wifi
seclabel u:r:macloader:s0
on property:wlan.driver.status=ok
start macloader
on property:sys.boot_completed=1
setprop sys.io.scheduler bfq
# Configure the hardware properly
write /sys/module/lpm_levels/enable_low_power/l2 4
write /sys/module/msm_pm/modes/cpu0/power_collapse/suspend_enabled 1
write /sys/module/msm_pm/modes/cpu1/power_collapse/suspend_enabled 1
write /sys/module/msm_pm/modes/cpu2/power_collapse/suspend_enabled 1
write /sys/module/msm_pm/modes/cpu3/power_collapse/suspend_enabled 1
write /sys/module/msm_pm/modes/cpu0/power_collapse/idle_enabled 1
write /sys/module/msm_pm/modes/cpu1/power_collapse/idle_enabled 1
write /sys/module/msm_pm/modes/cpu2/power_collapse/idle_enabled 1
write /sys/module/msm_pm/modes/cpu3/power_collapse/idle_enabled 1
write /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/suspend_enabled 1
write /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/suspend_enabled 1
write /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/suspend_enabled 1
write /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/suspend_enabled 1
write /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/idle_enabled 1
write /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/idle_enabled 1
write /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/idle_enabled 1
write /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/idle_enabled 1
write /sys/module/msm_pm/modes/cpu0/retention/idle_enabled 1
write /sys/module/msm_pm/modes/cpu1/retention/idle_enabled 1
write /sys/module/msm_pm/modes/cpu2/retention/idle_enabled 1
write /sys/module/msm_pm/modes/cpu3/retention/idle_enabled 1
write /sys/module/msm_pm/modes/cpu1/retention/suspend_enabled 1
write /sys/module/msm_pm/modes/cpu2/retention/suspend_enabled 1
write /sys/module/msm_pm/modes/cpu3/retention/suspend_enabled 1
write /sys/module/msm_thermal/core_control/enabled 0
# Bring all CPUs online, and set node permissions
write /sys/devices/system/cpu/cpu1/online 1
write /sys/devices/system/cpu/cpu2/online 1
write /sys/devices/system/cpu/cpu3/online 1
chmod 664 /sys/devices/system/cpu/cpu1/online
chmod 664 /sys/devices/system/cpu/cpu2/online
chmod 664 /sys/devices/system/cpu/cpu3/online
chown root system /sys/devices/system/cpu/cpu1/online
chown root system /sys/devices/system/cpu/cpu2/online
chown root system /sys/devices/system/cpu/cpu3/online
# Configure the CPU governor
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 "19000 1400000:39000 1700000:19000"
write /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load 99
write /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq 1497600
write /sys/devices/system/cpu/cpufreq/interactive/io_is_busy 1
write /sys/devices/system/cpu/cpufreq/interactive/target_loads "85 1500000:90 1800000:70"
write /sys/devices/system/cpu/cpufreq/interactive/min_sample_time 40000
write /sys/devices/system/cpu/cpufreq/interactive/timer_rate 30000
write /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor 100000
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 300000
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq 300000
write /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq 300000
write /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq 300000
write /sys/module/msm_thermal/core_control/enabled 1
# Configure the cpu-boost module
write /sys/module/cpu_boost/parameters/boost_ms 20
write /sys/module/cpu_boost/parameters/sync_threshold 1728000
write /sys/module/cpu_boost/parameters/input_boost_freq 1497600
write /sys/module/cpu_boost/parameters/input_boost_ms 40
# Post boot services
rm /data/system/perfd/default_values
start mpdecision
# Symlink directories to access telephony.db and preferred-apn.xml required by libsec-ril
symlink /data/user_de/0/com.android.providers.telephony/databases /data/data/com.android.providers.telephony/databases
symlink /data/user_de/0/com.android.providers.telephony/shared_prefs /data/data/com.android.providers.telephony/shared_prefs
restorecon /data/data/com.android.providers.telephony/databases
restorecon /data/data/com.android.providers.telephony/shared_prefs
service charger /system/bin/charger
class charger
user system
group system graphics input
capabilities SYS_BOOT
seclabel u:r:charger:s0
on property:persist.sys.ssr.restart_level=1
write /sys/module/subsystem_restart/parameters/restart_level 1
on property:persist.sys.ssr.restart_level=3
write /sys/module/subsystem_restart/parameters/restart_level 3
on property:service.bootanim.exit=1
#write /sys/module/rmnet_usb/parameters/dump_ctrl_msg 2
on property:apexd.status=ready
mount none /system/etc/swcodec/ld.config.txt /apex/com.android.media.swcodec/etc/ld.config.txt bind
service config_bluetooth /vendor/bin/init.qcom.bt.sh "onboot"
class core
user root
oneshot
service hciattach /vendor/bin/init.qcom.bt.sh
class late_start
user bluetooth
group bluetooth net_bt_admin oem_2950 radio
disabled
oneshot
## Properties start here
on property:vendor.bluetooth.hciattach=true
start hciattach
on property:vendor.bluetooth.hciattach=false
setprop vendor.bluetooth.status off
service wcnss-service /vendor/bin/wcnss_service
class main
user system
group system wifi oem_2950 radio
oneshot
service init-input-sh /vendor/bin/init.input.sh
class core
user root
group root
oneshot