summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2018-07-20 15:18:04 -0700
committerTom Cherry <tomcherry@google.com>2018-07-20 15:31:36 -0700
commit38a11ccdd183248b07c86b51791dc2dafba36738 (patch)
tree6d7089bc56995bf045c4ed389d6f72318676f3fd /init
parent74be24d696f2d67293de6b9bb6e715c1728abed7 (diff)
downloadsystem_core-38a11ccdd183248b07c86b51791dc2dafba36738.tar.gz
system_core-38a11ccdd183248b07c86b51791dc2dafba36738.tar.bz2
system_core-38a11ccdd183248b07c86b51791dc2dafba36738.zip
init: rename init_first_stage
In preparation for splitting first stage init from the rest of the init executable, rename these files which are specifically involved in first stage mount operations to a more appropriate name. Test: builds Change-Id: I8a2d4e8c7e1deea1bab45cc8e738727bc2ceb3e5
Diffstat (limited to 'init')
-rw-r--r--init/Android.bp2
-rw-r--r--init/first_stage_mount.cpp (renamed from init/init_first_stage.cpp)27
-rw-r--r--init/first_stage_mount.h (renamed from init/init_first_stage.h)5
-rw-r--r--init/init.cpp2
4 files changed, 17 insertions, 19 deletions
diff --git a/init/Android.bp b/init/Android.bp
index 5bbb7a09c..d3305b903 100644
--- a/init/Android.bp
+++ b/init/Android.bp
@@ -104,9 +104,9 @@ cc_library_static {
"devices.cpp",
"epoll.cpp",
"firmware_handler.cpp",
+ "first_stage_mount.cpp",
"import_parser.cpp",
"init.cpp",
- "init_first_stage.cpp",
"keychords.cpp",
"log.cpp",
"parser.cpp",
diff --git a/init/init_first_stage.cpp b/init/first_stage_mount.cpp
index 0ee020384..8ded87373 100644
--- a/init/init_first_stage.cpp
+++ b/init/first_stage_mount.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "init_first_stage.h"
+#include "first_stage_mount.h"
#include <stdlib.h>
#include <unistd.h>
@@ -125,11 +125,12 @@ static inline bool IsDmLinearEnabled() {
if (checked) {
return enabled;
}
- import_kernel_cmdline(false, [](const std::string& key, const std::string& value, bool in_qemu) {
- if (key == "androidboot.logical_partitions" && value == "1") {
- enabled = true;
- }
- });
+ import_kernel_cmdline(false,
+ [](const std::string& key, const std::string& value, bool in_qemu) {
+ if (key == "androidboot.logical_partitions" && value == "1") {
+ enabled = true;
+ }
+ });
checked = true;
return enabled;
}
@@ -149,9 +150,9 @@ FirstStageMount::FirstStageMount()
}
auto boot_devices = fs_mgr_get_boot_devices();
- device_handler_ =
- std::make_unique<DeviceHandler>(std::vector<Permissions>{}, std::vector<SysfsPermissions>{},
- std::vector<Subsystem>{}, std::move(boot_devices), false);
+ device_handler_ = std::make_unique<DeviceHandler>(
+ std::vector<Permissions>{}, std::vector<SysfsPermissions>{}, std::vector<Subsystem>{},
+ std::move(boot_devices), false);
}
std::unique_ptr<FirstStageMount> FirstStageMount::Create() {
@@ -484,7 +485,7 @@ ListenerAction FirstStageMountVBootV2::UeventCallback(const Uevent& uevent) {
// as it finds them, so this must happen first.
if (!uevent.partition_name.empty() &&
required_devices_partition_names_.find(uevent.partition_name) !=
- required_devices_partition_names_.end()) {
+ required_devices_partition_names_.end()) {
// GetBlockDeviceSymlinks() will return three symlinks at most, depending on
// the content of uevent. by-name symlink will be at [0] if uevent->partition_name
// is not empty. e.g.,
@@ -492,7 +493,7 @@ ListenerAction FirstStageMountVBootV2::UeventCallback(const Uevent& uevent) {
// - /dev/block/platform/soc.0/f9824900.sdhci/mmcblk0p1
std::vector<std::string> links = device_handler_->GetBlockDeviceSymlinks(uevent);
if (!links.empty()) {
- auto[it, inserted] = by_name_symlink_map_.emplace(uevent.partition_name, links[0]);
+ auto [it, inserted] = by_name_symlink_map_.emplace(uevent.partition_name, links[0]);
if (!inserted) {
LOG(ERROR) << "Partition '" << uevent.partition_name
<< "' already existed in the by-name symlink map with a value of '"
@@ -508,7 +509,7 @@ bool FirstStageMountVBootV2::SetUpDmVerity(fstab_rec* fstab_rec) {
if (fs_mgr_is_avb(fstab_rec)) {
if (!InitAvbHandle()) return false;
SetUpAvbHashtreeResult hashtree_result =
- avb_handle_->SetUpAvbHashtree(fstab_rec, false /* wait_for_verity_dev */);
+ avb_handle_->SetUpAvbHashtree(fstab_rec, false /* wait_for_verity_dev */);
switch (hashtree_result) {
case SetUpAvbHashtreeResult::kDisabled:
return true; // Returns true to mount the partition.
@@ -585,7 +586,7 @@ void SetInitAvbVersionInRecovery() {
}
FsManagerAvbUniquePtr avb_handle =
- FsManagerAvbHandle::Open(std::move(avb_first_mount.by_name_symlink_map_));
+ FsManagerAvbHandle::Open(std::move(avb_first_mount.by_name_symlink_map_));
if (!avb_handle) {
PLOG(ERROR) << "Failed to open FsManagerAvbHandle for INIT_AVB_VERSION";
return;
diff --git a/init/init_first_stage.h b/init/first_stage_mount.h
index c7a386718..21d87fd48 100644
--- a/init/init_first_stage.h
+++ b/init/first_stage_mount.h
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-#ifndef _INIT_FIRST_STAGE_H
-#define _INIT_FIRST_STAGE_H
+#pragma once
namespace android {
namespace init {
@@ -25,5 +24,3 @@ void SetInitAvbVersionInRecovery();
} // namespace init
} // namespace android
-
-#endif
diff --git a/init/init.cpp b/init/init.cpp
index 686cd6ed9..5352450b0 100644
--- a/init/init.cpp
+++ b/init/init.cpp
@@ -48,8 +48,8 @@
#include "action_parser.h"
#include "epoll.h"
+#include "first_stage_mount.h"
#include "import_parser.h"
-#include "init_first_stage.h"
#include "keychords.h"
#include "log.h"
#include "property_service.h"