Author: justin
Date: 2006-02-12 22:45:55 -0700 (Sun, 12 Feb 2006)
New Revision: 1405

Modified:
   branches/6.1.1/initramfs/init.c
Log:
Merged init.c fix (Hard to re-produce error at startup causing LiveCD to halt 
at Starting init...) from trunk to 6.1.1 branch.

Modified: branches/6.1.1/initramfs/init.c
===================================================================
--- branches/6.1.1/initramfs/init.c     2006-02-13 05:41:25 UTC (rev 1404)
+++ branches/6.1.1/initramfs/init.c     2006-02-13 05:45:55 UTC (rev 1405)
@@ -25,6 +25,7 @@
 
 int main(int argc, char * argv[], char * envp[])
 {
+       char **cmd = malloc( sizeof(char *) * (argc+1) );
        int i, fd, ffd;
        struct loop_info loopinfo;
        
@@ -147,10 +148,15 @@
        /* We're done! Pass control to sysvinit. */
 
        printf("Starting init...\n");
-       i = execve("/sbin/init", argv, envp);
-       if (i<0)
-               printf("Failed to start init: %s :(\n", strerror(errno));
+       cmd[0] = malloc( sizeof(char) * 11);
+       cmd[0] = strncpy(cmd[0], "/sbin/init", 11);
 
+        for (i=1; i <= argc; i++) {
+                cmd[i] = argv[i];
+        }
+        i = execve(cmd[0], cmd, envp);
+       printf("Failed to start init: %s :(\n", strerror(errno));
+
        return(0);
 }
 

-- 
http://linuxfromscratch.org/mailman/listinfo/livecd
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to