# # Copyright 2012 The Android Open Source Project # Copyright (C) 2013 The CyanogenMod Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # import /init.device.rc import /init.sony.usb.rc import /init.qcom.power.rc import /init.camera.rc on early-init mount debugfs debugfs /sys/kernel/debug chown system system /sys/kernel/debug/kgsl/proc echo 8 8 8 8 > /proc/sys/kernel/printk on init symlink /dev/block/platform/msm_sdcc.1 /dev/block/bootdevice # Enable subsystem restart write /sys/module/subsystem_restart/parameters/enable_ramdumps 0 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" # for backwards compatibility symlink /sdcard /mnt/sdcard symlink /sdcard /storage/sdcard0 mkdir /tmp mount tmpfs tmpfs /tmp nosuid mode=0755,uid=0,gid=0 chmod 0664 /proc/rdtag chown root system /proc/rdtag mkdir /dev/bus 0755 root root mkdir /dev/bus/usb 0755 root root wait /dev/block/mmcblk0p1 chown tad tad /dev/block/mmcblk0p1 chmod 0770 /dev/block/mmcblk0p1 # Bluetooth address setting setprop ro.bt.bdaddr_path "/data/etc/bluetooth_bdaddr" chown bluetooth bluetooth ${ro.bt.bdaddr_path} # bluetooth LPM chown bluetooth net_bt_stack /proc/bluetooth/sleep/lpm chown bluetooth net_bt_stack /proc/bluetooth/sleep/btwrite write /sys/module/qpnp_rtc/parameters/poweron_alarm 1 # Enable panic on out of memory write /proc/sys/vm/panic_on_oom 2 # Setup zram options write /sys/block/zram0/comp_algorithm lz4 # Create a tmpfs for dynamic network mounting mkdir /storage/removable/remote 0700 root system mount tmpfs tmpfs /storage/removable/remote mode=0755,uid=0,gid=0 # 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 ./fstab.qcom mkdir /lta-label 0555 system system wait /dev/block/platform/msm_sdcc.1/by-name/LTALabel mount ext4 /dev/block/platform/msm_sdcc.1/by-name/LTALabel /lta-label nosuid nodev noatime noexec ro barrier=0 chown system system /lta-label chmod 0555 /lta-label # Mount ZRAM swapon_all fstab.qcom on early-boot # set RLIMIT_MEMLOCK to 64MB setrlimit 8 67108864 67108864 write /sys/kernel/boot_adsp/boot 1 # Run pre_hw_config.sh before entering charge only mode. exec /system/bin/sh /system/etc/pre_hw_config.sh on boot write /sys/module/qpnp_power_on/parameters/forcecrash_on 1 chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/type chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/state chmod 0660 /sys/class/rfkill/rfkill0/state chown bluetooth net_bt_stack /dev/ttyHS0 chmod 0660 /dev/ttyHS0 chown bluetooth net_bt_stack /sys/devices/platform/msm_serial_hs.0/clock chmod 0660 /sys/devices/platform/msm_serial_hs.0/clock # Create PERFD deamon related dirs mkdir /data/misc/perfd 0755 root system chmod 2755 /data/misc/perfd mkdir /data/system/perfd 0770 root system chmod 2770 /data/system/perfd #Create NETMGR daemon socket area mkdir /dev/socket/netmgr 0750 radio radio setprop ro.telephony.call_ring.multiple false # port-bridge chmod 0660 /dev/smd0 chown system system /dev/smd0 chmod 0444 /sys/devices/platform/msm_hsusb/gadget/usb_state # Graphics chown system graphics /sys/class/graphics/fb0/idle_time chmod 0664 /sys/devices/virtual/graphics/fb0/idle_time chown system graphics /sys/class/graphics/fb0/dynamic_fps chmod 0664 /sys/devices/virtual/graphics/fb0/dynamic_fps chown system graphics /sys/class/graphics/fb0/dyn_pu chmod 0664 /sys/devices/virtual/graphics/fb0/dyn_pu chown system graphics /sys/class/graphics/fb0/modes chmod 0664 /sys/devices/virtual/graphics/fb0/modes chown system graphics /sys/class/graphics/fb0/mode chmod 0664 /sys/devices/virtual/graphics/fb0/mode chown system graphics /sys/class/graphics/fb1/hpd chmod 0664 /sys/devices/virtual/graphics/fb1/hpd chown system graphics /sys/class/graphics/fb1/res_info chmod 0664 /sys/devices/virtual/graphics/fb1/res_info chown system graphics /sys/class/graphics/fb1/vendor_name chmod 0664 /sys/devices/virtual/graphics/fb1/vendor_name chown system graphics /sys/class/graphics/fb1/product_description chmod 0664 /sys/devices/virtual/graphics/fb1/product_description chown system graphics /sys/class/graphics/fb1/video_mode chmod 0664 /sys/devices/virtual/graphics/fb1/video_mode chown system graphics /sys/class/graphics/fb1/format_3d chmod 0664 /sys/devices/virtual/graphics/fb1/format_3d chown system graphics /sys/class/graphics/fb1/s3d_mode chmod 0664 /sys/devices/virtual/graphics/fb1/s3d_mode chown system graphics /sys/class/graphics/fb1/cec/enable chmod 0664 /sys/devices/virtual/graphics/fb1/cec/enable chown system graphics /sys/class/graphics/fb1/cec/logical_addr chmod 0664 /sys/devices/virtual/graphics/fb1/cec/logical_addr chown system graphics /sys/class/graphics/fb1/cec/rd_msg chmod 0664 /sys/devices/virtual/graphics/fb1/cec/rd_msg chown system graphics /sys/class/graphics/fb1/pa chmod 0664 /sys/devices/virtual/graphics/fb1/pa chown system graphics /sys/class/graphics/fb1/cec/wr_msg chmod 0664 /sys/devices/virtual/graphics/fb1/cec/wr_msg chown system graphics /sys/class/graphics/fb1/hdcp/tp chmod 0664 /sys/devices/virtual/graphics/fb1/hdcp/tp # create symlink for fb1 as HDMI symlink /dev/graphics/fb1 /dev/graphics/hdmi # Change owner and group to get adopter/device ids from MHL driver chown system system /sys/class/mhl/sii8334/adopter_id chown system system /sys/class/mhl/sii8334/device_id # For bridgemgr daemon to inform the USB driver of the correct transport chown radio radio /sys/class/android_usb/f_rmnet_smd_sdio/transport # For setting tcp delayed ack chown system system /sys/kernel/ipv4/tcp_delack_seg chown system system /sys/kernel/ipv4/tcp_use_userconfig # Define TCP delayed ack settings for WiFi & LTE 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 # 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 2097152 write /proc/sys/net/core/wmem_max 2097152 chmod 660 /dev/rtc0 chown system system /dev/rtc0 # Enable DEBUG_SUSPEND, DEBUG_EXIT_SUSPEND, and DEBUG_WAKEUP write /sys/module/wakelock/parameters/debug_mask 7 # 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_sdio0/accept_ra 2 write /proc/sys/net/ipv6/conf/rmnet_sdio1/accept_ra 2 write /proc/sys/net/ipv6/conf/rmnet_sdio2/accept_ra 2 write /proc/sys/net/ipv6/conf/rmnet_sdio3/accept_ra 2 write /proc/sys/net/ipv6/conf/rmnet_sdio4/accept_ra 2 write /proc/sys/net/ipv6/conf/rmnet_sdio5/accept_ra 2 write /proc/sys/net/ipv6/conf/rmnet_sdio6/accept_ra 2 write /proc/sys/net/ipv6/conf/rmnet_sdio7/accept_ra 2 write /proc/sys/net/ipv6/conf/rmnet_usb0/accept_ra 2 write /proc/sys/net/ipv6/conf/rmnet_usb1/accept_ra 2 write /proc/sys/net/ipv6/conf/rmnet_usb2/accept_ra 2 write /proc/sys/net/ipv6/conf/rmnet_usb3/accept_ra 2 write /proc/sys/net/ipv6/conf/rmnet_usb0/accept_ra 2 write /proc/sys/net/ipv6/conf/rmnet_usb1/accept_ra 2 write /proc/sys/net/ipv6/conf/rmnet_usb2/accept_ra 2 write /proc/sys/net/ipv6/conf/rmnet_usb3/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 write /proc/sys/kernel/printk "6 6 1 7" chown system /sys/devices/virtual/timed_output/vibrator/vtg_level # 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 # thermananger chmod 0644 /sys/class/power_supply/usb/current_max chown system system /sys/devices/virtual/graphics/fb0/rgb chmod 0660 /sys/devices/virtual/graphics/fb0/rgb on post-fs #export LD_PRELOAD libNimsWrap.so # MHL driver. To support MHL power off charge, # the insmod must be done before chargemon. insmod /system/lib/modules/mhl_sii8620_8061_drv.ko exec /system/bin/chargemon write /sys/class/power_supply/battery/shutdown_at_low_batt 1 # Change to socket location on libkeyctrl/suntory for /data encryption # Create suntory data directory mkdir /dev/socket/suntory 0755 system system mkdir /data/suntory 0755 system system # led RGB chown system system /sys/class/leds/rgb/sync_state chown system system /sys/class/leds/rgb/start_blink chown system system /sys/class/leds/led:rgb_red/brightness chown system system /sys/class/leds/led:rgb_red/lut_pwm chown system system /sys/class/leds/led:rgb_red/step_duration chown system system /sys/class/leds/led:rgb_red/pause_lo_multi chown system system /sys/class/leds/led:rgb_red/pause_hi_multi chown system system /sys/class/leds/led:rgb_green/brightness chown system system /sys/class/leds/led:rgb_green/lut_pwm chown system system /sys/class/leds/led:rgb_green/step_duration chown system system /sys/class/leds/led:rgb_green/pause_lo_multi chown system system /sys/class/leds/led:rgb_green/pause_hi_multi chown system system /sys/class/leds/led:rgb_blue/brightness chown system system /sys/class/leds/led:rgb_blue/lut_pwm chown system system /sys/class/leds/led:rgb_blue/step_duration chown system system /sys/class/leds/led:rgb_blue/pause_lo_multi chown system system /sys/class/leds/led:rgb_blue/pause_hi_multi on post-fs-data # create directory for DRM plug-ins - give drm the read/write access to # the following directory. mkdir /data/drm 0770 drm drm # create directory for MediaDrm plug-ins - give drm the read/write access to # the following directory. mkdir /data/mediadrm 0770 mediadrm mediadrm # Create the directories used by the Wireless subsystem mkdir /data/misc/wifi 0770 wifi wifi mkdir /data/misc/wifi/sockets 0770 wifi wifi mkdir /data/misc/wifi/wpa_supplicant 0770 wifi wifi mkdir /data/misc/dhcp 0770 dhcp dhcp # to observe dnsmasq.leases file for dhcp information of soft ap. chown dhcp dhcp /data/misc/dhcp mkdir /data/tombstones 0755 system system mkdir /data/tombstones/vendor 0755 system system mkdir /data/pc 0700 radio radio # Create directory used by audio subsystem mkdir /data/misc/audio 0770 audio audio # IR Blaster chown system system /dev/ttyHSL2 chmod 0660 /dev/ttyHSL2 chown system system /sys/devices/platform/ir_remote_control/enable chmod 0220 /sys/devices/platform/ir_remote_control/enable 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 # NFC local data and nfcee xml storage mkdir /data/nfc 0770 nfc nfc mkdir /data/nfc/param 0770 nfc nfc # QCOM Sensors mkdir /data/system 0775 system system mkdir /data/system/sensors 0775 system system mkdir /data/misc/sensors 0775 system system write /data/system/sensors/settings 1 chmod 664 /data/system/sensors/settings chown system /data/system/sensors/settings # 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 chown system system /sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/pwrscale/policy # Create directories for gpsone_daemon services mkdir /data/misc/gpsone_d 0770 system gps # Create directories for QuIPS mkdir /data/misc/quipc 0770 gps system # 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 # Provide the access to hostapd.conf only to root and group chmod 0660 /data/hostapd/hostapd.conf mkdir /data/audio 0770 media audio # Create /data/time folder for time-services mkdir /data/time 0700 system system # Enable Power save functionality for modem setprop persist.radio.add_power_save 1 chown system /dev/block/platform/msm_sdcc.1/by-name setprop vold.post_fs_data_done 1 # communicate with mpdecision and thermald mkdir /dev/socket/mpdecision 0770 system system chmod 2770 /dev/socket/mpdecision # SONY: Create a dir on data partition not to be deleted during mr and wipedata mkdir /data/persist 0770 system system # SONY: Create dir for Widevine keybox mkdir /data/persist/wv 0700 system system # SONY: Create dir for marlin sdata mkdir /data/persist/marlin 0700 system system # SONY: Create a dir for pin-cache components mkdir /data/pc 0600 radio radio mkdir /cache/pc 0770 radio system exec u:r:qti_init_shell:s0 -- /system/bin/rm -r /idd/lost+found mkdir /idd/lost+found 0770 root root mkdir /idd/output 0755 idd idd mkdir /idd/socket 0711 idd idd restorecon_recursive /idd start wvkbd_installer on property:init.svc.wpa_supplicant=stopped stop dhcpcd # QMUX must be in multiple groups to support external process connections service qmuxd /system/bin/qmuxd class main user root group radio audio bluetooth gps nfc diag qcom_diag service netmgrd /system/bin/netmgrd class main on property:ro.radio.noril=true stop ril-daemon stop netmgrd # start GNS/Sensor interface daemon service gsiff_daemon /system/bin/gsiff_daemon class late_start user gps group gps net_raw misc service qseecomd /system/bin/qseecomd class core user root group drmpc root service p2p_supplicant /system/bin/wpa_supplicant \ -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \ -I/system/etc/wifi/wpa_supplicant_overlay.conf -N \ -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf \ -I/system/etc/wifi/p2p_supplicant_overlay.conf \ -puse_p2p_group_interface=1 -e/data/misc/wifi/entropy.bin \ -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 class main socket wpa_wlan0 dgram 660 wifi wifi disabled oneshot service wpa_supplicant /system/bin/wpa_supplicant \ -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \ -I/system/etc/wifi/wpa_supplicant_overlay.conf \ -e/data/misc/wifi/entropy.bin -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 class main socket wpa_wlan0 dgram 660 wifi wifi disabled oneshot service dhcpcd_wlan0 /system/bin/dhcpcd -aABDKL class late_start disabled oneshot service dhcpcd_p2p /system/bin/dhcpcd -aABKL class late_start disabled oneshot service iprenew_wlan0 /system/bin/dhcpcd -n class late_start disabled oneshot service iprenew_p2p /system/bin/dhcpcd -n class late_start disabled oneshot service dhcpcd_bnep0 /system/bin/dhcpcd -BKLG disabled oneshot service dhcpcd_bnep1 /system/bin/dhcpcd -BKLG disabled oneshot service dhcpcd_bnep2 /system/bin/dhcpcd -BKLG disabled oneshot service dhcpcd_bnep3 /system/bin/dhcpcd -BKLG disabled oneshot service dhcpcd_bnep4 /system/bin/dhcpcd -BKLG disabled oneshot service dhcpcd_bt-pan /system/bin/dhcpcd -BKLG disabled oneshot service iprenew_bt-pan /system/bin/dhcpcd -n disabled oneshot on property:ro.data.large_tcp_window_size=true # Adjust socket buffer to enlarge TCP receive window for high bandwidth (e.g. DO-RevB) write /proc/sys/net/ipv4/tcp_adv_win_scale 2 service mpdecision /system/bin/mpdecision --avg_comp class main user root group system disabled on property:gsm.nitz.time=* start scdnotifier_nitz on property:dev.bootcomplete=1 rm /data/system/perfd/default_values start mpdecision # Start suntrold service suntrold /system/bin/suntrold user system group system oneshot class main # 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 class main disabled oneshot keycodes 114 115 116 # Modem Log QMI service service mlog_qmi_service /system/bin/mlog_qmi_service user root class main disabled # Thermal Manager service service thermanager /system/bin/thermanager /system/etc/thermanager.xml class main user root group root service irsc_util /system/bin/irsc_util "/etc/sec_config" class main user root oneshot service sensors /system/bin/sensors.qcom class main user root group root service qcom-sensor-sh /system/bin/sh /system/etc/init.qcom-sensor.sh class main user root oneshot service time_daemon /system/bin/time_daemon class late_start user root group root radio qcom_diag service charger /sbin/healthd -c class charger seclabel u:r:healthd:s0 service tfa9890_amp /system/bin/tfa9890_amp class main user media group audio oneshot ioprio rt 4 service audiod /system/bin/audiod class late_start user system group system # Redefined Service service audioserver /system/bin/audioserver class main user audioserver # media gid needed for /dev/fm (radio) and for /data/misc/media (tee) group audio trimarea camera drmrpc inet media mediadrm net_bt net_bt_admin net_bw_acct qcom_diag ioprio rt 4 service drm /system/bin/drmserver class main user drm group drm system inet drmrpc readproc trimarea service media /system/bin/mediaserver class main user media group audio camera inet net_bt net_bt_admin net_bw_acct drmrpc mediadrm credmgr_client system ioprio rt 4 service mediadrm /system/bin/mediadrmserver class main user media group mediadrm drmrpc trimarea ioprio rt 4 service ptt_socket_app /system/bin/ptt_socket_app class main user system group system oneshot service imsqmidaemon /system/bin/imsqmidaemon class main user system socket ims_qmid stream 0660 system radio group radio net_raw log qcom_diag service imsdatadaemon /system/bin/imsdatadaemon class main user system socket ims_datad stream 0660 system radio group system wifi radio inet net_raw log qcom_diag net_admin disabled on property:sys.ims.DATA_DAEMON_STATUS=1 start ims_rtp_daemon start imscmservice 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 qcom_diag log inet disabled service imscmservice /system/bin/imscmservice class main user system group radio net_raw diag qcom_diag log disabled on property:sys.ims.QMI_DAEMON_STATUS=1 start imsdatadaemon