1import init.${ro.hardware}.usb.rc
2import init.${ro.hardware}.power.rc
3
4on init
5    # mount debugfs
6    mount debugfs /sys/kernel/debug /sys/kernel/debug mode=755
7
8    # disable transparent huge pages
9    write /sys/kernel/mm/transparent_hugepage/enabled "never"
10
11    # Initialize cpusets to boot-time values
12    write /dev/cpuset/foreground/cpus 0-7
13    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
17    start watchdogd
18
19on early-fs
20    start vold
21
22on fs
23    setprop ro.crypto.fuse_sdcard false
24
25on post-fs
26
27    # set RLIMIT_MEMLOCK to 8MB
28    setrlimit 8 8388608 8388608
29
30    # For legacy support
31    # See storage config details at http://source.android.com/tech/storage/
32    # since /storage is mounted on post-fs in init.rc
33    symlink /sdcard /storage/sdcard0
34
35    # BT LED sysfs entry
36    write /sys/class/leds/bt_active/trigger "hci1rx"
37
38    chmod 0666 /dev/ump
39    chmod 0666 /dev/ion
40    chmod 0666 /dev/graphics/fb0
41
42# fake some battery state
43    setprop status.battery.state Slow
44    setprop status.battery.level 5
45    setprop status.battery.level_raw  50
46    setprop status.battery.level_scale 9
47
48# If an app forces screen rotation, revert it once the apps closes
49    setprop persist.demo.rotationlock 1
50
51# 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
58on 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
64on 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
69on 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
86on 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
93service uim /vendor/bin/uim
94    class main
95    user bluetooth
96    group bluetooth net_bt_admin system
97    oneshot
98
99service wpa_supplicant /system/vendor/bin/hw/wpa_supplicant \
100     -g@android:wpa_wlan0
101     interface aidl android.hardware.wifi.supplicant.ISupplicant/default
102     interface android.hardware.wifi.supplicant@1.0::ISupplicant default
103     interface android.hardware.wifi.supplicant@1.1::ISupplicant default
104     socket wpa_wlan0 dgram 660 wifi wifi
105     class main
106     disabled
107     oneshot
108
109# Set watchdog timer to 30 seconds and pet it every 10 seconds to get a 20 second margin
110service watchdogd /system/bin/watchdogd 10 20
111    class core
112    oneshot
113    seclabel u:r:watchdogd:s0
114
115service bugreport /system/bin/dumpstate -d -p -z
116    class main
117    disabled
118    oneshot
119
120# TODO: disable this service once we implement system suspend
121service suspend_blocker /vendor/bin/suspend_blocker
122    class early_hal # Start together with system_suspend HAL
123    group system
124    user root
125