update_engine: define dlc constants
Instead of using constants in libbrillo, we move these constants back to
update_engine. The libbrillo constants are going away.
BUG=chromium:890036
TEST=emerge-kefka update_engine
Change-Id: I6d2fd0e2bd437cf9f90ff28bb7b12e5ae702ab40
Reviewed-on: https://chromium-review.googlesource.com/1289092
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Xiaochu Liu <xiaochu@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
diff --git a/boot_control_chromeos.cc b/boot_control_chromeos.cc
index f226a65..724dab0 100644
--- a/boot_control_chromeos.cc
+++ b/boot_control_chromeos.cc
@@ -24,7 +24,6 @@
#include <base/files/file_path.h>
#include <base/files/file_util.h>
#include <base/strings/string_util.h>
-#include <brillo/update_engine/utils.h>
#include <rootdev/rootdev.h>
extern "C" {
@@ -44,6 +43,12 @@
const char* kAndroidPartitionNameKernel = "boot";
const char* kAndroidPartitionNameRoot = "system";
+const char kDlcInstallRootDirectoryEncrypted[] = "/home/chronos/dlc";
+const char kPartitionNamePrefixDlc[] = "dlc_";
+const char kPartitionNameDlcA[] = "dlc_a";
+const char kPartitionNameDlcB[] = "dlc_b";
+const char kPartitionNameDlcImage[] = "dlc.img";
+
// Returns the currently booted rootfs partition. "/dev/sda3", for example.
string GetBootDevice() {
char boot_path[PATH_MAX];
@@ -146,26 +151,21 @@
string* device) const {
// Partition name prefixed with |kPartitionNamePrefixDlc| is a DLC.
if (base::StartsWith(partition_name,
- brillo::chromeos_update_engine::kPartitionNamePrefixDlc,
+ kPartitionNamePrefixDlc,
base::CompareCase::SENSITIVE)) {
// Extract DLC ID from partition_name (DLC ID is the string after
// |kPartitionNamePrefixDlc| in partition_name).
- const auto dlc_id = partition_name.substr(
- strlen(brillo::chromeos_update_engine::kPartitionNamePrefixDlc));
+ const auto dlc_id = partition_name.substr(strlen(kPartitionNamePrefixDlc));
if (dlc_id.empty()) {
LOG(ERROR) << " partition name does not contain dlc id:"
<< partition_name;
return false;
}
- *device =
- base::FilePath(
- brillo::chromeos_update_engine::kDlcInstallRootDirectoryEncrypted)
- .Append(dlc_id)
- .Append(slot == 0
- ? brillo::chromeos_update_engine::kPartitionNameDlcA
- : brillo::chromeos_update_engine::kPartitionNameDlcB)
- .Append(brillo::chromeos_update_engine::kPartitionNameDlcImage)
- .value();
+ *device = base::FilePath(kDlcInstallRootDirectoryEncrypted)
+ .Append(dlc_id)
+ .Append(slot == 0 ? kPartitionNameDlcA : kPartitionNameDlcB)
+ .Append(kPartitionNameDlcImage)
+ .value();
return true;
}
int partition_num = GetPartitionNumber(partition_name, slot);