Merge "Call GetDsuMetadataKeyDir() for DSU metadata encryption dir"
This commit is contained in:
commit
346e6792b4
3 changed files with 12 additions and 5 deletions
|
|
@ -583,7 +583,8 @@ bool EraseFstabEntry(Fstab* fstab, const std::string& mount_point) {
|
|||
|
||||
} // 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";
|
||||
// Convert 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.formattable = true;
|
||||
if (!userdata.metadata_key_dir.empty()) {
|
||||
userdata.metadata_key_dir += "/gsi";
|
||||
userdata.metadata_key_dir = android::gsi::GetDsuMetadataKeyDir(dsu_slot);
|
||||
}
|
||||
} else {
|
||||
userdata = BuildDsuUserdataFstabEntry();
|
||||
|
|
@ -687,9 +688,14 @@ bool ReadFstabFromFile(const std::string& path, Fstab* fstab) {
|
|||
return false;
|
||||
}
|
||||
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;
|
||||
ReadFileToString(gsi::kGsiLpNamesFile, &lp_names);
|
||||
TransformFstabForDsu(fstab, Split(lp_names, ","));
|
||||
TransformFstabForDsu(fstab, dsu_slot, Split(lp_names, ","));
|
||||
}
|
||||
|
||||
#ifndef NO_SKIP_MOUNT
|
||||
|
|
|
|||
|
|
@ -113,7 +113,8 @@ std::vector<FstabEntry*> GetEntriesForMountPoint(Fstab* fstab, const std::string
|
|||
// dsu_partitions[0] = "system_gsi"
|
||||
// dsu_partitions[1] = "userdata_gsi"
|
||||
// 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();
|
||||
|
||||
|
|
|
|||
|
|
@ -613,7 +613,7 @@ void FirstStageMount::UseDsuIfPresent() {
|
|||
}
|
||||
// Publish the logical partition names for TransformFstabForDsu
|
||||
WriteFile(gsi::kGsiLpNamesFile, lp_names);
|
||||
TransformFstabForDsu(&fstab_, dsu_partitions);
|
||||
TransformFstabForDsu(&fstab_, active_dsu, dsu_partitions);
|
||||
}
|
||||
|
||||
bool FirstStageMountVBootV1::GetDmVerityDevices(std::set<std::string>* devices) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue