Kernel setup()

From: Oliver Tennert (tennert@science-computing.de)
Date: Wed Mar 12 2003 - 03:26:23 EST


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

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



This archive was generated by hypermail 2b29 : Sat Mar 15 2003 - 22:00:29 EST