* 2.4.22 init/do_mounts.c Bug when booting a devfs CD
@ 2003-10-09 10:51 Chris Lingard
0 siblings, 0 replies; only message in thread
From: Chris Lingard @ 2003-10-09 10:51 UTC (permalink / raw)
To: hpa; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 974 bytes --]
Hope I have the right person; you may be interested in this.
I boot a CD using initrd; the RAMDISK uses devfs within the linuxrc script
to pivot_root/chroot as in the documentation. In the documentation it
is suggested that root=/dev/rd/0 is used, if using devfs.
A boot using root=/dev/ram0 works fine, root=/dev/rd/0 shows a bug
in init/do_mounts.c, in void prepare_namespace(void)
The test:
if (initrd_load() && ROOT_DEV != MKDEV(RAMDISK_MAJOR, 0))
is true, and handle_initrd() is wrongly called. This is a bug, (I assume
that this code is to relinquish the original boot). The call that is used
is at the end of main.c where linuxrc is called instead of /sbin/init.
This is because rd/0 is not in root_dev_names; a patch is attached to fix
this.
Strangly enough, it still boots, despite linuxrc being called twice :-)
An alternative would be to change the documentation of initrd, so
that only root=/dev/ram0 is mentioned, despite using devfs.
Chris Lingard
[-- Attachment #2: linux-2.4.22-rd0.patch --]
[-- Type: text/x-diff, Size: 531 bytes --]
diff -Naur linux-2.4.22.old/init/do_mounts.c linux-2.4.22/init/do_mounts.c
--- linux-2.4.22.old/init/do_mounts.c 2003-09-10 12:18:55.000000000 +0100
+++ linux-2.4.22/init/do_mounts.c 2003-09-23 12:46:36.000000000 +0100
@@ -227,6 +227,11 @@
{ "ataraid/d13p",0x72D0 },
{ "ataraid/d14p",0x72E0 },
{ "ataraid/d15p",0x72F0 },
+#ifdef CONFIG_BLK_DEV_RAM
+#ifdef CONFIG_BLK_DEV_INITRD
+ { "rd/0", 0x0100 },
+#endif
+#endif
{ "rd/c0d0p",0x3000 },
{ "rd/c0d0p1",0x3001 },
{ "rd/c0d0p2",0x3002 },
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-10-09 10:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-09 10:51 2.4.22 init/do_mounts.c Bug when booting a devfs CD Chris Lingard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox