If you are an embedded Linux developer too, you have probably been frustrated by the lack of information from the Linux kernel when it failed to start the
init process when you’re building a new root filesystem. The only thing you get is
No init found, and this could hide many different causes:
initprogram candidate found at all
initprogram candidates exist but they can’t be executed, for multiple possible causes (missing execute permissions, failed to load shared libraries, executable compiled for an unknown architecture…)
The good news is that this source of frustration will be gone in Linux 3.13. Thanks to a Bootlin commit merged on Nov. 13, 2013, whenever an attempt to execute an
init program candidate fails, there is a message in the console detailing the executable path and the error code. For example:
Starting init: /sbin/init exists but couldn't execute it (error -13)
When you get such a message, all you have to do is lookup the error code in include/uapi/asm-generic/errno-base.h or maybe in uapi/asm-generic/errno.h. In the above example, the
-13 code meant
permission denied, typically because of missing execution rights.
This had been annoying me for a long time, and I am glad that the Linux kernel community accepted my improvement!
By the way, many more improvements to the Linux kernel from Bootlin are currently getting merged in 3.13. See all our contributions to the Linux kernel.