summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorTreehugger Robot2018-07-19 16:42:55 -0500
committerGerrit Code Review2018-07-19 16:42:55 -0500
commit8ab1fd076d20d46d5439b26465fdda522349f708 (patch)
tree9be6149e1225190a224268412a209a12ede0e144 /init
parentf07dbdd0229155b251ddadccdb159da1efefa654 (diff)
parentab8414dd6c91562f45c22367df6492181e491d43 (diff)
downloadplatform-system-core-8ab1fd076d20d46d5439b26465fdda522349f708.tar.gz
platform-system-core-8ab1fd076d20d46d5439b26465fdda522349f708.tar.xz
platform-system-core-8ab1fd076d20d46d5439b26465fdda522349f708.zip
Merge "init: Don't look for logical partitions via uevents."
Diffstat (limited to 'init')
-rw-r--r--init/init_first_stage.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/init/init_first_stage.cpp b/init/init_first_stage.cpp
index 2bc9f3ae0..a24a9a239 100644
--- a/init/init_first_stage.cpp
+++ b/init/init_first_stage.cpp
@@ -456,12 +456,19 @@ FirstStageMountVBootV2::FirstStageMountVBootV2() : avb_handle_(nullptr) {
456bool FirstStageMountVBootV2::GetDmVerityDevices() { 456bool FirstStageMountVBootV2::GetDmVerityDevices() {
457 need_dm_verity_ = false; 457 need_dm_verity_ = false;
458 458
459 std::set<std::string> logical_partitions;
460
459 // fstab_rec->blk_device has A/B suffix. 461 // fstab_rec->blk_device has A/B suffix.
460 for (auto fstab_rec : mount_fstab_recs_) { 462 for (auto fstab_rec : mount_fstab_recs_) {
461 if (fs_mgr_is_avb(fstab_rec)) { 463 if (fs_mgr_is_avb(fstab_rec)) {
462 need_dm_verity_ = true; 464 need_dm_verity_ = true;
463 } 465 }
464 required_devices_partition_names_.emplace(basename(fstab_rec->blk_device)); 466 if (fs_mgr_is_logical(fstab_rec)) {
467 // Don't try to find logical partitions via uevent regeneration.
468 logical_partitions.emplace(basename(fstab_rec->blk_device));
469 } else {
470 required_devices_partition_names_.emplace(basename(fstab_rec->blk_device));
471 }
465 } 472 }
466 473
467 // libavb verifies AVB metadata on all verified partitions at once. 474 // libavb verifies AVB metadata on all verified partitions at once.
@@ -476,11 +483,15 @@ bool FirstStageMountVBootV2::GetDmVerityDevices() {
476 std::vector<std::string> partitions = android::base::Split(device_tree_vbmeta_parts_, ","); 483 std::vector<std::string> partitions = android::base::Split(device_tree_vbmeta_parts_, ",");
477 std::string ab_suffix = fs_mgr_get_slot_suffix(); 484 std::string ab_suffix = fs_mgr_get_slot_suffix();
478 for (const auto& partition : partitions) { 485 for (const auto& partition : partitions) {
486 std::string partition_name = partition + ab_suffix;
487 if (logical_partitions.count(partition_name)) {
488 continue;
489 }
479 // required_devices_partition_names_ is of type std::set so it's not an issue 490 // required_devices_partition_names_ is of type std::set so it's not an issue
480 // to emplace a partition twice. e.g., /vendor might be in both places: 491 // to emplace a partition twice. e.g., /vendor might be in both places:
481 // - device_tree_vbmeta_parts_ = "vbmeta,boot,system,vendor" 492 // - device_tree_vbmeta_parts_ = "vbmeta,boot,system,vendor"
482 // - mount_fstab_recs_: /vendor_a 493 // - mount_fstab_recs_: /vendor_a
483 required_devices_partition_names_.emplace(partition + ab_suffix); 494 required_devices_partition_names_.emplace(partition_name);
484 } 495 }
485 } 496 }
486 return true; 497 return true;