1import init.dragon.usb.rc 2 3on early-init 4 mount debugfs /sys/kernel/debug /sys/kernel/debug mode=755 5 6on init 7 symlink /sdcard /storage/sdcard0 8 9 # Setup zram options 10 write /sys/block/zram0/comp_algorithm lz4 11 write /sys/block/zram0/max_comp_streams 4 12 13 setprop ro.hardware.gralloc tegra 14 setprop ro.hardware.hwcomposer drm 15 setprop hwc.drm.device /dev/dri/card1 16 setprop persist.tegra.compression off 17 setprop persist.tegra.decompression disabled 18 setprop ro.radio.noril yes 19 setprop persist.tegra.nvblit.engine gpu 20 21 # GL driver parameters for tiled cache size and efficient tex fetch 22 setprop persist.tegra.0x523dc5 0x3f000000 23 setprop persist.tegra.58027529 0x00000002 24 setprop persist.tegra.a3456abe 0x087f6080 25 26 # fix navigation bar not showing 27 setprop qemu.hw.mainkeys 0 28 start watchdogd 29 30on late-init 31 # Setting slice_idle to 0 for CFQ, so make sure the scheduler is CFQ. 32 write /sys/block/mmcblk0/queue/scheduler cfq 33 write /sys/block/mmcblk0/queue/iosched/slice_idle 0 34 35 # enable rcu_expedited 36 write /sys/kernel/rcu_expedited 1 37 38on early-boot 39 # Update dm-verity state and set partition.*.verified properties 40 verity_update_state 41 42# Set watchdog timer to 30 seconds and pet it every 10 seconds to get a 20 second margin 43service watchdogd /sbin/watchdogd 10 20 44 class core 45 seclabel u:r:watchdogd:s0 46 47on post-fs 48 # Turn on swap 49 swapon_all /fstab.dragon 50 51 # Swap in only 1 page at a time 52 write /proc/sys/vm/page-cluster 0 53 54on post-fs-data 55 # Now that are booted all the way and out of mount panics, ensure that we panic on later errors. 56 # This is a hack to work around the fact that we can't recover from all errors that would lead to a panic 57 # during the initial mount (http://b/17382778), yet we need to panic on emmc errors (http://b/17640053) 58 # For a remount only the flags and the target mount point are relevant. 59 mount dummy dummy /data remount nosuid nodev noatime rw seclabel,background_gc=on,user_xattr,acl,errors=panic 60 61 mkdir /data/nvcam 0700 media camera 62 mkdir /data/misc/camera 0700 media camera 63 64 # NFC: create data/nfc for nv storage 65 mkdir /data/nfc 0770 nfc nfc 66 mkdir /data/nfc/param 0770 nfc nfc 67 68 # secure os storage 69 mkdir /data/ss 0700 system system 70 mkdir /data/ss/tlk 0700 system system 71 72 # secure os storage 73 mkdir /data/ss 0700 system system 74 75 # modem init 76 mkdir /data/qcks 0770 system system 77 mkdir /data/efs 0771 system system 78 mkdir /data/qcks/mdm 0770 system system 79 80 # crash_collector 81 mkdir /data/system/crash_reports 0700 system system 82 83 # EC/charger logs 84 mkdir /data/misc/fw_logs 0755 root root 85 86 # touch firmware updater logs 87 mkdir /data/misc/touchfwup 0750 root log 88 89 # initialize region info 90 exec -- /system/bin/init_regions.sh 91 92 setprop vold.post_fs_data_done 1 93 94on boot 95 # bluetooth 96 # change back to bluetooth from system 97 chown bluetooth net_bt_stack /data/misc/bluetooth 98 99 # power down interface 100 write /sys/class/rfkill/rfkill0/state 0 101 102 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive 103 write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor interactive 104 write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor interactive 105 write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor interactive 106 107 # (crosbug.com/p/46057) : Limit min frequency to 204Mhz for audio latency 108 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 204000 109 write /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq 204000 110 write /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq 204000 111 write /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq 204000 112 113 restorecon_recursive /sys/devices/system/cpu/cpufreq/interactive 114 chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate 115 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_rate 116 chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_slack 117 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_slack 118 chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time 119 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time 120 chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq 121 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq 122 chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads 123 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/target_loads 124 chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load 125 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load 126 chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay 127 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay 128 chown system system /sys/devices/system/cpu/cpufreq/interactive/boost 129 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boost 130 chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse 131 chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost 132 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/input_boost 133 chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration 134 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration 135 chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy 136 chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy 137 chown system system /sys/devices/57000000.gpu/pstate 138 139 # update foreground cpuset now that processors are up 140 # reserve CPU 3 for the top app 141 write /dev/cpuset/foreground/cpus 0-2 142 write /dev/cpuset/foreground/boost/cpus 0-2 143 write /dev/cpuset/background/cpus 0 144 write /dev/cpuset/system-background/cpus 0-1 145 write /dev/cpuset/top-app/cpus 0-3 146 147 # for gpu cap in battery saver mode 148 chown system system /sys/kernel/debug/system_edp/capping/force_gpu 149 chmod 0660 /sys/kernel/debug/system_edp/capping/force_gpu 150 151 # for lightbar 152 chown system system /sys/class/chromeos/cros_ec/lightbar/userspace_control 153 chmod 0660 /sys/class/chromeos/cros_ec/lightbar/userspace_control 154 chown system system /sys/class/chromeos/cros_ec/lightbar/sequence 155 chmod 0660 /sys/class/chromeos/cros_ec/lightbar/sequence 156 157 # for external power limits 158 chown system system /sys/class/chromeos/cros_ec/usb-pd-charger/ext_voltage_lim 159 chmod 0660 /sys/class/chromeos/cros_ec/usb-pd-charger/ext_voltage_lim 160 161 # Enable CC4 162 write /sys/devices/system/cpu/cpu0/cpuidle/state1/disabled 0 163 write /sys/devices/system/cpu/cpu1/cpuidle/state1/disabled 0 164 write /sys/devices/system/cpu/cpu2/cpuidle/state1/disabled 0 165 write /sys/devices/system/cpu/cpu3/cpuidle/state1/disabled 0 166 167 # b/13568411: make lazy vfree flush thresholds match flush_tlb_range 168 write /proc/sys/vm/lazy_vfree_tlb_flush_all_threshold 524288 169 170 chmod 0444 /sys/kernel/debug/bq2419x-regs 171 172 write /proc/sys/net/core/rmem_max 1048576 173 write /proc/sys/net/core/wmem_max 1048576 174 175 # Execute crash_collector when a process is crashing. 176 write /proc/sys/kernel/core_pattern "|/system/bin/crash_dispatcher %p %u %g %s %t %e" 177 write /proc/sys/kernel/core_pipe_limit 4 178 write /proc/self/coredump_filter 0x1 179 180 # enable GPU dvfs 181 write /sys/class/drm/card0/device/pstate auto 182 183 # set GPU auto suspend 184 write /sys/devices/57000000.gpu/power/autosuspend_delay_ms 520 185 186 # Raise RLIMIT_NOFILE softlimit to workaround b/28277319. This is intended 187 # to go away at some point, do not copy it to new devices! This makes fd 188 # leaks much harder to notice and debug. 189 setrlimit 7 2048 4096 190 191on fs 192 # Enable verity notification 193 write /sys/module/dm_verity/parameters/error_behavior notify 194 195 mount_all /fstab.dragon 196 197# run the touch firmware update script as soon as non-tmpfs /data is ready 198on property:vold.decrypt=trigger_restart_framework 199 exec -- /system/bin/touchfwup.sh 200 201# tune thermal governor 202service tune_therm_gov /system/bin/tune-thermal-gov.sh skin-therm pd_thermal_gov \ 203 max_err_temp 5000 204 class main 205 oneshot 206 207service battery_charger /charger 208 class charger 209 seclabel u:r:healthd:s0 210 211# on userdebug and eng builds, enable kgdb on the serial console 212on property:ro.debuggable=1 213 write /sys/module/kgdboc/parameters/kgdboc ttyFIQ0 214 write /sys/module/fiq_debugger/parameters/kgdb_enable 1 215 216# bugreport is triggered by holding down volume down, volume up and power 217service bugreport /system/bin/dumpstate -d -p -B -z \ 218 -o /data/user_de/0/com.android.shell/files/bugreports/bugreport 219 class late_start 220 disabled 221 oneshot 222 keycodes 114 115 116 223 224service p2p_supplicant /system/bin/wpa_supplicant \ 225 -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \ 226 -I/system/etc/wifi/p2p_supplicant_overlay.conf \ 227 -puse_p2p_group_interface=1p2p_device=1 \ 228 -m/data/misc/wifi/p2p_supplicant.conf \ 229 -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0 230 class late_start 231 socket wpa_wlan0 dgram 660 wifi wifi 232 disabled 233 oneshot 234 235service wpa_supplicant /system/bin/wpa_supplicant \ 236 -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \ 237 -I/system/etc/wifi/wpa_supplicant_overlay.conf \ 238 -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0 239 class late_start 240 socket wpa_wlan0 dgram 660 wifi wifi 241 disabled 242 oneshot 243 244service fwtool /system/bin/fwtool mark_boot success 245 class late_start 246 user root 247 oneshot 248 249service kickstart /vendor/bin/qcks -i /vendor/firmware/mdm/image/ -r /data/qcks/mdm/ 250 class late_start 251 disabled 252 user system 253 group system 254 oneshot 255 256service qmuxd /vendor/bin/qmuxd 257 class late_start 258 disabled 259 user system 260 group system radio 261 262service netmgrd /vendor/bin/netmgrd 263 class late_start 264 disabled 265 group system radio 266 267service tlk_daemon /vendor/bin/tlk_daemon --storagedir /data/ss --rpmbdev /dev/block/mmcblk0rpmb 268 class main 269 group system 270 271on property:debug.bq25892=dump 272 exec - root root system -- /system/bin/dump_bq25892.sh 273