blob: 0ed01526c6a95a387dd09dcb07b1f29d54484617 [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 Shmidt3dacd442017-08-25 13:54:51 -070017 start watchdogd
18
Vishal Bhoje72c9202015-10-23 18:10:21 +010019on fs
Amit Pundiraf628c22016-11-02 16:37:00 +080020 mount_all /fstab.${ro.hardware}
Vishal Bhoje72c9202015-10-23 18:10:21 +010021 setprop ro.crypto.fuse_sdcard false
22
Vishal Bhoje72c9202015-10-23 18:10:21 +010023on post-fs
Yongqin Liu05ba0862016-03-23 21:22:57 +080024 # For legacy support
25 # See storage config details at http://source.android.com/tech/storage/
26 # since /storage is mounted on post-fs in init.rc
Yongqin Liu05ba0862016-03-23 21:22:57 +080027 symlink /sdcard /storage/sdcard0
28
Vishal Bhoje72c9202015-10-23 18:10:21 +010029 # BT LED sysfs entry
Dmitry Shmidt883877c2016-09-01 13:49:00 -070030 write /sys/class/leds/bt_active/trigger "hci1rx"
Vishal Bhoje72c9202015-10-23 18:10:21 +010031
32 chmod 0666 /dev/ump
33 chmod 0666 /dev/ion
Vishal Bhoje72c9202015-10-23 18:10:21 +010034 chmod 0666 /dev/graphics/fb0
35
36# fake some battery state
37 setprop status.battery.state Slow
38 setprop status.battery.level 5
39 setprop status.battery.level_raw 50
40 setprop status.battery.level_scale 9
41
42# Set Display density
43 setprop ro.sf.lcd_density 160
44
45# Set supported opengles version
46 setprop ro.opengles.version 196608
47
Sahaj Sarup18db08a2017-09-09 03:44:32 +053048# If an app forces screen rotation, revert it once the apps closes
49 setprop persist.demo.rotationlock 1
John Stultz6a4721f2016-08-17 17:48:15 -070050
Vishal Bhoje72c9202015-10-23 18:10:21 +010051# enable Google-specific location features,
52# like NetworkLocationProvider and LocationCollector
53 setprop ro.com.google.locationfeatures 1
54
55# enable test harness
56 setprop ro.test_harness true
57
Yongqin Liu8fd6c4f2016-12-19 17:38:31 +080058on post-fs-data
59 mkdir /data/media 0770 media_rw media_rw
60 mkdir /data/misc/gatord 0700 root root
61 # Set SELinux security contexts for files used by lava.
62 restorecon_recursive /data/local/tmp/lava
63
Dmitry Shmidtfe54c482018-01-30 12:49:31 -080064on zygote-start
65 mkdir /data/vendor/wifi 0770 wifi wifi
66 mkdir /data/vendor/wifi/wpa 0770 wifi wifi
67 mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi
68
Yongqin Liu8fd6c4f2016-12-19 17:38:31 +080069on property:sys.boot_completed=1
70 # update cpuset now that processors are up
71 # Foreground should contain most cores (7 is reserved for top-app)
72 write /dev/cpuset/foreground/cpus 0-6
73
74 # top-app gets all cpus (including reserved #7)
75 write /dev/cpuset/top-app/cpus 0-7
76
77 #background contains a small subset (generally one little core)
78 write /dev/cpuset/background/cpus 0
79
80 # add system-background cpuset, a new cpuset for system services
81 # that should not run on larger cores
82 # system-background is for system tasks that should only run on
83 # little cores, not on bigs to be used only by init
84 write /dev/cpuset/system-background/cpus 0-3
85
Vishal Bhoje72c9202015-10-23 18:10:21 +010086on property:usb_speed.switch=high
87 write /sys/kernel/debug/f72c0000.usb/config "0"
88
89on property:usb_speed.switch=full
90 write /sys/kernel/debug/f72c0000.usb/config "1"
91
92#userspace daemon needed for bluetooth
Myles Watson34e8b232017-02-15 14:26:09 -080093service uim /vendor/bin/uim
Vishal Bhoje72c9202015-10-23 18:10:21 +010094 class main
Yongqin Liu6c1cf5e2016-06-16 23:33:50 +080095 user bluetooth
Ajay Panickera771b132016-09-20 11:28:28 -070096 group bluetooth net_bt_admin system
Vishal Bhoje72c9202015-10-23 18:10:21 +010097 oneshot
98
Roshan Pius17ea3f32017-02-23 10:17:59 -080099service wpa_supplicant /system/vendor/bin/hw/wpa_supplicant \
Vishal Bhoje72c9202015-10-23 18:10:21 +0100100 -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
Jeff Vander Stoepbf2a8462017-11-30 12:37:46 -0800101 -g@android:wpa_wlan0
Roshan Piusc5ef7d22018-02-05 16:45:49 -0800102 interface android.hardware.wifi.supplicant@1.0::ISupplicant default
103 interface android.hardware.wifi.supplicant@1.1::ISupplicant default
Vishal Bhoje72c9202015-10-23 18:10:21 +0100104 socket wpa_wlan0 dgram 660 wifi wifi
105 class main
106 disabled
107 oneshot
Dmitry Shmidt3dacd442017-08-25 13:54:51 -0700108
109# Set watchdog timer to 30 seconds and pet it every 10 seconds to get a 20 second margin
110service watchdogd /sbin/watchdogd 10 20
111 class core
112 oneshot
113 seclabel u:r:watchdogd:s0