• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1on early-init
2#    loglevel 8
3
4    setprop ro.hw_timeout_multiplier ${ro.boot.hw_timeout_multiplier}
5    setprop hypervisor.memory_reclaim.supported ${ro.boot.hypervisor.vm.supported}
6
7    start metrics_helper
8    # start module load in the background
9    start vendor.dlkm_loader
10    # specially load zram as it is a "leaf" GKI module
11    exec u:r:modprobe:s0 -- /system/bin/modprobe -a -d /system/lib/modules zram.ko
12
13on init
14    # ZRAM setup
15    write /sys/block/zram0/comp_algorithm lz4
16
17    # EAS uclamp interfaces
18    mkdir /dev/cpuctl/foreground
19    mkdir /dev/cpuctl/background
20    mkdir /dev/cpuctl/top-app
21    mkdir /dev/cpuctl/rt
22    chown system system /dev/cpuctl
23    chown system system /dev/cpuctl/foreground
24    chown system system /dev/cpuctl/background
25    chown system system /dev/cpuctl/top-app
26    chown system system /dev/cpuctl/rt
27    chown system system /dev/cpuctl/tasks
28    chown system system /dev/cpuctl/foreground/tasks
29    chown system system /dev/cpuctl/background/tasks
30    chown system system /dev/cpuctl/top-app/tasks
31    chown system system /dev/cpuctl/rt/tasks
32    chmod 0664 /dev/cpuctl/tasks
33    chmod 0664 /dev/cpuctl/foreground/tasks
34    chmod 0664 /dev/cpuctl/background/tasks
35    chmod 0664 /dev/cpuctl/top-app/tasks
36    chmod 0664 /dev/cpuctl/rt/tasks
37
38on fs
39    mkdir /mnt/vendor/shared 0770 system system
40
41    # Mount everything that does not require fsck
42    mount_all --early
43    restorecon_recursive /vendor
44
45    # So GceBootReporter can print to kmsg
46    chmod 622 /dev/kmsg
47
48on post-fs-data && property:ro.vendor.disable_rename_eth0=
49    # works around framework netiface enumeration issue
50    # TODO(b/202731768): Add this `start rename_eth0` command to the init.rc for rename_netiface
51    start rename_eth0
52
53on post-fs-data && property:ro.vendor.wifi_impl=virt_wifi
54    # TODO(b/202731768): Add this `start setup_wifi` command to the init.rc for setup_wifi
55    start setup_wifi
56
57on post-fs-data
58    mkdir /data/vendor/modem_dump 0777 system system
59    mkdir /data/vendor/radio 0777 system system
60
61on late-fs
62    # Mount RW partitions which need run fsck
63    mount_all --late
64
65    write /dev/kmsg "GUEST_BUILD_FINGERPRINT: ${ro.build.fingerprint}"
66
67on post-fs-data && property:ro.vendor.wifi_impl=mac8011_hwsim_virtio
68    mkdir /data/vendor/wifi 0770 wifi wifi
69    mkdir /data/vendor/wifi/hostapd 0770 wifi wifi
70    mkdir /data/vendor/wifi/hostapd/sockets 0770 wifi wifi
71    start init_wifi_sh
72
73on boot
74    chmod 0770 /dev/cpuctl
75    mkdir /data/vendor/wifi 0770 wifi wifi
76    mkdir /data/vendor/wifi/wpa 0770 wifi wifi
77    mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi
78    start socket_vsock_proxy
79    setprop ro.hardware.audio.primary goldfish
80    symlink /dev/hvc6 /dev/gnss0
81    symlink /dev/hvc7 /dev/gnss1
82
83on property:sys.boot_completed=1
84    trigger sys-boot-completed-set
85
86# We want one opportunity per boot to enable zram, so we
87# use a trigger we fire from the above stanza. If
88# persist.sys.zram_enabled becomes true after boot,
89# we don't want to run swapon_all at that time.
90on sys-boot-completed-set && property:persist.sys.zram_enabled=1
91    swapon_all
92
93service vendor.dlkm_loader /vendor/bin/dlkm_loader
94    class main
95    user root
96    group root system
97    disabled
98    oneshot
99
100service metrics_helper /vendor/bin/metrics_helper
101    group system
102    user root
103
104service socket_vsock_proxy /vendor/bin/socket_vsock_proxy -server_type=vsock -server_vsock_port=6520 -client_type=tcp -client_tcp_host=0.0.0.0 -client_tcp_port=5555
105    user root
106
107service seriallogging /system/bin/logcat -b all -v threadtime -f /dev/hvc2 *:V
108    class main
109    user logd
110    group root logd
111
112service vsoc_input_service /vendor/bin/vsoc_input_service -touch_port=${ro.boot.vsock_touch_port} -keyboard_port=${ro.boot.vsock_keyboard_port}
113    group root uhid
114    user root
115    disabled
116
117on early-boot && property:ro.boot.vsock_touch_port=*
118   enable vsoc_input_service
119   start vsoc_input_service
120
121on early-boot && property:ro.boot.vsock_keyboard_port=*
122   enable vsoc_input_service
123   start vsoc_input_service
124
125service bugreport /system/bin/dumpstate -d -p -z
126    class main
127    user root
128    disabled
129    oneshot
130    keycodes 30 48
131
132# TODO: disable this service once cuttlefish implements system suspend
133service suspend_blocker /vendor/bin/suspend_blocker
134    class early_hal # Start together with system_suspend HAL
135    group system
136    user root
137
138on boot && property:ro.boot.enable_confirmationui=*
139   enable vendor.confirmationui_default
140   start vendor.confirmationui_default
141