diff --git a/init/host_import_parser.cpp b/init/host_import_parser.cpp
index faf6fc1..93e363f 100644
--- a/init/host_import_parser.cpp
+++ b/init/host_import_parser.cpp
@@ -23,22 +23,17 @@
 namespace android {
 namespace init {
 
-Result<Success> HostImportParser::ParseSection(std::vector<std::string>&& args,
-                                               const std::string& filename, int line) {
+Result<Success> HostImportParser::ParseSection(std::vector<std::string>&& args, const std::string&,
+                                               int) {
     if (args.size() != 2) {
         return Error() << "single argument needed for import\n";
     }
 
-    auto import_path = args[1];
+    return Success();
+}
 
-    if (StartsWith(import_path, "/system") || StartsWith(import_path, "/product") ||
-        StartsWith(import_path, "/odm") || StartsWith(import_path, "/vendor")) {
-        import_path = out_dir_ + "/" + import_path;
-    } else {
-        import_path = out_dir_ + "/root/" + import_path;
-    }
-
-    return ImportParser::ParseSection({"import", import_path}, filename, line);
+Result<Success> HostImportParser::ParseLineSection(std::vector<std::string>&&, int) {
+    return Error() << "Unexpected line found after import statement";
 }
 
 }  // namespace init
diff --git a/init/host_import_parser.h b/init/host_import_parser.h
index e2980b2..52b8891 100644
--- a/init/host_import_parser.h
+++ b/init/host_import_parser.h
@@ -19,21 +19,16 @@
 #include <string>
 #include <vector>
 
-#include "import_parser.h"
 #include "parser.h"
 
 namespace android {
 namespace init {
 
-class HostImportParser : public ImportParser {
+class HostImportParser : public SectionParser {
   public:
-    HostImportParser(const std::string& out_dir, Parser* parser)
-        : ImportParser(parser), out_dir_(out_dir) {}
-    Result<Success> ParseSection(std::vector<std::string>&& args, const std::string& filename,
-                                 int line) override;
-
-  private:
-    std::string out_dir_;
+    HostImportParser() {}
+    Result<Success> ParseSection(std::vector<std::string>&& args, const std::string&, int) override;
+    Result<Success> ParseLineSection(std::vector<std::string>&&, int) override;
 };
 
 }  // namespace init
diff --git a/init/host_init_verifier.cpp b/init/host_init_verifier.cpp
index d6884af..3e510e7 100644
--- a/init/host_init_verifier.cpp
+++ b/init/host_init_verifier.cpp
@@ -17,6 +17,7 @@
 #include <errno.h>
 #include <pwd.h>
 #include <stdio.h>
+#include <stdlib.h>
 
 #include <iostream>
 #include <string>
@@ -45,11 +46,11 @@
 using android::base::ReadFileToString;
 using android::base::Split;
 
-static std::string out_dir;
+static std::string passwd_file;
 
 static std::vector<std::pair<std::string, int>> GetVendorPasswd() {
     std::string passwd;
-    if (!ReadFileToString(out_dir + "/vendor/etc/passwd", &passwd)) {
+    if (!ReadFileToString(passwd_file, &passwd)) {
         return {};
     }
 
@@ -118,20 +119,14 @@
 int main(int argc, char** argv) {
     android::base::InitLogging(argv, &android::base::StdioLogger);
     android::base::SetMinimumLogSeverity(android::base::ERROR);
-    if (argc != 3) {
-        LOG(ERROR) << "Usage: " << argv[0] << " <out directory> <properties>";
-        return -1;
+
+    if (argc != 2 && argc != 3) {
+        LOG(ERROR) << "Usage: " << argv[0] << " <init rc file> [passwd file]";
+        return EXIT_FAILURE;
     }
 
-    out_dir = argv[1];
-
-    auto properties = Split(argv[2], ",");
-    for (const auto& property : properties) {
-        auto split_property = Split(property, "=");
-        if (split_property.size() != 2) {
-            continue;
-        }
-        property_set(split_property[0], split_property[1]);
+    if (argc == 3) {
+        passwd_file = argv[2];
     }
 
     const BuiltinFunctionMap function_map;
@@ -141,22 +136,23 @@
     Parser parser;
     parser.AddSectionParser("service", std::make_unique<ServiceParser>(&sl, nullptr));
     parser.AddSectionParser("on", std::make_unique<ActionParser>(&am, nullptr));
-    parser.AddSectionParser("import", std::make_unique<HostImportParser>(out_dir, &parser));
+    parser.AddSectionParser("import", std::make_unique<HostImportParser>());
 
-    if (!parser.ParseConfig(argv[1] + "/root/init.rc"s)) {
-        LOG(ERROR) << "Failed to find root init.rc script";
-        return -1;
+    if (!parser.ParseConfig(argv[1])) {
+        LOG(ERROR) << "Failed to open init rc script '" << argv[1] << "'";
+        return EXIT_FAILURE;
     }
     if (parser.parse_error_count() > 0) {
-        LOG(ERROR) << "Init script parsing failed with " << parser.parse_error_count() << " errors";
-        return -1;
+        LOG(ERROR) << "Failed to parse init script '" << argv[1] << "' with "
+                   << parser.parse_error_count() << " errors";
+        return EXIT_FAILURE;
     }
-    return 0;
+    return EXIT_SUCCESS;
 }
 
 }  // namespace init
 }  // namespace android
 
 int main(int argc, char** argv) {
-    android::init::main(argc, argv);
+    return android::init::main(argc, argv);
 }
