Re: preinit= (Was: Re: [PATCH] 5 year old bug in main.c (initrd). Can this

From: Werner Almesberger (almesber@lrc.epfl.ch)
Date: Mon May 29 2000 - 17:32:50 EST


Dave Cinege wrote:
> Useful for setting up things prior to init, like devfs

If you need to do work before the "real init", you can call the "real
init" something else, run your pre-init instead of the "real init" and
then exec the "real init". Some of your startup files need to know
about any concept of "pre-init" anyway, so you'll have to make some
changes to your user space no matter what you do.

I really don't understand why you want to put stuff into the kernel
that can live perfectly well in user space. Also, your approach has
the following problems:

 - doesn't scale - if you need another step (i.e. because preinit also
   doesn't do all you need and you can't change it for some reason),
   you have to create yet another option
 - adds a mandatory boot command line option, which has the following
   problems:
   - increases the length of the boot command line
   - tight dependency on the user space setup, and needs to be
     preserved across boot loader configuration changes
   - doesn't work with loaders that don't support command lines
     (e.g. the floppy boot sector)
 - isn't backwards-compatible with older kernel versions

> Works even if you're not using initrd

Ditto.

> Standardized way to execute things prior to init

If it becomes necessary, I'm sure distributors will happily pick up
your init-nee-preinit replacement.

> Will not fail for lack of /dev/console (Current init= will!)

Maybe /sbin/init does, but the kernel will invoke it whether you
have a console or not.

- Werner

-- 
  _________________________________________________________________________
 / Werner Almesberger, ICA, EPFL, CH       werner.almesberger@ica.epfl.ch /
/_IN_N_032__Tel_+41_21_693_6621__Fax_+41_21_693_6610_____________________/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:22 EST