First userspace executalbe run at boot up

Matthias Brugger matthias.bgg at gmail.com
Tue Aug 27 05:00:00 EDT 2013


Hi all,

I'm actually reading the init/main.c source code to understand which
is the first user space program the Linux kernel runs.

As far as I understood it:
1. tries to execute the file defined by the rdinit= kernel parameter
and sets it to "/init" if the parameter is not given
2. tries to execute the file defined by the init= kernel parameter
3. /sbin/init
4. /etc/init
5. /bin/init
6. /bin/sh
7. No init found - error

All of them try to execute init by invoking run_init_process.
So my question is, why does the rdinit= parameter exist, I suppose for
reasons of compatibility with older kernel versions. But why it is set
to "/init"?
Searching in the web, I found information saying that the first file,
the Linux kernel executes after boot is "/sbin/init". As far as I
understand that's not correct.

Cheers,
Matthias
-- 
motzblog.wordpress.com



More information about the Kernelnewbies mailing list