Otapreopt: Try to mount vendor partition for A/B OTA
Vendor apps are usually not preopted, so A/B dexopt should pick
them up. update_engine is not mounting the vendor partition, so
let otapreopt_chroot do the work.
Bug: 25612095
Bug: 29498238
Change-Id: I5a77bdb78a8e478ce10f6c1d0f911a8d6686becb
(cherry picked from commit 0ba073ce81fbe544592e0a3cd526b274e83fdf9f)
diff --git a/cmds/installd/otapreopt.cpp b/cmds/installd/otapreopt.cpp
index 6c87f7a..5fa972a 100644
--- a/cmds/installd/otapreopt.cpp
+++ b/cmds/installd/otapreopt.cpp
@@ -40,6 +40,7 @@
#include <file_parsing.h>
#include <globals.h>
#include <installd_deps.h> // Need to fill in requirements of commands.
+#include <otapreopt_utils.h>
#include <system_properties.h>
#include <utils.h>
@@ -261,13 +262,9 @@
}
// Sanitize value. Only allow (a-zA-Z0-9_)+.
target_slot_ = target_slot_arg;
- {
- std::regex slot_suffix_regex("[a-zA-Z0-9_]+");
- std::smatch slot_suffix_match;
- if (!std::regex_match(target_slot_, slot_suffix_match, slot_suffix_regex)) {
- LOG(ERROR) << "Target slot suffix not legal: " << target_slot_;
- return false;
- }
+ if (!ValidateTargetSlotSuffix(target_slot_)) {
+ LOG(ERROR) << "Target slot suffix not legal: " << target_slot_;
+ return false;
}
// Check for "dexopt" next.