Re: [PATCH] 5 year old bug in main.c (initrd). Can this please be fixed?

From: Werner Almesberger (
Date: Thu May 25 2000 - 05:28:38 EST

Dave Cinege wrote:
> It *precludes* you from using the initrd as your root and executing /linuxrc.

You can always init=/linuxrc and exec the real init at the end. Or
set root= to someting else and change it to /dev/ram in /linuxrc.

> The point is there is NO REASON (but personal
> preference) to skip /linuxrc when your root is the first ramdisk.

It's "initrd is always magic" and "/linuxrc is there to do that
root change thing" vs. "A RAM disk root is a regular RAM disk root
no matter how you load it".

You're quite right about the documentation problem, though. While
I agree that the documented behaviour agrees better with current
expectations (i.e. everybody expects something magic to happen if
there's initrd), I'm extremenly reluctant to break existing
behaviour, because somebody might depend on initrd working exactly
as it currently does for root=/dev/ram, and sudden boot failure is
never a nice thing to introduce.

> Personally I'd like to see /linuxrc executed if it's present regaudless of
> initrd, to allow for a standerized 'pre-init'.

Hmm, doesn't look like a good idea to me. First, you're overloading
/linuxrc. Second, where do you stop - you may as well need a further
pre-init step ? Third, you can do it already in user space.

If you trust init, you can just invoke your initialization from

If you don't trust init, you should (*) be able to rename it and use
a replacement that does the initialization, maybe checks for a
secondinit=... option (or "init2", or just pops another instance of
init=... off argv, whatever), and then execs the real init.

(*) May be harder if checks argv[0]. Not sure if it does.

- Werner

 / Werner Almesberger, ICA, EPFL, CH /

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to Please read the FAQ at

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