blob: 03f2901c13e0f26ab9b165f989b9318e5ac4546b [file] [log] [blame]
# Copyright (c) 2011-2014, 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 "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
import /vendor/etc/init/hw/init.qcom.power.rc
on early-init
mount debugfs debugfs /sys/kernel/debug
# Turn off backlight on blank
write /sys/class/leds/lcd-backlight/trigger "backlight"
on early-boot
write /sys/kernel/boot_adsp/boot 1
# SSR setup
write /sys/bus/msm_subsys/devices/subsys0/restart_level "related"
write /sys/bus/msm_subsys/devices/subsys1/restart_level "related"
write /sys/bus/msm_subsys/devices/subsys2/restart_level "related"
write /sys/bus/msm_subsys/devices/subsys3/restart_level "related"
on init
# Set the property to indicate type of virtual display to 0
# 0 indicates that virtual display is not a Wifi display and that the
# session is not exercised through RemoteDisplay in the android framework
setprop persist.sys.wfd.virtual 0
on fs
mount_all /vendor/etc/fstab.qcom
# Apply current selinux contexts
restorecon_recursive /persist
# We chown/chmod /persist again so because mount is run as root + defaults
chown system system /persist
chmod 0771 /persist
mkdir /persist/data 0700 system system
mkdir /persist/data/sfs 0700 system system
mkdir /persist/data/tz 0700 system system
# 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-data
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 /data/usf 0700 system system
mkdir /data/media 0770 media_rw media_rw
# Create directory used by audio subsystem
mkdir /data/misc/audio 0770 audio audio
# Create directory for TZ Apps
mkdir /data/misc/qsee 0770 system system
# bluetooth
mkdir /data/misc/bluetooth 0770 bluetooth bluetooth
# Create directory used by sensor subsystem
mkdir /persist/sensors 0775 system root
write /persist/sensors/sensors_settings 1
chmod 0644 /persist/sensors/sensors_settings
chown system root /persist/sensors/sensors_settings
mkdir /data/misc/sensors 0775 system system
restorecon_recursive /data/misc/sensors
# Create the directories used by the Wireless subsystem
mkdir /data/vendor/wifi 0770 wifi wifi
mkdir /data/vendor/wifi/hostapd/ctrl 0770 wifi wifi
mkdir /data/vendor/wifi/wpa 0770 wifi wifi
mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi
mkdir /data/vendor/wifi/wpa_supplicant 0770 wifi wifi
# Create directories for Location services
mkdir /data/misc/location 0770 gps gps
mkdir /data/misc/location/mq 0770 gps gps
mkdir /data/misc/location/xtwifi 0770 gps gps
mkdir /data/misc/location/gpsone_d 0770 system gps
mkdir /data/misc/location/quipc 0770 gps gps
mkdir /data/misc/location/gsiff 0770 gps gps
# Create FM dir for patchdownloader
mkdir /data/misc/fm 0770 system system
chmod 0770 /data/misc/fm
# Create the directories used by CnE subsystem
mkdir /data/connectivity 0771 system system
chown system system /data/connectivity
# Create directory from IMS services
mkdir /data/shared 0755
chown system system /data/shared
# Create /data/vendor/time folder for time-services
mkdir /data/vendor/time/ 0700 system system
mkdir /data/audio/ 0770 media audio
# Create folder for mm-qcamera-daemon
mkdir /data/camera 0770 media camera
# camera sockets
mkdir /data/misc/camera 0770 camera camera
# Create PERFD deamon related dirs
mkdir /data/system/perfd 0770 root system
chmod 2770 /data/system/perfd
setprop vold.post_fs_data_done 1
on boot
# bluetooth
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/proto
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/proto
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
chmod 0660 /dev/ttyHS2
chown bluetooth bluetooth /dev/ttyHS2
# access permission for secure touch
chmod 0660 /sys/devices/f9923000.i2c/i2c-1/1-004a/secure_touch_enable
chmod 0440 /sys/devices/f9923000.i2c/i2c-1/1-004a/secure_touch
chown system drmrpc /sys/devices/f9923000.i2c/i2c-1/1-004a/secure_touch_enable
chown system drmrpc /sys/devices/f9923000.i2c/i2c-1/1-004a/secure_touch
chmod 0660 /sys/devices/f9924000.i2c/i2c-2/2-004a/secure_touch_enable
chmod 0440 /sys/devices/f9924000.i2c/i2c-2/2-004a/secure_touch
chown system drmrpc /sys/devices/f9924000.i2c/i2c-2/2-004a/secure_touch_enable
chown system drmrpc /sys/devices/f9924000.i2c/i2c-2/2-004a/secure_touch
chmod 0775 /persist
chmod 0444 /persist/board_date.bin
chown system root /persist/sns.reg
chmod 770 /persist/sns.reg
# 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
# Bluetooth
mkdir /persist/bluetooth 0770 bluetooth bluetooth
# Alarms
mkdir /persist/alarm 0770 system system
# Create NETMGR daemon socket area
mkdir /dev/socket/netmgr 0750 radio radio
# Charger
chown root system /sys/module/qpnp_charger/parameters/charger_monitor
chown root system /sys/class/power_supply/battery/input_current_max
chown root system /sys/class/power_supply/battery/input_current_trim
chown root system /sys/class/power_supply/battery/voltage_min
chmod 0644 /sys/module/qpnp_charger/parameters/charger_monitor
chmod 0644 /sys/class/power_supply/battery/input_current_max
chmod 0644 /sys/class/power_supply/battery/input_current_trim
chmod 0644 /sys/class/power_supply/battery/voltage_min
# Camera Recording
mkdir /dev/video
symlink /dev/video32 /dev/video/venus_dec
symlink /dev/video33 /dev/video/venus_enc
# Wifi firmware reload path
chown wifi wifi /sys/module/wlan/parameters/fwpath
# Allow usb charging to be disabled persistently
on property:persist.usb.chgdisabled=1
write /sys/class/power_supply/battery/charging_enabled 0
on property:persist.usb.chgdisabled=0
write /sys/class/power_supply/battery/charging_enabled 1
# bt_hsic_control
service bt_hsic_control /system/bin/sh /system/etc/hsic.control.bt.sh
user root
disabled
on property:bluetooth.hsic_ctrl=load_wlan
start bt_hsic_control
on property:bluetooth.hsic_ctrl=unbind_hsic
start bt_hsic_control
# start camera server as daemon
service qcamerasvr /vendor/bin/mm-qcamera-daemon
class late_start
user camera
group camera system inet input graphics gps
on property:sys.boot_completed=1
start qrngp
service rmt_storage /vendor/bin/rmt_storage
class core
user root
group system wakelock
service rfs_access /vendor/bin/rfs_access
class core
user system
group system net_raw
# QMUX must be in multiple groups to support external process connections
service qmuxd /vendor/bin/qmuxd
class main
user radio
group radio audio bluetooth gps diag oem_2950 system
service netmgrd /vendor/bin/netmgrd
class main
user root
group root wifi wakelock radio inet diag system
# QCOM sensor
service sensors /vendor/bin/sensors.qcom
class late_start
user root
group root system diag shell
service irsc_util /vendor/bin/irsc_util "/vendor/etc/sec_config"
class main
user root
oneshot
service wpa_supplicant /system/vendor/bin/hw/wpa_supplicant \
-O/data/vendor/wifi/wpa/sockets -puse_p2p_group_interface=1 \
-g@android:wpa_wlan0
# we will start as root and wpa_supplicant will switch to user wifi
# after setting up the capabilities required for WEXT
# user wifi
# group wifi inet keystore
interface android.hardware.wifi.supplicant@1.0::ISupplicant default
interface android.hardware.wifi.supplicant@1.1::ISupplicant default
class main
socket wpa_wlan0 dgram 660 wifi wifi
disabled
oneshot
service vendor.qseecomd /vendor/bin/qseecomd
class core
user root
group root
service qosmgrd /system/bin/qosmgr /system/etc/qosmgr_rules.xml
user system
group system
disabled
service thermal-engine /vendor/bin/thermal-engine
class main
user root
group root radio
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
service time_daemon /vendor/bin/time_daemon
class late_start
user system
group net_raw
capabilities SYS_TIME
service adsprpcd /vendor/bin/adsprpcd
class main
user media
group media
service imsqmidaemon /system/bin/imsqmidaemon
class main
user system
socket ims_qmid stream 0660 system radio
group radio net_raw log oem_2950
service imsdatadaemon /system/bin/imsdatadaemon
class main
user system
socket ims_datad stream 0660 system radio
group system wifi radio inet net_raw log oem_2950 net_admin
disabled
service wcnss-service /vendor/bin/wcnss_service
class hal
user system
group system wifi radio
oneshot
on property:sys.ims.QMI_DAEMON_STATUS=1
start imsdatadaemon
service ims_rtp_daemon /system/bin/ims_rtp_daemon
class main
user system
socket ims_rtpd stream 0660 system radio
group radio net_raw diag oem_2950 log
disabled
service imscmservice /system/bin/imscmservice
class main
user system
group radio net_raw diag oem_2950 log
disabled
service ril-daemon1 /vendor/bin/hw/rild -c 2
class main
user radio
group radio cache inet misc audio log readproc wakelock diag system root
capabilities BLOCK_SUSPEND NET_ADMIN NET_RAW
on property:vold.decrypt=trigger_restart_framework
start wcnss-service
service hciattach /vendor/bin/init.qcom.bt.sh
class late_start
user bluetooth
group bluetooth net_bt_admin oem_2950 diag radio
seclabel u:r:bluetooth_loader:s0
disabled
oneshot
on property:vendor.bluetooth.hciattach=true
start hciattach
on property:vendor.bluetooth.hciattach=false
setprop vendor.bluetooth.status off
on property:sys.ims.DATA_DAEMON_STATUS=1
start ims_rtp_daemon
start imscmservice
service ppd /vendor/bin/mm-pp-daemon
class late_start
disabled
user system
socket pps stream 0660 system system
group system graphics
on property:init.svc.surfaceflinger=stopped
stop ppd
on property:init.svc.surfaceflinger=running
start ppd
service charger /system/bin/charger
class charger
user root
group system graphics input
capabilities SYS_BOOT
critical
seclabel u:r:charger:s0
service TCMDServer /system/bin/TCMDServer
class main
group root
user root
service loc_launcher /vendor/bin/loc_launcher
#loc_launcher will start as root and set its uid to gps
class late_start
group gps inet net_raw diag oem_2950 net_admin wifi
service vendor.fm /vendor/bin/init.qti.fm.sh
class late_start
user root
group system
disabled
oneshot
service bugreport /system/bin/dumpstate -d -p -B -z \
-o /data/user_de/0/com.android.shell/files/bugreports/bugreport
class main
disabled
oneshot
keycodes 114 115 116
on property:apexd.status=ready
mount none /system/etc/swcodec/ld.config.txt /apex/com.android.media.swcodec/etc/ld.config.txt bind