Otapreopt: Remove b_mount_path
The final chosen design runs the tool in a chroot, no B mount path
required.
Bug: 25612095
Change-Id: Iba920455799da1aff97f759afc784ce43c4bf0b1
diff --git a/cmds/installd/otapreopt.cpp b/cmds/installd/otapreopt.cpp
index 3aac48b..da454a7 100644
--- a/cmds/installd/otapreopt.cpp
+++ b/cmds/installd/otapreopt.cpp
@@ -138,7 +138,7 @@
//
// Note: It seems we'll get access to the B root partition, so we should read the default.prop
// file.
- // if (!system_properties_.Load(b_mount_path_ + "/default.prop") {
+ // if (!system_properties_.Load("/default.prop")) {
// return false;
// }
system_properties_.SetProperty("dalvik.vm.image-dex2oat-Xms", "64m");
@@ -147,7 +147,7 @@
system_properties_.SetProperty("dalvik.vm.dex2oat-Xmx", "512m");
// TODO(agampe): Do this properly/test.
- return system_properties_.Load(b_mount_path_ + "/system/build.prop");
+ return system_properties_.Load("/system/build.prop");
}
bool ReadEnvironment() {
@@ -165,7 +165,7 @@
if (root_path == nullptr) {
return false;
}
- system_properties_.SetProperty(kAndroidRootPathPropertyName, b_mount_path_ + root_path);
+ system_properties_.SetProperty(kAndroidRootPathPropertyName, root_path);
return true;
}
@@ -239,9 +239,7 @@
// TODO: Delete files, just for a blank slate.
const std::string& boot_cp = *system_properties_.GetProperty(kBootClassPathPropertyName);
- std::string preopted_boot_art_path = StringPrintf("%s/system/framework/%s/boot.art",
- b_mount_path_.c_str(),
- isa);
+ std::string preopted_boot_art_path = StringPrintf("/system/framework/%s/boot.art", isa);
if (access(preopted_boot_art_path.c_str(), F_OK) == 0) {
return PatchoatBootImage(art_path, isa);
} else {
@@ -254,7 +252,7 @@
// This needs to be kept in sync with ART, see art/runtime/gc/space/image_space.cc.
std::vector<std::string> cmd;
- cmd.push_back(b_mount_path_ + "/system/bin/patchoat");
+ cmd.push_back("/system/bin/patchoat");
cmd.push_back("--input-image-location=/system/framework/boot.art");
cmd.push_back(StringPrintf("--output-image-file=%s", art_path.c_str()));
@@ -279,7 +277,7 @@
const char* isa) {
// This needs to be kept in sync with ART, see art/runtime/gc/space/image_space.cc.
std::vector<std::string> cmd;
- cmd.push_back(b_mount_path_ + "/system/bin/dex2oat");
+ cmd.push_back("/system/bin/dex2oat");
cmd.push_back(StringPrintf("--image=%s", art_path.c_str()));
for (const std::string& boot_part : Split(boot_cp, ':')) {
cmd.push_back(StringPrintf("--dex-file=%s", boot_part.c_str()));
@@ -305,8 +303,7 @@
"--compiler-filter=",
false,
cmd);
- cmd.push_back(StringPrintf("--image-classes=%s/system/etc/preloaded-classes",
- b_mount_path_.c_str()));
+ cmd.push_back("--image-classes=/system/etc/preloaded-classes");
// TODO: Compiled-classes.
const std::string* extra_opts =
system_properties_.GetProperty("dalvik.vm.image-dex2oat-flags");
@@ -468,10 +465,6 @@
}
}
- // The path where the B partitions are mounted.
- // TODO(agampe): If we're running this *inside* the change-root, we wouldn't need this.
- std::string b_mount_path_;
-
// Stores the system properties read out of the B partition. We need to use these properties
// to compile, instead of the A properties we could get from init/get_property.
SystemProperties system_properties_;