Merge "Call GetDsuMetadataKeyDir() for DSU metadata encryption dir" am: 346e6792b4
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1452359 Change-Id: I1f511c4873b5daf34a748ec318d020d1749293e9
This commit is contained in:
commit
99436bf2aa
3 changed files with 12 additions and 5 deletions
|
|
@ -583,7 +583,8 @@ bool EraseFstabEntry(Fstab* fstab, const std::string& mount_point) {
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
void TransformFstabForDsu(Fstab* fstab, const std::vector<std::string>& dsu_partitions) {
|
void TransformFstabForDsu(Fstab* fstab, const std::string& dsu_slot,
|
||||||
|
const std::vector<std::string>& dsu_partitions) {
|
||||||
static constexpr char kDsuKeysDir[] = "/avb";
|
static constexpr char kDsuKeysDir[] = "/avb";
|
||||||
// Convert userdata
|
// Convert userdata
|
||||||
// Inherit fstab properties for userdata.
|
// Inherit fstab properties for userdata.
|
||||||
|
|
@ -594,7 +595,7 @@ void TransformFstabForDsu(Fstab* fstab, const std::vector<std::string>& dsu_part
|
||||||
userdata.fs_mgr_flags.logical = true;
|
userdata.fs_mgr_flags.logical = true;
|
||||||
userdata.fs_mgr_flags.formattable = true;
|
userdata.fs_mgr_flags.formattable = true;
|
||||||
if (!userdata.metadata_key_dir.empty()) {
|
if (!userdata.metadata_key_dir.empty()) {
|
||||||
userdata.metadata_key_dir += "/gsi";
|
userdata.metadata_key_dir = android::gsi::GetDsuMetadataKeyDir(dsu_slot);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
userdata = BuildDsuUserdataFstabEntry();
|
userdata = BuildDsuUserdataFstabEntry();
|
||||||
|
|
@ -687,9 +688,14 @@ bool ReadFstabFromFile(const std::string& path, Fstab* fstab) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!is_proc_mounts && !access(android::gsi::kGsiBootedIndicatorFile, F_OK)) {
|
if (!is_proc_mounts && !access(android::gsi::kGsiBootedIndicatorFile, F_OK)) {
|
||||||
|
std::string dsu_slot;
|
||||||
|
if (!android::gsi::GetActiveDsu(&dsu_slot)) {
|
||||||
|
PERROR << __FUNCTION__ << "(): failed to get active dsu slot";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
std::string lp_names;
|
std::string lp_names;
|
||||||
ReadFileToString(gsi::kGsiLpNamesFile, &lp_names);
|
ReadFileToString(gsi::kGsiLpNamesFile, &lp_names);
|
||||||
TransformFstabForDsu(fstab, Split(lp_names, ","));
|
TransformFstabForDsu(fstab, dsu_slot, Split(lp_names, ","));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NO_SKIP_MOUNT
|
#ifndef NO_SKIP_MOUNT
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,8 @@ std::vector<FstabEntry*> GetEntriesForMountPoint(Fstab* fstab, const std::string
|
||||||
// dsu_partitions[0] = "system_gsi"
|
// dsu_partitions[0] = "system_gsi"
|
||||||
// dsu_partitions[1] = "userdata_gsi"
|
// dsu_partitions[1] = "userdata_gsi"
|
||||||
// dsu_partitions[2] = ...
|
// dsu_partitions[2] = ...
|
||||||
void TransformFstabForDsu(Fstab* fstab, const std::vector<std::string>& dsu_partitions);
|
void TransformFstabForDsu(Fstab* fstab, const std::string& dsu_slot,
|
||||||
|
const std::vector<std::string>& dsu_partitions);
|
||||||
|
|
||||||
std::set<std::string> GetBootDevices();
|
std::set<std::string> GetBootDevices();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -613,7 +613,7 @@ void FirstStageMount::UseDsuIfPresent() {
|
||||||
}
|
}
|
||||||
// Publish the logical partition names for TransformFstabForDsu
|
// Publish the logical partition names for TransformFstabForDsu
|
||||||
WriteFile(gsi::kGsiLpNamesFile, lp_names);
|
WriteFile(gsi::kGsiLpNamesFile, lp_names);
|
||||||
TransformFstabForDsu(&fstab_, dsu_partitions);
|
TransformFstabForDsu(&fstab_, active_dsu, dsu_partitions);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FirstStageMountVBootV1::GetDmVerityDevices(std::set<std::string>* devices) {
|
bool FirstStageMountVBootV1::GetDmVerityDevices(std::set<std::string>* devices) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue