diff options
author | A. Cody Schuffelen <schuffelen@google.com> | 2020-06-19 07:10:23 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-06-19 07:10:23 +0000 |
commit | 830f567fc71b207c01987a11cb4f841c52538905 (patch) | |
tree | bc1ff21c0f680c24fd3e1816944487ca37d4846f | |
parent | a6ba89f50cce74d631d5964eda4b1d625feecaa4 (diff) | |
parent | bbb1dd1503320aa4401d27ed367b0f9d476e77ec (diff) | |
download | cuttlefish-830f567fc71b207c01987a11cb4f841c52538905.tar.gz |
Fix build.prop file directory creation / file links. am: bbb1dd1503
Original change: https://googleplex-android-review.googlesource.com/c/device/google/cuttlefish/+/11923404
Change-Id: Ice54a8cd21dbb18c0870bac41feecae31337e8c5
-rw-r--r-- | host/commands/assemble_cvd/super_image_mixer.cc | 50 |
1 files changed, 2 insertions, 48 deletions
diff --git a/host/commands/assemble_cvd/super_image_mixer.cc b/host/commands/assemble_cvd/super_image_mixer.cc index aae503381..117112621 100644 --- a/host/commands/assemble_cvd/super_image_mixer.cc +++ b/host/commands/assemble_cvd/super_image_mixer.cc @@ -66,8 +66,10 @@ const std::set<std::string> kDefaultTargetImages = { "IMAGES/vendor.img", }; const std::set<std::string> kDefaultTargetBuildProp = { + "ODM/build.prop", "ODM/etc/build.prop", "VENDOR/build.prop", + "VENDOR/etc/build.prop", }; void FindImports(cvd::Archive* archive, const std::string& build_prop_file) { @@ -177,30 +179,6 @@ bool CombineTargetZipFiles(const std::string& default_target_zip, LOG(ERROR) << "Failed to extract " << name << " from the default target zip"; return false; } - auto name_parts = android::base::Split(name, "/"); - if (name_parts.size() < 2) { - LOG(WARNING) << name << " does not appear to have a partition"; - continue; - } - auto etc_path = output_path + "/" + name_parts[0] + "/etc"; - LOG(INFO) << "Creating directory " << etc_path; - if (mkdir(etc_path.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) < 0 - && errno != EEXIST) { - PLOG(ERROR) << "Could not mkdir " << etc_path; - } - std::string_view name_suffix(name.data(), name.size()); - if (!android::base::ConsumePrefix(&name_suffix, name_parts[0] + "/")) { - LOG(ERROR) << name << " did not start with " << name_parts[0] + "/"; - return false; - } - auto initial_path = output_path + "/" + name; - auto dest_path = output_path + "/" + name_parts[0] + "/etc/" + - std::string(name_suffix); - LOG(INFO) << "Linking " << initial_path << " to " << dest_path; - if (link(initial_path.c_str(), dest_path.c_str())) { - PLOG(ERROR) << "Could not link " << initial_path << " to " << dest_path; - return false; - } } for (const auto& name : system_target_contents) { @@ -229,30 +207,6 @@ bool CombineTargetZipFiles(const std::string& default_target_zip, LOG(ERROR) << "Failed to extract " << name << " from the default target zip"; return false; } - auto name_parts = android::base::Split(name, "/"); - if (name_parts.size() < 2) { - LOG(WARNING) << name << " does not appear to have a partition"; - continue; - } - auto etc_path = output_path + "/" + name_parts[0] + "/etc"; - LOG(INFO) << "Creating directory " << etc_path; - if (mkdir(etc_path.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) < 0 - && errno != EEXIST) { - PLOG(ERROR) << "Could not mkdir " << etc_path; - } - std::string_view name_suffix(name.data(), name.size()); - if (!android::base::ConsumePrefix(&name_suffix, name_parts[0] + "/")) { - LOG(ERROR) << name << " did not start with " << name_parts[0] + "/"; - return false; - } - auto initial_path = output_path + "/" + name; - auto dest_path = output_path + "/" + name_parts[0] + "/etc/" + - std::string(name_suffix); - LOG(INFO) << "Linking " << initial_path << " to " << dest_path; - if (link(initial_path.c_str(), dest_path.c_str())) { - PLOG(ERROR) << "Could not link " << initial_path << " to " << dest_path; - return false; - } } return true; |