Hello.
I want to call call_usermodehelper() to start /sbin/.init (a bash script)
and wait for completion of /sbin/.init just before /sbin/init (pid == 1) starts.
Regarding 2.6.23-rc1 kernel, it seems to work fine by calling it as
char *argv[2], *envp[3];
argv[0] = "/sbin/.init";
argv[1] = NULL;
envp[0] = "HOME=/";
envp[1] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
envp[2] = NULL;
call_usermodehelper(argv[0], argv, envp, 1);
/* Continue do_execve() of /sbin/init . */
when do_execve("/sbin/init") is requested, but regarding 2.4.35 kernel,
call_usermodehelper(argv[0], argv, envp);
/* Continue do_execve() of /sbin/init . */
starts /sbin/.init but does not wait for completion of /sbin/.init .
I know /sbin/.init has started because if I change to
call_usermodehelper(argv[0], argv, envp);
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(HZ * 5);
/* Continue do_execve() of /sbin/init . */
it waits for completion of /sbin/.init .
I verified that current->pid == 1 at do_execve() and
current_is_keventd() == false at call_usermodehelper().
I want to continue execve() of /sbin/init
as soon as possible after /sbin/.init completes.
The reason I want to use call_usermodehelper() is that
I don't want to add init=/sbin/.init to kernel cmdline if possible.
Any suggestions?
Regards.
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ