Fix build.prop file directory creation / file links.

Bug: 158301941
Bug: 159367383
Test: Combine this branch with a GSI build
Change-Id: I939cca188d50499768678e8ca2df78f54e207134
diff --git a/host/commands/assemble_cvd/super_image_mixer.cc b/host/commands/assemble_cvd/super_image_mixer.cc
index aae5033..1171126 100644
--- a/host/commands/assemble_cvd/super_image_mixer.cc
+++ b/host/commands/assemble_cvd/super_image_mixer.cc
@@ -66,8 +66,10 @@
   "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 @@
       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 @@
       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;