From 6e269c6bc4ca52064f526ff52ddc36f117fab1b5 Mon Sep 17 00:00:00 2001 From: apio Date: Sun, 30 Jul 2023 13:08:53 +0200 Subject: [PATCH] preinit: Search for init in several directories --- apps/preinit.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/apps/preinit.cpp b/apps/preinit.cpp index 8d1a4652..e9d99160 100644 --- a/apps/preinit.cpp +++ b/apps/preinit.cpp @@ -72,13 +72,10 @@ int main() // Now, mount the /dev file system on the new root. mount_devfs(); - /*setenv("PATH", "/bin:/usr/bin", 1); + setenv("PATH", "/sbin:/usr/bin", 1); char* argv[] = { "init", nullptr }; char* envp[] = { nullptr }; - execvpe(argv[0], argv, envp);*/ - - char* argv[] = { "/usr/bin/init", nullptr }; - execv(argv[0], argv); + execvpe(argv[0], argv, envp); fail_errno("Failed to execute init");