public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Kernel setup()
@ 2003-03-12  8:26 Oliver Tennert
  2003-03-12 16:24 ` H. Peter Anvin
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Tennert @ 2003-03-12  8:26 UTC (permalink / raw)
  To: marcelo; +Cc: linux-kernel

Hi Marcelo,

I am lacking some understanding concerning the setup() routine of Linux
>=2.4.19.

If I understand it right, then with kernel version 2.4.19, some novelties
concerning the handling of initrd and rootdevs has entered the kernel.

The same "linuxrc" program, e.g., can work with a 2.4.18, but not with a
2.4.19/20.

I have thought (and the initrd documentation in the Documentation/
directory states it, too) that the pivot_root mechanism is the "new one",
whereas the change_root machanism which automatically takes place if the
linuxrc programs exits for some reason, is the "old one".

Now have a look a the following example linuxrc sniplet, taken from
SuSE-7.3/8.0.


--- mk_initrd   Tue Mar  4 14:13:43 2003
+++ mk_initrd   Tue Mar  4 14:14:43 2003
...

 mount -n -t proc proc /proc
+echo 0x0100 > /proc/sys/kernel/real-root-dev
 mount -n -t $rootfstype $rootdev /mnt
 rm -f /mnt/.initrd 2>/dev/null
 mkdir -p /mnt/.initrd
..

The point is that without the "echo ..." line, the mounting of the
__real__ root device (harddisk partition) won't work for kernels >=2.4.19.

On the other hand, this should actually not be necessary if using a
pivot_root call.

Recent distributions now handle the problem by just having linuxrc loading
the necessary modules and exiting all of a sudden, and everything works.

My question is: is pivot_root deprecated by now? I just am quite dazzled
and want to know how to __cleanly__ handle the mounting of a new root
device.

Best regards

Oliver


		   Dr. Oliver Tennert

  		   +49 -7071 -9457-598

 		   e-mail: O.Tennert@science-computing.de
  		   science + computing AG
  		   Hagellocher Weg 71
   		   D-72070 Tuebingen



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Kernel setup()
  2003-03-12  8:26 Kernel setup() Oliver Tennert
@ 2003-03-12 16:24 ` H. Peter Anvin
  0 siblings, 0 replies; 2+ messages in thread
From: H. Peter Anvin @ 2003-03-12 16:24 UTC (permalink / raw)
  To: linux-kernel

Followup to:  <Pine.GHP.4.53.0303120915340.16277@alderaan.science-computing.de>
By author:    Oliver Tennert <tennert@science-computing.de>
In newsgroup: linux.dev.kernel
> 
> My question is: is pivot_root deprecated by now? I just am quite dazzled
> and want to know how to __cleanly__ handle the mounting of a new root
> device.
> 

pivot_root() is the currently preferred method.  Depending on where
the initramfs is by the time Linux 2.6 comes out it may be replaced by
then, but for 2.4, pivot_root() is the way to go.

	-hpa
-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
Architectures needed: ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-03-12 16:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-12  8:26 Kernel setup() Oliver Tennert
2003-03-12 16:24 ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox