Try to mount and compile system_ext apks.
On newer devices the /system_ext partition often contains apks that
should be compiled by otapreopt_chroot during OTA. This change makes
sure otapreopt_chroot is able to mount that directory in order to
access and compile the apks.
Test: forrest test -l remote --test_bench_config asit/redfin ab::<PBuild>:redfin-userdebug:git_master asit/dexoptota/self_full
Bug: 181601383
Bug: 181182967
Change-Id: Ifdf60f98c2afa373ab0beedd84ffb15cf89aa475
diff --git a/cmds/installd/otapreopt_chroot.cpp b/cmds/installd/otapreopt_chroot.cpp
index 3a87776..83f01de 100644
--- a/cmds/installd/otapreopt_chroot.cpp
+++ b/cmds/installd/otapreopt_chroot.cpp
@@ -179,6 +179,11 @@
// want it for product APKs. Same notes as vendor above.
TryExtraMount("product", arg[2], "/postinstall/product");
+ // Try to mount the system_ext partition. update_engine doesn't do this for
+ // us, but we want it for system_ext APKs. Same notes as vendor and product
+ // above.
+ TryExtraMount("system_ext", arg[2], "/postinstall/system_ext");
+
constexpr const char* kPostInstallLinkerconfig = "/postinstall/linkerconfig";
// Try to mount /postinstall/linkerconfig. we will set it up after performing the chroot
if (mount("tmpfs", kPostInstallLinkerconfig, "tmpfs", 0, nullptr) != 0) {