I've always wondered how the kernel passes control to third-party code, or specifically distribution-specific code, during boot.

I've dug around in GRUB's configuration files, suspecting a special parameter to be passed to the kernel to let it know what to do once it has booted successfully, but unable to find anything. This leads me to suspect there may be certain files on the root partition that the kernel looks for.

I'd be grateful if someone could shed some light upon this matter. How do distributions achieve this?

2 Answers 2


It's hardcoded, but you can override the defaults by the kernel parameter init=....

From init/main.c:

if (execute_command) {
  printk(KERN_WARNING "Failed to execute %s.  Attempting "
        "defaults...\n", execute_command);

panic("No init found.  Try passing init= option to kernel. "
      "See Linux Documentation/init.txt for guidance.");
  • 1
    Is it safe to assume that /etc/inittab is distribution-specific and contains the scripts responsible for initialization then?
    – haste
    Feb 23, 2012 at 16:04
  • @haste It's not always inittab: it's whatever the init uses (there are three init systems around on Linux these days: SysVinit, Upstart and Systemd; see What's the connection between "/etc/init.d" and "/etc/rcX.d" directories in Linux? Feb 23, 2012 at 23:27
  • @Gilles Does this mean that the kernel doesn't ship with any of these init variants you mentioned? And as a result, the distribution is responsible for making sure an init executable is available where the kernel would look (by boot parameter or defaults)?
    – haste
    Feb 24, 2012 at 0:27
  • @haste: Correct. In contrast to some other systems (like FreeBSD), Linux is just a kernel. Everything else is added by the distribution, and purists tend to refer to complete systems as "GNU/Linux" to stress the fact that in addition to the Linux kernel, there a boatload of GNU programs is needed to get a usable system. Feb 24, 2012 at 8:57
  • @haste The kernel is only a kernel. A working Linux systems requires many utilities that are shipped separately and put together by distributions; init is one of them. (BTW @ Ansgar the GNU project doesn't have an init, all the choices for init are by other projects. A lot of embedded Linux systems have no software that come from the GNU project, but that would be exceptionally rare on a desktop or server, and even embedded systems are mostly compiled with the GNU compiler.) Feb 24, 2012 at 9:12

Wikipedia has a nice article about the Linux start up process.

Today, usually an initramfs is used.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.