Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a92749eb authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "have patchoat take directories instead of filenames"

parents 019681c7 77c48751
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -352,7 +352,7 @@ private:


        std::string preopted_boot_art_path = StringPrintf("/system/framework/%s/boot.art", isa);
        std::string preopted_boot_art_path = StringPrintf("/system/framework/%s/boot.art", isa);
        if (access(preopted_boot_art_path.c_str(), F_OK) == 0) {
        if (access(preopted_boot_art_path.c_str(), F_OK) == 0) {
          return PatchoatBootImage(art_path, isa);
          return PatchoatBootImage(isa_path, isa);
        } else {
        } else {
          // No preopted boot image. Try to compile.
          // No preopted boot image. Try to compile.
          return Dex2oatBootImage(boot_classpath_, art_path, oat_path, isa);
          return Dex2oatBootImage(boot_classpath_, art_path, oat_path, isa);
@@ -421,14 +421,14 @@ private:
        CHECK_EQ(0, closedir(c_dir)) << "Unable to close directory.";
        CHECK_EQ(0, closedir(c_dir)) << "Unable to close directory.";
    }
    }


    bool PatchoatBootImage(const std::string& art_path, const char* isa) const {
    bool PatchoatBootImage(const std::string& output_dir, const char* isa) const {
        // This needs to be kept in sync with ART, see art/runtime/gc/space/image_space.cc.
        // This needs to be kept in sync with ART, see art/runtime/gc/space/image_space.cc.


        std::vector<std::string> cmd;
        std::vector<std::string> cmd;
        cmd.push_back("/system/bin/patchoat");
        cmd.push_back("/system/bin/patchoat");


        cmd.push_back("--input-image-location=/system/framework/boot.art");
        cmd.push_back("--input-image-location=/system/framework/boot.art");
        cmd.push_back(StringPrintf("--output-image-file=%s", art_path.c_str()));
        cmd.push_back(StringPrintf("--output-image-directory=%s", output_dir.c_str()));


        cmd.push_back(StringPrintf("--instruction-set=%s", isa));
        cmd.push_back(StringPrintf("--instruction-set=%s", isa));