[clug] Booting without a bootloader & alternatives to /init

Tony Breeds tony at bakeyournoodle.com
Thu May 21 00:11:13 GMT 2009


On Wed, May 20, 2009 at 09:42:01PM +1000, Ben Coughlan wrote:

> Is it possible to boot the kernel without using a bootloader?  I've seen 
> HOWTOs discussing how to do this with floppy disk, but I'm wondering how 
> it can be done from a hard drive, or a compact flash card.

Not any more (well certainly not on an intel based system), but "syslinux"
is a really minimal bootloader for intel systems.

> Secondly; can I have the kernel run something other than /init when it's 
> done booting?  Ideally I would just like to call my application binary.  
> Are there any services I'll be missing if I don't use /init?  I don't 
> need to spawn a shell anywhere, but I would like some DHCP action.  I 
> would also enjoy being able to pass arguments to this binary if at all 
> possible.

Sure you can add init=/path/to/your/app to the kernel commandline and the it
will what ever you ask.  As to what you'll miss that's a tougher question.
You PID 1 will be your binary, so it will need to start sshd or any consle
services you need.

> And while I'm here;  I've compiled my kernel by starting with 'make  
> allnoconfig' and then rebooting/recompiling until I have a system  
> running with the required drivers.  Can anyone think of any boxes I  
> might want to tick that may not have been noticed in this process,  
> keeping in mind I want it as small and uncluttered as I can make it.

Again that depnds on your needs.  For exmaple, You probably do not have
/proc or /sys support and if you'er only ever going to run your one app
you may not miss them BUT if you need to debug your app in a slightly
more "rich" environment you may :)

Yours Tony


More information about the linux mailing list