Enable exporting of tombstones out of guest VMs
Microdroid init will start the tombstone_transmit service which will
connect to a server (thread of virtualization service).
virtualizationservice listens for incoming connections from guests VMs.
The client (tombstone_transmit in guest) sends each tombstone file
content through a separate stream.
For each received connection, handle_tombstone would send a connect
request to tombstoned(via libtombstoned_client_rust), which provide a
file to write the content in (actually managed by the client libary).
Once write is complete notify_completion() would send completion
notification to tombstoned (which then will close the file and rename it).
Test: atest MicrodroidHostTestCases and/or crash a process in microdroid, take and check bugreport
Bug: 202153827
Change-Id: Ifcaa5da968ef39fdd05612d3e0baca4fd1c5eaf1
diff --git a/microdroid/init.rc b/microdroid/init.rc
index f6d5092..dbe5ac7 100644
--- a/microdroid/init.rc
+++ b/microdroid/init.rc
@@ -173,6 +173,13 @@
mkdir /data/local 0751 root root
mkdir /data/local/tmp 0771 shell shell
+on init && property:ro.boot.tombstone_transmit.enabled=1
+ start tombstone_transmit
+
+service tombstone_transmit /system/bin/tombstone_transmit.microdroid -cid 2 -port 2000
+ user root
+ group system
+
service apexd-vm /system/bin/apexd --vm
user root
group system