Loading init/init_first_stage.cpp +24 −13 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ class FirstStageMount { bool InitDevices(); protected: ListenerAction HandleBlockDevice(const std::string& name, const Uevent&); bool InitRequiredDevices(); bool InitVerityDevice(const std::string& verity_device); bool MountPartitions(); Loading Loading @@ -209,17 +210,11 @@ bool FirstStageMount::InitRequiredDevices() { return true; } ListenerAction FirstStageMount::UeventCallback(const Uevent& uevent) { // Ignores everything that is not a block device. if (uevent.subsystem != "block") { return ListenerAction::kContinue; } if (!uevent.partition_name.empty()) { ListenerAction FirstStageMount::HandleBlockDevice(const std::string& name, const Uevent& uevent) { // Matches partition name to create device nodes. // Both required_devices_partition_names_ and uevent->partition_name have A/B // suffix when A/B is used. auto iter = required_devices_partition_names_.find(uevent.partition_name); auto iter = required_devices_partition_names_.find(name); if (iter != required_devices_partition_names_.end()) { LOG(VERBOSE) << __PRETTY_FUNCTION__ << ": found partition: " << *iter; required_devices_partition_names_.erase(iter); Loading @@ -230,6 +225,22 @@ ListenerAction FirstStageMount::UeventCallback(const Uevent& uevent) { return ListenerAction::kContinue; } } return ListenerAction::kContinue; } ListenerAction FirstStageMount::UeventCallback(const Uevent& uevent) { // Ignores everything that is not a block device. if (uevent.subsystem != "block") { return ListenerAction::kContinue; } if (!uevent.partition_name.empty()) { return HandleBlockDevice(uevent.partition_name, uevent); } else { size_t base_idx = uevent.path.rfind('/'); if (base_idx != std::string::npos) { return HandleBlockDevice(uevent.path.substr(base_idx + 1), uevent); } } // Not found a partition or find an unneeded partition, continue to find others. return ListenerAction::kContinue; Loading Loading
init/init_first_stage.cpp +24 −13 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ class FirstStageMount { bool InitDevices(); protected: ListenerAction HandleBlockDevice(const std::string& name, const Uevent&); bool InitRequiredDevices(); bool InitVerityDevice(const std::string& verity_device); bool MountPartitions(); Loading Loading @@ -209,17 +210,11 @@ bool FirstStageMount::InitRequiredDevices() { return true; } ListenerAction FirstStageMount::UeventCallback(const Uevent& uevent) { // Ignores everything that is not a block device. if (uevent.subsystem != "block") { return ListenerAction::kContinue; } if (!uevent.partition_name.empty()) { ListenerAction FirstStageMount::HandleBlockDevice(const std::string& name, const Uevent& uevent) { // Matches partition name to create device nodes. // Both required_devices_partition_names_ and uevent->partition_name have A/B // suffix when A/B is used. auto iter = required_devices_partition_names_.find(uevent.partition_name); auto iter = required_devices_partition_names_.find(name); if (iter != required_devices_partition_names_.end()) { LOG(VERBOSE) << __PRETTY_FUNCTION__ << ": found partition: " << *iter; required_devices_partition_names_.erase(iter); Loading @@ -230,6 +225,22 @@ ListenerAction FirstStageMount::UeventCallback(const Uevent& uevent) { return ListenerAction::kContinue; } } return ListenerAction::kContinue; } ListenerAction FirstStageMount::UeventCallback(const Uevent& uevent) { // Ignores everything that is not a block device. if (uevent.subsystem != "block") { return ListenerAction::kContinue; } if (!uevent.partition_name.empty()) { return HandleBlockDevice(uevent.partition_name, uevent); } else { size_t base_idx = uevent.path.rfind('/'); if (base_idx != std::string::npos) { return HandleBlockDevice(uevent.path.substr(base_idx + 1), uevent); } } // Not found a partition or find an unneeded partition, continue to find others. return ListenerAction::kContinue; Loading