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 # only load vkms after virtio_gpu has been loaded 13 wait /dev/dri/card0 14 exec u:r:vendor_modprobe:s0 -- /vendor/bin/modprobe -d /vendor/lib/modules vkms.ko create_default_dev=0 15 16on early-init && property:ro.boot.vendor.apex.com.android.hardware.keymint=\ 17com.android.hardware.keymint.rust_cf_guest_trusty_nonsecure 18 # Enable the Trusty Security VM 19 setprop trusty.security_vm.enabled 1 20 # Enable KeyMint that connects to the Trusty Security VM 21 setprop trusty.security_vm.keymint.enabled 1 22 23on init 24 # ZRAM setup 25 write /sys/block/zram0/comp_algorithm lz4 26 27 # EAS uclamp interfaces 28 mkdir /dev/cpuctl/foreground 29 mkdir /dev/cpuctl/background 30 mkdir /dev/cpuctl/top-app 31 mkdir /dev/cpuctl/rt 32 chown system system /dev/cpuctl 33 chown system system /dev/cpuctl/foreground 34 chown system system /dev/cpuctl/background 35 chown system system /dev/cpuctl/top-app 36 chown system system /dev/cpuctl/rt 37 chown system system /dev/cpuctl/tasks 38 chown system system /dev/cpuctl/foreground/tasks 39 chown system system /dev/cpuctl/background/tasks 40 chown system system /dev/cpuctl/top-app/tasks 41 chown system system /dev/cpuctl/rt/tasks 42 chmod 0664 /dev/cpuctl/tasks 43 chmod 0664 /dev/cpuctl/foreground/tasks 44 chmod 0664 /dev/cpuctl/background/tasks 45 chmod 0664 /dev/cpuctl/top-app/tasks 46 chmod 0664 /dev/cpuctl/rt/tasks 47 48on fs 49 mkdir /mnt/vendor/shared 0770 system system 50 51 # Mount everything that does not require fsck 52 mount_all --early 53 54 # So GceBootReporter can print to kmsg 55 chmod 622 /dev/kmsg 56 57on post-fs-data && property:ro.vendor.disable_rename_eth0= 58 # works around framework netiface enumeration issue 59 # TODO(b/202731768): Add this `start rename_eth0` command to the init.rc for rename_netiface 60 start rename_eth0 61 62on post-fs-data && property:ro.vendor.wifi_impl=virt_wifi 63 # TODO(b/202731768): Add this `start setup_wifi` command to the init.rc for setup_wifi 64 start setup_wifi 65 66on post-fs-data 67 mkdir /data/vendor/modem_dump 0777 system system 68 mkdir /data/vendor/radio 0777 system system 69 70on late-fs 71 # Mount RW partitions which need run fsck 72 mount_all --late 73 74 write /dev/kmsg "GUEST_BUILD_FINGERPRINT: ${ro.build.fingerprint}" 75 76on post-fs-data && property:ro.vendor.wifi_impl=mac80211_hwsim_virtio 77 mkdir /data/vendor/wifi 0770 wifi wifi 78 mkdir /data/vendor/wifi/hostapd 0770 wifi wifi 79 mkdir /data/vendor/wifi/hostapd/sockets 0770 wifi wifi 80 start init_wifi_sh 81 82on boot 83 chmod 0770 /dev/cpuctl 84 mkdir /data/vendor/wifi 0770 wifi wifi 85 mkdir /data/vendor/wifi/wpa 0770 wifi wifi 86 mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi 87 start socket_vsock_proxy 88 setprop ro.hardware.audio.primary goldfish 89 symlink /dev/hvc6 /dev/gnss0 90 symlink /dev/hvc7 /dev/gnss1 91 92 # enable f2fs sanity check to dump more metadata info to kmsg 93 # once it detects inode corruption 94 write /dev/sys/fs/by-name/userdata/sanity_check 1 95 96on property:sys.boot_completed=1 97 trigger sys-boot-completed-set 98 mkdir /mnt/vendor/custom 0755 root root 99 mount ext2 /dev/block/by-name/custom /mnt/vendor/custom loop rw sync 100 101# We want one opportunity per boot to enable zram, so we 102# use a trigger we fire from the above stanza. If 103# persist.sys.zram_enabled becomes true after boot, 104# we don't want to run swapon_all at that time. 105on sys-boot-completed-set && property:persist.sys.zram_enabled=1 106 swapon_all 107 108service vendor.dlkm_loader /vendor/bin/dlkm_loader 109 class main 110 user root 111 group root system 112 disabled 113 oneshot 114 115service metrics_helper /vendor/bin/metrics_helper 116 group system 117 user root 118 119service 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 120 user root 121 122service bugreport /system/bin/dumpstate -d -p -z 123 class main 124 user root 125 disabled 126 oneshot 127 keycodes 30 48 128 129# TODO: disable this service once cuttlefish implements system suspend 130service suspend_blocker /vendor/bin/suspend_blocker 131 class early_hal # Start together with system_suspend HAL 132 group system 133 user root 134 135on early-init 136 setprop ro.setupwizard.mode ${ro.boot.setupwizard_mode} 137 138on early-init && property:ro.boot.enable_bootanimation=0 139 setprop debug.sf.nobootanimation 1 140 141