[lkml]   [2001]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [Q] pivot_root and initrd
Followup to:  <>
By author: Eric <>
In newsgroup:
> I am mystified that the call to 'exec /sbin/init' works if you are using
> the standard (you mention "based on RedHat7.1" util-linux") /sbin/init
> proggie, and that a standard RH7.1 initscripts would not complain when
> the root filesystem is already mounted r/w.
> I would also guess that you are susceptible to the kernel's change_root
> call if your /sbin/init terminates. I'll have to play with the disk a bit.

I modify the initscripts to not try to fsck and remount the root --
its a ramfs (tmpfs in a later version) after all. If I had been
mounting a filesystem off the harddisk I would either have mounted it
readonly and left the init scripts as-is, or fscked it before

I pass the following command line options to the kernel (this is set
up in isolinux.cfg):

append initrd=initrd.gz root=/dev/ram0 init=/linuxrc single

By specifying root=/dev/ram0 and an explicit init (which I'm calling
/linuxrc but could just as easily have called /sbin/init) I'm telling
the kernel that this is the final root, and effectively turn off most
of the initrd legacy weirdness.

If /sbin/init exits, the kernel panics, just like it would normally do
if init goes away.

<> at work, <> in private!
"Unix gives you enough rope to shoot yourself in the foot." <>
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:08    [W:0.042 / U:0.800 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site