Add linkerconfig to microdroid
Bug: 179340111
Test: boot microdroid on cuttlefish VM
Change-Id: I19117fea79095b2e13c625da871cfa33d9ad6724
diff --git a/microdroid/Android.bp b/microdroid/Android.bp
index a44eb26..d0c6675 100644
--- a/microdroid/Android.bp
+++ b/microdroid/Android.bp
@@ -56,6 +56,7 @@
"apexd",
"debuggerd",
"linker",
+ "linkerconfig",
"servicemanager",
"tombstoned",
"cgroups.json",
diff --git a/microdroid/init.rc b/microdroid/init.rc
index 3ad22f8..9500f7c 100644
--- a/microdroid/init.rc
+++ b/microdroid/init.rc
@@ -14,11 +14,18 @@
on early-init
start ueventd
+ # Generate ld.config.txt
+ exec -- /system/bin/bootstrap/linkerconfig --target /linkerconfig
+ chmod 644 /linkerconfig/ld.config.txt
+
# Run apexd-bootstrap so that APEXes that provide critical libraries
# become available. Note that this is executed as exec_start to ensure that
# the libraries are available to the processes started after this statement.
exec_start apexd-bootstrap
+ # Generate linker config based on apex mounted in bootstrap namespace
+ update_linker_config
+
on init
# Mount binderfs
mkdir /dev/binderfs