diff options
Diffstat (limited to 'mdk-stage1/stage1.c')
-rw-r--r-- | mdk-stage1/stage1.c | 37 |
1 files changed, 3 insertions, 34 deletions
diff --git a/mdk-stage1/stage1.c b/mdk-stage1/stage1.c index 4bed00057..94bb1e0df 100644 --- a/mdk-stage1/stage1.c +++ b/mdk-stage1/stage1.c @@ -121,7 +121,7 @@ static pid_t shell_pid = 0; static void spawn_shell(void) { int fd; - char * shell_name[] = { "/sbin/sh", NULL }; + char * shell_name[] = { "/bin/sh", NULL }; log_message("spawning a shell"); @@ -344,39 +344,8 @@ static void method_select_and_prepare(void) } #endif -static enum return_type create_initial_fs_symlinks(char* symlinks) -{ - FILE *f; - char buf[5000]; - - if (scall(!(f = fopen(symlinks, "rb")), "fopen")) - return RETURN_ERROR; - while (fgets(buf, sizeof(buf), f)) { - char oldpath[500], newpath[500]; - buf[strlen(buf)-1] = '\0'; // trim \n - if (sscanf(buf, "%s %s", oldpath, newpath) != 2) { - sprintf(oldpath, "%s%s", STAGE2_LOCATION, buf); - sprintf(newpath, "%s", buf); - } - recursiveRemove_if_it_exists(newpath); - log_message("creating symlink %s -> %s", oldpath, newpath); - if (scall(symlink(oldpath, newpath), "symlink")) - return RETURN_ERROR; - } - fclose(f); - return RETURN_OK; -} - void finish_preparing(void) { - recursiveRemove("/init"); - - if (create_initial_fs_symlinks(STAGE2_LOCATION "/usr/share/symlinks") != RETURN_OK) - stg1_fatal_message("Fatal error finishing initialization."); - - /* /tmp/syslog is used by the second init, so it must be copied now, not in stage2 */ - /* we remove it to ensure the old one is not copied over it in stage2 */ - #ifdef SPAWN_SHELL if (shell_pid != 0) { int fd; @@ -468,7 +437,7 @@ int main(int argc __attribute__ ((unused)), char **argv __attribute__ ((unused)) if (IS_RESCUE) return 66; /* ask init to exec new init */ - else - return 0x35; /* ask init to run stage2 binary */ + + return 0; #endif } |