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

Duncan Roe duncan_roe at optusnet.com.au
Thu May 21 12:33:32 GMT 2009


On Wed, May 20, 2009 at 09:42:01PM +1000, Ben Coughlan wrote:
> Hi All,
>
> I'm working on using linux in very small/embedded environments and I'm
> currently in the process of stripping linux down to fit a specific
> system, and I have a couple of questions:
>
> 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.

It certainly used to be possible, at least from a floppy. That's what the rdev
command was all about. That approach wouldn't work too well for a hard drive,
because the kernel would overwrite the partition table. But you could configure
LILO to immediately boot the kernel.
>
> 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.

Don't you mean /sbin/init? That's what my kernel starts. Anyway you can override
that with whatever you like, by appending "init={my program}" to the boot
command line. You can do that with LILO's "append=" or build it right into the
kernel with make xconfig or whatever you use.

As for passing arguments - yes you can do that too: the kernel will pass any
arguments it can't interpret to the "init" process.

If you bypass init, no rc scripts will be run and no services started that these
scripts would normally start. ldconfig will not have been run either. Doing all
that is up to you.
>
> 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.
>
> Regards,
> Ben Coughlan

Cheers ... Duncan.

--
 Please avoid sending me Word or PowerPoint attachments.
 See http://www.gnu.org/philosophy/no-word-attachments.html


More information about the linux mailing list