blob: 42a582f0e60672714b1cd66f19332fccf466d9e6 [file] [log] [blame]
Amit Pundir4e375822019-04-18 16:46:10 +05301import init.${ro.hardware}.usb.rc
2import init.${ro.hardware}.power.rc
3
John Stultz95188ca2021-07-21 23:21:22 +00004on early-fs
5 start vold
6
Amit Pundir4e375822019-04-18 16:46:10 +05307on fs
John Stultz95188ca2021-07-21 23:21:22 +00008 mount_all /vendor/etc/fstab.${ro.hardware} --early
Yongqin Liubbb804e2020-04-21 17:52:44 +08009 swapon_all /vendor/etc/fstab.${ro.hardware}
Amit Pundir4e375822019-04-18 16:46:10 +053010
Yongqin Liuab5d0cc2020-03-20 13:44:54 +080011on post-fs
12 # set RLIMIT_MEMLOCK to 64MB
13 setrlimit 8 67108864 67108864
14
John Stultz95188ca2021-07-21 23:21:22 +000015on late-fs
16 mount_all /vendor/etc/fstab.${ro.hardware} --late
17
Amit Pundir4e375822019-04-18 16:46:10 +053018on init
Amit Pundirab98c6c2024-02-08 23:18:26 +053019 # ZRAM setup
20 write /sys/block/zram0/comp_algorithm lz4
21
Amit Pundir4e375822019-04-18 16:46:10 +053022 # For legacy support
23 # See storage config details at http://source.android.com/tech/storage/
24 # since /storage is mounted on post-fs in init.rc
25 symlink /sdcard /storage/sdcard0
26
27 # Initialize cpusets to boot-time values
28 write /dev/cpuset/foreground/cpus 0-7
29 write /dev/cpuset/background/cpus 0-7
30 write /dev/cpuset/system-background/cpus 0-7
31 write /dev/cpuset/top-app/cpus 0-7
32
33on early-boot
34 mount debugfs debugfs /sys/kernel/debug
35 chmod 755 /sys/kernel/debug
36 chmod 755 /sys/kernel/debug/sync
37 chown graphics graphics /sys/kernel/debug/sync/sw_sync
38 chmod 777 /sys/kernel/debug/sync/sw_sync
39 chown graphics graphics /sys/kernel/debug/sync/info
40
41on zygote-start
42 mkdir /data/vendor/wifi 0770 wifi wifi
43 mkdir /data/vendor/wifi/wpa 0770 wifi wifi
44 mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi
45
46on property:sys.boot_completed=1
Amit Pundir66c35f42020-06-21 21:50:34 +053047 chmod 0755 /sys/kernel/debug/tracing
48
Amit Pundir4e375822019-04-18 16:46:10 +053049 # update cpuset now that processors are up
50 # Foreground should contain most cores (7 is reserved for top-app)
51 write /dev/cpuset/foreground/cpus 0-6
52
53 # top-app gets all cpus (including reserved #7)
54 write /dev/cpuset/top-app/cpus 0-7
55
56 #background contains a small subset (generally one little core)
57 write /dev/cpuset/background/cpus 0
58
59 # add system-background cpuset, a new cpuset for system services
60 # that should not run on larger cores
61 # system-background is for system tasks that should only run on
62 # little cores, not on bigs to be used only by init
63 write /dev/cpuset/system-background/cpus 0-3
64
Amit Pundirab98c6c2024-02-08 23:18:26 +053065 trigger sys-boot-completed-set
66
67# We want one opportunity per boot to enable zram, so we
68# use a trigger we fire from the above stanza. If
69# persist.sys.zram_enabled becomes true after boot,
70# we don't want to run swapon_all at that time.
71on sys-boot-completed-set && property:persist.sys.zram_enabled=1
72 swapon_all
73
Amit Pundir4e375822019-04-18 16:46:10 +053074service wpa_supplicant /vendor/bin/hw/wpa_supplicant \
75 -Dnl80211 -g@android:wpa_wlan0
Amit Pundir5f212cf2022-08-17 16:32:56 +053076 interface aidl android.hardware.wifi.supplicant.ISupplicant/default
Amit Pundir4e375822019-04-18 16:46:10 +053077 interface android.hardware.wifi.supplicant@1.0::ISupplicant default
78 interface android.hardware.wifi.supplicant@1.1::ISupplicant default
79 socket wpa_wlan0 dgram 660 wifi wifi
80 class main
81 disabled
82 oneshot
Amit Pundird3525fb2021-05-31 16:16:21 +053083
84# TODO: disable this service once we implement system suspend
85service suspend_blocker /vendor/bin/suspend_blocker
86 class early_hal # Start together with system_suspend HAL
87 group system
88 user root