• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1on fs
2    mount_all /vendor/etc/fstab.qemu_trusty
3
4on early-init
5    mount debugfs debugfs /sys/kernel/debug mode=755
6
7# legacy cpp implementation - to be deprecated
8on post-fs && property:ro.boot.vendor.apex.com.android.hardware.keymint=\
9com.android.hardware.keymint.trusty_tee.cpp
10    enable vendor.keymint-service.trusty_tee.cpp
11
12# rust implementation
13on post-fs && property:ro.boot.vendor.apex.com.android.hardware.keymint=\
14com.android.hardware.keymint.trusty_tee
15    enable vendor.keymint-service.trusty_tee
16
17on early-init && property:ro.boot.vendor.apex.com.android.hardware.keymint=\
18com.android.hardware.keymint.trusty_system_vm
19    # Enable the Trusty Security VM
20    setprop trusty.security_vm.enabled 1
21    # Enable KeyMint that connects to the Trusty Security VM
22    setprop trusty.security_vm.keymint.enabled 1
23
24on post-fs
25    # Ensure rpmb_virt_device is ready and start storageproxyd
26    # (on-post-fs at the latest because vold
27    # needs secure storage for rollback protection
28    # of the data partition encryption key
29    wait /dev/vport4p1
30
31on post-fs-data
32    mkdir /data/vendor/ss 0770 root system
33    mkdir /mnt/vendor/persist/ss 0770 root system
34    restorecon_recursive /mnt/vendor/persist/ss
35    symlink /mnt/vendor/persist/ss /data/vendor/ss/persist
36    chown root system /data/vendor/ss/persist
37    chmod 0770 /data/vendor/ss/persist
38    write /dev/kmsg "boot_kpi: K - restart storageproxyd"
39    restart storageproxyd
40
41on boot
42    write /dev/kmsg "boot_kpi: K - init.rc 'on boot'"
43    chown root system /sys/power/wake_lock
44    chown root system /sys/power/wake_unlock
45setprop ro.radio.use-ppp no
46    setprop ro.build.product generic
47    setprop ro.product.device generic
48    setprop ro.hardware.audio.primary goldfish
49    setprop ro.setupwizard.mode EMULATOR
50
51# fake some battery state
52    setprop status.battery.state Slow
53    setprop status.battery.level 5
54    setprop status.battery.level_raw  50
55    setprop status.battery.level_scale 9
56
57# set up the GPU caching
58    setprop ro.hwui.texture_cache_size 72
59    setprop ro.hwui.layer_cache_size 48
60    setprop ro.hwui.r_buffer_cache_size 8
61    setprop ro.hwui.path_cache_size 32
62    setprop ro.hwui.gradient_cache_size 1
63    setprop ro.hwui.drop_shadow_cache_size 6
64    setprop ro.hwui.texture_cache_flushrate 0.4
65    setprop ro.hwui.text_small_cache_width 1024
66    setprop ro.hwui.text_small_cache_height 1024
67    setprop ro.hwui.text_large_cache_width 2048
68    setprop ro.hwui.text_large_cache_height 1024
69
70# disable some daemons the emulator doesn't want
71    stop dund
72    stop akmd
73
74# start essential services
75# These were written for the classic emulator, but are applicable to ranchu
76    start goldfish-logcat
77#    start goldfish-setup
78
79
80# enable Google-specific location features,
81# like NetworkLocationProvider and LocationCollector
82    setprop ro.com.google.locationfeatures 1
83
84#emulator is not much useful before boot complete
85#start it later
86on property:sys.boot_completed=1
87    setprop sys.usb.config adb
88    start adbd
89    start goldfish-logcat
90    start qemu_trusty-net
91
92on property:qemu.adbd=start
93    setprop sys.usb.config adb
94    start adbd
95    start goldfish-logcat
96
97service qemu_trusty-net /vendor/bin/dhcpclient -i eth0
98    class late_start
99    user root
100    group root wakelock
101
102# The qemu-props program is used to set various system
103# properties on boot. It must be run early during the boot
104# process to avoid race conditions with other daemons that
105# might read them (e.g. surface flinger), so define it in
106# class 'core'
107#
108service qemu-props /vendor/bin/qemu-props
109    class core
110    user root
111    group root
112    oneshot
113
114on property:qemu.logcat=start
115    start goldfish-logcat
116
117# -Q is a special logcat option that forces the
118# program to check wether it runs on the emulator
119# if it does, it redirects its output to the device
120# named by the androidboot.console kernel option
121# if not, is simply exits immediately
122# logd user added to prevent logcat from logging content.
123# log group added to support access to read logs socket.
124service goldfish-logcat /system/bin/logcat -Q
125    user logd
126    group log
127    oneshot
128
129service fingerprintd /system/bin/fingerprintd
130    class late_start
131    user system
132
133service bugreport /system/bin/dumpstate -d -p
134    class main
135    disabled
136    user root
137    oneshot
138    keycodes 114 115 116
139
140# start storageproxyd when rpmb virtual port is ready
141service storageproxyd /vendor/bin/storageproxyd -d /dev/trusty-ipc-dev0 \
142        -r /dev/vport4p1 -p /data/vendor/ss -t virt
143    class early_hal
144    user system
145    group system
146    task_profiles MaxPerformance
147