1on early-fs
2    start vold
3
4on fs
5    mount_all /vendor/etc/fstab.ranchu --early
6
7on late-fs
8    # Mount RW partitions which need run fsck
9    mount_all /vendor/etc/fstab.ranchu --late
10
11on early-init
12    mount proc proc /proc remount hidepid=2,gid=3009
13
14    # true if ram is <= 2G
15    setprop ro.config.low_ram ${ro.boot.config.low_ram}
16    setprop ro.cpuvulkan.version ${ro.boot.qemu.cpuvulkan.version}
17    setprop ro.hardware.egl ${ro.boot.hardwareegl:-emulation}
18    setprop ro.hardware.vulkan ${ro.boot.hardware.vulkan}
19    setprop ro.opengles.version ${ro.boot.opengles.version}
20    setprop dalvik.vm.heapsize ${ro.boot.dalvik.vm.heapsize:-192m}
21    setprop dalvik.vm.checkjni ${ro.boot.dalvik.vm.checkjni}
22    setprop debug.hwui.renderer ${ro.boot.debug.hwui.renderer:-opengl}
23    setprop debug.stagefright.ccodec ${ro.boot.debug.stagefright.ccodec}
24    setprop debug.sf.nobootanimation ${ro.boot.debug.sf.nobootanimation}
25    setprop vendor.qemu.dev.bootcomplete 0
26
27    start vendor.dlkm_loader
28    exec u:r:modprobe:s0 -- /system/bin/modprobe -a -d /system/lib/modules zram.ko
29
30on init
31    write /sys/block/zram0/comp_algorithm lz4
32    write /proc/sys/vm/page-cluster 0
33
34    #
35    # EAS uclamp interfaces
36    #
37    mkdir /dev/cpuctl/foreground
38    mkdir /dev/cpuctl/background
39    mkdir /dev/cpuctl/top-app
40    mkdir /dev/cpuctl/rt
41    chown system system /dev/cpuctl
42    chown system system /dev/cpuctl/foreground
43    chown system system /dev/cpuctl/background
44    chown system system /dev/cpuctl/top-app
45    chown system system /dev/cpuctl/rt
46    chown system system /dev/cpuctl/tasks
47    chown system system /dev/cpuctl/foreground/tasks
48    chown system system /dev/cpuctl/background/tasks
49    chown system system /dev/cpuctl/top-app/tasks
50    chown system system /dev/cpuctl/rt/tasks
51    chmod 0664 /dev/cpuctl/tasks
52    chmod 0664 /dev/cpuctl/foreground/tasks
53    chmod 0664 /dev/cpuctl/background/tasks
54    chmod 0664 /dev/cpuctl/top-app/tasks
55    chmod 0664 /dev/cpuctl/rt/tasks
56
57    start qemu-props
58
59on post-fs-data
60    mkdir /data/vendor/var 0755 root root
61    mkdir /data/vendor/var/run 0755 root root
62
63    start qemu-device-state
64    start ranchu-adb-setup
65
66on zygote-start
67    # Create the directories used by the Wireless subsystem
68    mkdir /data/vendor/wifi 0771 wifi wifi
69    mkdir /data/vendor/wifi/wpa 0770 wifi wifi
70    mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi
71
72on boot
73    chown root system /sys/power/wake_lock
74    chown root system /sys/power/wake_unlock
75
76    # Create an unused USB gadget to allow sysfs testing
77    mkdir /config/usb_gadget/g1 0770 root root
78
79service vendor.dlkm_loader /vendor/bin/dlkm_loader
80    class main
81    user root
82    group root system
83    disabled
84    oneshot
85
86service ranchu-setup /vendor/bin/init.ranchu-core.sh
87    user root
88    group root
89    oneshot
90    disabled
91
92service ranchu-adb-setup /system_ext/bin/init.ranchu.adb.setup.sh
93    user system
94    group shell
95    stdio_to_kmsg
96    disabled
97    oneshot
98
99on property:vendor.qemu.vport.gnss=*
100    symlink ${vendor.qemu.vport.gnss} /dev/gnss0
101
102on property:vendor.qemu.timezone=*
103    setprop persist.sys.timezone ${vendor.qemu.timezone}
104
105on property:dev.bootcomplete=1 && property:vendor.qemu.dev.bootcomplete=0
106    setprop vendor.qemu.dev.bootcomplete 1
107    start qemu-props-bootcomplete
108    start ranchu-setup
109
110on post-fs-data && property:ro.boot.qemu.virtiowifi=1
111    start ranchu-net
112
113service ranchu-net /vendor/bin/init.ranchu-net.sh
114    class late_start
115    user root
116    group root wakelock wifi
117    oneshot
118    disabled    # Started on post-fs-data
119
120service dhcpclient_wifi /vendor/bin/dhcpclient -i wlan0 --no-gateway
121    user root
122    group root
123    disabled
124
125service dhcpclient_def /vendor/bin/dhcpclient -i eth0 --no-gateway
126    user root
127    group root
128    disabled
129
130# The qemu-props program is used to set various system
131# properties on boot. It must be run early during the boot
132# process to avoid race conditions with other daemons that
133# might read them (e.g. surface flinger), so define it in
134# class 'core'
135#
136service qemu-props /vendor/bin/qemu-props
137    user root
138    group root
139    oneshot
140    disabled
141
142service qemu-props-bootcomplete /vendor/bin/qemu-props "bootcomplete"
143    user root
144    group root
145    oneshot
146    disabled
147
148service qemu-device-state /vendor/bin/init_ranchu_device_state.sh
149    user root
150    group root
151    oneshot
152    disabled
153    stdio_to_kmsg
154
155service goldfish-logcat /system/bin/logcat -f /dev/hvc1 ${ro.boot.logcat}
156    class main
157    user logd
158    group root logd
159
160service bugreport /system/bin/dumpstate -d -p -z
161    class main
162    disabled
163    oneshot
164    keycodes 114 115 116
165
166service wpa_supplicant /vendor/bin/hw/wpa_supplicant -Dnl80211 -iwlan0 -c/vendor/etc/wifi/wpa_supplicant.conf -g@android:wpa_wlan0
167    interface aidl android.hardware.wifi.supplicant.ISupplicant/default
168    socket wpa_wlan0 dgram 660 wifi wifi
169    group system wifi inet
170    oneshot
171    disabled
172    user root
173
174on property:vendor.qemu.vport.bluetooth=*
175    symlink ${vendor.qemu.vport.bluetooth} /dev/bluetooth0
176
177service bt_vhci_forwarder /vendor/bin/bt_vhci_forwarder -virtio_console_dev=/dev/bluetooth0
178    class main
179    user bluetooth
180    group root bluetooth
181
182on property:vendor.qemu.vport.uwb=*
183    symlink ${vendor.qemu.vport.uwb} /dev/hvc2
184    start vendor.uwb_hal
185
186service vendor.uwb_hal /vendor/bin/hw/android.hardware.uwb-service /dev/hvc2
187    class hal
188    user uwb
189    disabled
190
191# Enable zram only once per boot. From:
192
193# We want one opportunity per boot to enable zram, so we
194# use a trigger we fire from the above stanza. If
195# persist.sys.zram_enabled becomes true after boot,
196# we don't want to run swapon_all at that time.
197
198on property:sys.boot_completed=1
199    trigger sys-boot-completed-set
200
201on sys-boot-completed-set && property:persist.sys.zram_enabled=1
202    swapon_all /vendor/etc/fstab.${ro.hardware}
203