compos: mount BuildManifestSystemExt.apk if exists
To specify the extra APK, we have to add two new VM config JSONs because
the APK may not exist, and there is no way to specify the config
dynamically.
Change VmParameters in order to derive the config path from two
variables at a more consistent place. As a result, there's no more
"default" config.
Bug: 246000387
Test: 1. manually add a jar from system_ext to SYSTEMSERVERCLASSPATH
2. boot the VM, saw 2 directories in /mnt/extra-apk/
(and with more local WIP changes, ComposHostTestCases passed)
Change-Id: I8aac49e0b347560fb65d8a8330e4333a29d90433
diff --git a/compos/verify/verify.rs b/compos/verify/verify.rs
index 3abdc74..5b7a8ad 100644
--- a/compos/verify/verify.rs
+++ b/compos/verify/verify.rs
@@ -28,7 +28,7 @@
};
use compos_common::{
COMPOS_DATA_ROOT, CURRENT_INSTANCE_DIR, IDSIG_FILE, IDSIG_MANIFEST_APK_FILE,
- INSTANCE_IMAGE_FILE, TEST_INSTANCE_DIR,
+ IDSIG_MANIFEST_EXT_APK_FILE, INSTANCE_IMAGE_FILE, TEST_INSTANCE_DIR,
};
use log::error;
use std::fs::File;
@@ -93,6 +93,7 @@
let instance_image = instance_dir.join(INSTANCE_IMAGE_FILE);
let idsig = instance_dir.join(IDSIG_FILE);
let idsig_manifest_apk = instance_dir.join(IDSIG_MANIFEST_APK_FILE);
+ let idsig_manifest_ext_apk = instance_dir.join(IDSIG_MANIFEST_EXT_APK_FILE);
let instance_image = File::open(instance_image).context("Failed to open instance image")?;
@@ -111,6 +112,7 @@
instance_image,
&idsig,
&idsig_manifest_apk,
+ &idsig_manifest_ext_apk,
&VmParameters { debug_mode: args.debug, ..Default::default() },
)?;