blob: d802936df1b51305b1b5b3f93a2d851b27274f83 [file] [log] [blame]
Amit Pundiraf628c22016-11-02 16:37:00 +08001import init.${ro.hardware}.usb.rc
Leo Yana063cbd2017-05-23 13:03:05 +08002import init.${ro.hardware}.power.rc
Dmitry Shmidtd7114332015-12-10 10:35:59 -08003
Vishal Bhoje72c9202015-10-23 18:10:21 +01004on init
5 # mount debugfs
Dmitry Shmidt57568102017-08-29 15:41:17 -07006 mount debugfs /sys/kernel/debug /sys/kernel/debug mode=755
Vishal Bhoje72c9202015-10-23 18:10:21 +01007
Vishal Bhoje72c9202015-10-23 18:10:21 +01008 # disable transparent huge pages
9 write /sys/kernel/mm/transparent_hugepage/enabled "never"
10
Dmitry Shmidt8b509382017-07-25 15:10:48 -070011 # Initialize cpusets to boot-time values
12 write /dev/cpuset/foreground/cpus 0-7
Dmitry Shmidt8b509382017-07-25 15:10:48 -070013 write /dev/cpuset/background/cpus 0-7
14 write /dev/cpuset/system-background/cpus 0-7
15 write /dev/cpuset/top-app/cpus 0-7
16
Dmitry Shmidtad4b0cc2018-02-09 14:58:50 -080017 # Create UDS structure for base VR services
18 mkdir /dev/socket/pdx 0775 system system
19 mkdir /dev/socket/pdx/system 0775 system system
20 mkdir /dev/socket/pdx/system/buffer_hub 0775 system system
21 mkdir /dev/socket/pdx/system/performance 0775 system system
22 mkdir /dev/socket/pdx/system/vr 0775 system system
23 mkdir /dev/socket/pdx/system/vr/display 0775 system system
24 mkdir /dev/socket/pdx/system/vr/pose 0775 system system
25 mkdir /dev/socket/pdx/system/vr/sensors 0775 system system
26
Dmitry Shmidt3dacd442017-08-25 13:54:51 -070027 start watchdogd
28
Vishal Bhoje72c9202015-10-23 18:10:21 +010029on fs
John Stultz531fb4c2018-06-20 16:42:53 -070030 mount_all /vendor/etc/fstab.${ro.hardware}
Vishal Bhoje72c9202015-10-23 18:10:21 +010031 setprop ro.crypto.fuse_sdcard false
32
Vishal Bhoje72c9202015-10-23 18:10:21 +010033on post-fs
Chenbo Feng05aa5592018-09-07 14:23:41 -070034
35 # set RLIMIT_MEMLOCK to 8MB
36 setrlimit 8 8388608 8388608
37
Yongqin Liu05ba0862016-03-23 21:22:57 +080038 # For legacy support
39 # See storage config details at http://source.android.com/tech/storage/
40 # since /storage is mounted on post-fs in init.rc
Yongqin Liu05ba0862016-03-23 21:22:57 +080041 symlink /sdcard /storage/sdcard0
42
Vishal Bhoje72c9202015-10-23 18:10:21 +010043 # BT LED sysfs entry
Dmitry Shmidt883877c2016-09-01 13:49:00 -070044 write /sys/class/leds/bt_active/trigger "hci1rx"
Vishal Bhoje72c9202015-10-23 18:10:21 +010045
46 chmod 0666 /dev/ump
47 chmod 0666 /dev/ion
Vishal Bhoje72c9202015-10-23 18:10:21 +010048 chmod 0666 /dev/graphics/fb0
49
50# fake some battery state
51 setprop status.battery.state Slow
52 setprop status.battery.level 5
53 setprop status.battery.level_raw 50
54 setprop status.battery.level_scale 9
55
Sahaj Sarup18db08a2017-09-09 03:44:32 +053056# If an app forces screen rotation, revert it once the apps closes
57 setprop persist.demo.rotationlock 1
John Stultz6a4721f2016-08-17 17:48:15 -070058
John Stultzcadc87f2019-03-18 21:47:18 -070059# avoid USB crash
60 setprop persist.adb.nonblocking_ffs 0
61 setprop ro.adb.nonblocking_ffs 0
62
Vishal Bhoje72c9202015-10-23 18:10:21 +010063# enable Google-specific location features,
64# like NetworkLocationProvider and LocationCollector
65 setprop ro.com.google.locationfeatures 1
66
67# enable test harness
68 setprop ro.test_harness true
69
Yongqin Liu8fd6c4f2016-12-19 17:38:31 +080070on post-fs-data
71 mkdir /data/media 0770 media_rw media_rw
72 mkdir /data/misc/gatord 0700 root root
73 # Set SELinux security contexts for files used by lava.
74 restorecon_recursive /data/local/tmp/lava
75
Dmitry Shmidtfe54c482018-01-30 12:49:31 -080076on zygote-start
77 mkdir /data/vendor/wifi 0770 wifi wifi
78 mkdir /data/vendor/wifi/wpa 0770 wifi wifi
79 mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi
80
Yongqin Liu8fd6c4f2016-12-19 17:38:31 +080081on property:sys.boot_completed=1
82 # update cpuset now that processors are up
83 # Foreground should contain most cores (7 is reserved for top-app)
84 write /dev/cpuset/foreground/cpus 0-6
85
86 # top-app gets all cpus (including reserved #7)
87 write /dev/cpuset/top-app/cpus 0-7
88
89 #background contains a small subset (generally one little core)
90 write /dev/cpuset/background/cpus 0
91
92 # add system-background cpuset, a new cpuset for system services
93 # that should not run on larger cores
94 # system-background is for system tasks that should only run on
95 # little cores, not on bigs to be used only by init
96 write /dev/cpuset/system-background/cpus 0-3
97
Vishal Bhoje72c9202015-10-23 18:10:21 +010098on property:usb_speed.switch=high
99 write /sys/kernel/debug/f72c0000.usb/config "0"
100
101on property:usb_speed.switch=full
102 write /sys/kernel/debug/f72c0000.usb/config "1"
103
104#userspace daemon needed for bluetooth
Myles Watson34e8b232017-02-15 14:26:09 -0800105service uim /vendor/bin/uim
Vishal Bhoje72c9202015-10-23 18:10:21 +0100106 class main
Yongqin Liu6c1cf5e2016-06-16 23:33:50 +0800107 user bluetooth
Ajay Panickera771b132016-09-20 11:28:28 -0700108 group bluetooth net_bt_admin system
Vishal Bhoje72c9202015-10-23 18:10:21 +0100109 oneshot
110
Roshan Pius17ea3f32017-02-23 10:17:59 -0800111service wpa_supplicant /system/vendor/bin/hw/wpa_supplicant \
Jeff Vander Stoepbf2a8462017-11-30 12:37:46 -0800112 -g@android:wpa_wlan0
Roshan Piusc5ef7d22018-02-05 16:45:49 -0800113 interface android.hardware.wifi.supplicant@1.0::ISupplicant default
114 interface android.hardware.wifi.supplicant@1.1::ISupplicant default
Vishal Bhoje72c9202015-10-23 18:10:21 +0100115 socket wpa_wlan0 dgram 660 wifi wifi
116 class main
117 disabled
118 oneshot
Dmitry Shmidt3dacd442017-08-25 13:54:51 -0700119
120# Set watchdog timer to 30 seconds and pet it every 10 seconds to get a 20 second margin
Tom Cherry60cc5702018-08-02 12:35:36 -0700121service watchdogd /system/bin/watchdogd 10 20
Dmitry Shmidt3dacd442017-08-25 13:54:51 -0700122 class core
123 oneshot
124 seclabel u:r:watchdogd:s0
Dmitry Shmidt6e5ccc62018-06-11 15:01:46 -0700125
126service bugreport /system/bin/dumpstate -d -p -B -z \
127 -o /data/user_de/0/com.android.shell/files/bugreports/bugreport
128 class main
129 disabled
130 oneshot