device_xiaomi_sm6150-common/rootdir/etc/init.qcom.rc
Dhananjay Kumar a25e0e9265
sm6150-common: rootdir: Update audio hal service override as per latest base service definition
Change-Id: I1c57ad2e448a95230a4adfff8fba94ffb0cddead
2021-06-18 18:32:31 +02:00

318 lines
11 KiB
Plaintext

# Copyright (c) 2009-2012, 2014-2019, 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.
#
import /vendor/etc/init/hw/init.qcom.usb.rc
import /vendor/etc/init/hw/init.target.rc
on early-init
mount debugfs debugfs /sys/kernel/debug
chmod 0755 /sys/kernel/debug
chmod 0755 /sys/kernel/debug/tracing
mount tracefs tracefs /sys/kernel/tracing
chmod 0755 /sys/kernel/tracing
# Change ownership of hw_recovery related nodes
chown system graphics /sys/kernel/debug/dri/0/debug/dump
chown system graphics /sys/kernel/debug/dri/0/debug/recovery_reg
chown system graphics /sys/kernel/debug/dri/0/debug/recovery_dbgbus
chown system graphics /sys/kernel/debug/dri/0/debug/recovery_vbif_dbgbus
# Change ownership of sysfs power control node
chown system graphics /sys/class/drm/card0/device/power/control
# Disable UFS clock scaling
write /sys/bus/platform/devices/1d84000.ufshc/clkscale_enable 0
on init
# Create cgroup mount point for memory
mkdir /sys/fs/cgroup/memory/bg 0750 root system
write /sys/fs/cgroup/memory/bg/memory.swappiness 140
write /sys/fs/cgroup/memory/bg/memory.move_charge_at_immigrate 1
chown root system /sys/fs/cgroup/memory/bg/tasks
chmod 0660 /sys/fs/cgroup/memory/bg/tasks
on early-boot
# set RLIMIT_MEMLOCK to 64MB
setrlimit 8 67108864 67108864
# Allow subsystem (modem etc) debugging
write /sys/kernel/boot_adsp/boot 1
write /sys/kernel/boot_cdsp/boot 1
write /sys/devices/virtual/npu/msm_npu/boot 1
write /sys/devices/virtual/cvp/cvp/boot 1
write /sys/class/drm/card0-DSI-1/status "detect"
write /sys/module/drm/parameters/vblankoffdelay -1
chown system graphics /sys/devices/virtual/hdcp/msm_hdcp/min_level_change
chmod 0660 /sys/devices/virtual/hdcp/msm_hdcp/min_level_change
# 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"
write /sys/bus/msm_subsys/devices/subsys4/restart_level "related"
write /sys/bus/msm_subsys/devices/subsys5/restart_level "related"
write /sys/bus/msm_subsys/devices/subsys6/restart_level "related"
write /sys/bus/msm_subsys/devices/subsys7/restart_level "related"
write /sys/bus/msm_subsys/devices/subsys8/restart_level "related"
on boot
chown bluetooth net_bt /sys/class/rfkill/rfkill0/state
chown bluetooth net_bt /sys/class/rfkill/rfkill0/type
chmod 0660 /sys/class/rfkill/rfkill0/state
chmod 0660 /sys/class/rfkill/rfkill0/type
chown bluetooth net_bt /dev/ttyHS0
chmod 0660 /dev/ttyHS0
chown bluetooth net_bt /sys/class/rfkill/rfkill0/device/extldo
chmod 0660 /sys/class/rfkill/rfkill0/device/extldo
chown system system /sys/kernel/boot_slpi/ssr
# This location is used by QCRIL to host UNIX domain
# socket files used for internal IPC within QCRIL
# modules
mkdir /dev/socket/qmux_radio 2770 radio radio
# 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
write /proc/sys/kernel/printk "6 6 1 7"
# bond0 used by FST Manager
chown wifi wifi /sys/class/net/bond0/bonding/queue_id
# Create directory used for display
mkdir /mnt/vendor/persist/display 0770 system graphics
# Create vpp directory
mkdir /mnt/vendor/persist/vpp 0770 media media
# Create hvdcp_opti directory
mkdir /mnt/vendor/persist/hvdcp_opti 0770 root system
# limit discard size to 128MB in order to avoid long IO latency
write /sys/block/sda/queue/discard_max_bytes 134217728
chown system system /sys/class/backlight/panel0-backlight/brightness
chown system system /sys/class/backlight/panel0-backlight/max_brightness
# Enable qcrild and data services
enable vendor.qcrild
enable vendor.qcrild2
enable vendor.dataqti
enable vendor.dataadpl
on post-fs-data
# Create directory used by display clients
mkdir /data/vendor/display 0770 system graphics
# Change lm related dirs
mkdir /data/vendor/lm 0700 root root
# Create directory used by media clients
mkdir /data/vendor/media 0770 mediacodec media
# Create /data/vendor/tzstorage directory for SFS listener
mkdir /data/vendor/tzstorage 0770 system system
# Create folder of camera
mkdir /data/vendor/camera 0770 camera camera
# Create directory for tftp
mkdir /data/vendor/tombstones 0771 system system
mkdir /data/vendor/tombstones/rfs 0771 system system
# Create directory for bluetooth
mkdir /data/vendor/bluetooth 0770 bluetooth bluetooth
# Create the directories used by the Wireless subsystem
mkdir /data/vendor/wifi 0770 wifi wifi
mkdir /data/vendor/wifi/sockets 0770 wifi wifi
mkdir /data/vendor/wifi/hostapd 0770 wifi wifi
mkdir /data/vendor/wifi/hostapd/ctrl 0770 wifi wifi
mkdir /data/vendor/wifi/wpa_supplicant 0770 wifi wifi
mkdir /data/vendor/wifi/wigig_hostapd 0770 wifi wifi
mkdir /data/vendor/wifi/wpa 0770 wifi wifi
mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi
mkdir /data/vendor/mac_addr 0770 system wifi
# Create the directories used by CnE subsystem
mkdir /data/vendor/connectivity 0771 radio radio
# Create directory used by audio subsystem
mkdir /data/vendor/audio 0770 audio audio
mkdir /data/vendor/audio/acdbdata 0770 media audio
mkdir /data/vendor/audio/acdbdata/delta 0770 media audio
# Create directory for radio
mkdir /data/vendor/radio 0770 system radio
rm /data/vendor/radio/shmbus
# Create directory for modem_config
mkdir /data/vendor/modem_config 0570 radio root
# Create directories for Location services
mkdir /data/vendor/location 0770 gps gps
mkdir /data/vendor/location/mq 0770 gps gps
mkdir /data/vendor/location/xtwifi 0770 gps gps
mkdir /dev/socket/location 0770 gps gps
mkdir /dev/socket/location/mq 0770 gps gps
mkdir /dev/socket/location/xtra 0770 gps gps
# Create directories for wifihal services
mkdir /dev/socket/wifihal 2770 wifi wifi
# Create /data/vendor/time folder for time-services
mkdir /data/vendor/time 0700 system system
# Create FM dir for patchdownloader
mkdir /data/vendor/fm 0770 system system
chmod 0770 /data/vendor/fm
# Create PERFD deamon related dirs
mkdir /data/vendor/perfd 2770 root system
rm /data/vendor/perfd/default_values
# Mark the copy complete flag to not completed
write /data/vendor/radio/copy_complete 0
chown radio radio /data/vendor/radio/copy_complete
chmod 0660 /data/vendor/radio/copy_complete
# Copy prebuilt qcril.db files always
copy /vendor/radio/qcril_database/qcril.db /data/vendor/radio/qcril_prebuilt.db
chown radio radio /data/vendor/radio/qcril_prebuilt.db
chmod 0660 /data/vendor/radio/qcril_prebuilt.db
# Create vpp directory
mkdir /data/vendor/vpp 0770 media media
# Make MTU adjusting
write /proc/sys/net/ipv4/tcp_mtu_probing 1
setprop vold.post_fs_data_done 1
on property:sys.boot_completed=1
# Enable UFS clock scaling back
write /sys/bus/platform/devices/1d84000.ufshc/clkscale_enable 1
chown media audio /sys/kernel/wdsp0/boot
start vendor.qcom-post-boot
service vendor.qrtr-ns /vendor/bin/qrtr-ns -f
class core
user vendor_qrtr
group vendor_qrtr
capabilities NET_BIND_SERVICE
writepid /dev/cpuset/system-background/tasks
service irsc_util /vendor/bin/irsc_util "/vendor/etc/sec_config"
class core
user root
oneshot
writepid /dev/cpuset/system-background/tasks
service vendor.cnss-daemon /vendor/bin/cnss-daemon -n -l
class late_start
user system
group system inet net_admin wifi
capabilities NET_ADMIN
writepid /dev/cpuset/system-background/tasks
on property:sys.shutdown.requested=*
write /sys/kernel/shutdown_wlan/shutdown 1
stop cnss-daemon
service vendor.loc_launcher /vendor/bin/loc_launcher
class late_start
user gps
group gps
writepid /dev/cpuset/system-background/tasks
service vendor.qcom-sh /vendor/bin/init.qcom.sh
class late_start
user root
group root system radio
oneshot
service vendor.qcom-post-boot /vendor/bin/init.qcom.post_boot.sh
class late_start
user root
group root system wakelock graphics
disabled
oneshot
on property:ro.vendor.ril.mbn_copy_completed=1
write /data/vendor/radio/copy_complete 1
service charger /system/bin/charger
class charger
user system
group system graphics input
capabilities SYS_BOOT
seclabel u:r:charger:s0
service vendor.msm_irqbalance /vendor/bin/msm_irqbalance -f /vendor/etc/msm_irqbalance.conf
class core
user root
group root
writepid /dev/cpuset/system-background/tasks
service vendor.power_off_alarm /vendor/bin/power_off_alarm
class core
group system
oneshot
service vendor.power /vendor/bin/hw/android.hardware.power-service-qti
override
class hal
user system
group system input
service vendor.audio-hal /vendor/bin/hw/android.hardware.audio.service
override
class hal
user audioserver
# media gid needed for /dev/fm (radio) and for /data/misc/media (tee)
group audio camera drmrpc inet media mediadrm net_bt net_bt_admin net_bw_acct oem_2901 wakelock
capabilities BLOCK_SUSPEND
ioprio rt 4
writepid /dev/cpuset/foreground/tasks /dev/stune/foreground/tasks
socket audio_hw_socket seqpacket 0666 system system
onrestart restart audioserver