From: Chris Lingard <chris@ukpost.com>
To: hpa@zytor.com
Cc: linux-kernel@vger.kernel.org
Subject: 2.4.22 init/do_mounts.c Bug when booting a devfs CD
Date: Thu, 9 Oct 2003 11:51:37 +0100 [thread overview]
Message-ID: <200310091151.38016.chris@ukpost.com> (raw)
[-- 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 },
reply other threads:[~2003-10-09 10:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200310091151.38016.chris@ukpost.com \
--to=chris@ukpost.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox