r805 - x86/branches/utf8-newmake/initramfs

alexander at linuxfromscratch.org alexander at linuxfromscratch.org
Fri Sep 30 07:25:26 PDT 2005


Author: alexander
Date: 2005-09-30 08:25:25 -0600 (Fri, 30 Sep 2005)
New Revision: 805

Modified:
   x86/branches/utf8-newmake/initramfs/init.c
Log:
Correctly pass arguments and environment variables
from kernel command line to /sbin/init


Modified: x86/branches/utf8-newmake/initramfs/init.c
===================================================================
--- x86/branches/utf8-newmake/initramfs/init.c	2005-09-30 08:54:29 UTC (rev 804)
+++ x86/branches/utf8-newmake/initramfs/init.c	2005-09-30 14:25:25 UTC (rev 805)
@@ -19,14 +19,11 @@
 	NULL,
 };
 
-char *init_envp[10] = { "HOME=/", "TERM=linux", NULL, };
-char *init_argv[10] = { "init", NULL, };
-
 const char *lfscd;
 
 int mountlfscd(void);
 
-int main(void)
+int main(int argc, char * argv[], char * envp[])
 {
 	int i, fd, ffd;
 	struct loop_info loopinfo;
@@ -150,7 +147,7 @@
 	/* We're done! Pass control to sysvinit. */
 
 	printf("Starting init...\n");
-	i = execve("/sbin/init", init_argv, init_envp);
+	i = execve("/sbin/init", argv, envp);
 	if (i<0)
 		printf("Failed to start init: %s :(\n", strerror(errno));
 




More information about the livecd mailing list