public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrey Borzenkov <arvidjaar@mail.ru>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@osdl.org>
Subject: [PATCH][2.6.0-test8] fix new initrd with devfs
Date: Sun, 26 Oct 2003 02:23:22 +0300	[thread overview]
Message-ID: <200310260223.22765.arvidjaar@mail.ru> (raw)

[-- Attachment #1: Type: text/plain, Size: 308 bytes --]

If devfs is mounted on boot initrd does not work. devfs does not allow 
creation of files other than device and symlink. Now when initrd is no more 
device there is no reason to create it in /dev either. The patch simply 
changes /dev/initrd -> /initrd.img. I do not insist on this name :)

regards

-andrey

[-- Attachment #2: 2.6.0-test8-initrd_with_devfs.patch --]
[-- Type: text/x-diff, Size: 1500 bytes --]

--- ../tmp/linux-2.6.0-test8/init/initramfs.c	2003-10-25 22:26:11.000000000 +0400
+++ linux-2.6.0-test8/init/initramfs.c	2003-10-26 02:04:00.000000000 +0400
@@ -497,7 +497,7 @@ void __init populate_rootfs(void)
 			return;
 		}
 		printk("it isn't (%s); looks like an initrd\n", err);
-		fd = sys_open("/dev/initrd", O_WRONLY|O_CREAT, 700);
+		fd = sys_open("/initrd.img", O_WRONLY|O_CREAT, 700);
 		if (fd >= 0) {
 			sys_write(fd, (char *)initrd_start,
 					initrd_end - initrd_start);
--- ../tmp/linux-2.6.0-test8/init/do_mounts_rd.c	2003-10-25 22:22:22.000000000 +0400
+++ linux-2.6.0-test8/init/do_mounts_rd.c	2003-10-26 02:08:02.000000000 +0400
@@ -185,7 +185,7 @@ int __init rd_load_image(char *from)
 	else
 		devblocks >>= 1;
 
-	if (strcmp(from, "/dev/initrd") == 0)
+	if (strcmp(from, "/initrd.img") == 0)
 		devblocks = nblocks;
 
 	if (devblocks == 0) {
--- ../tmp/linux-2.6.0-test8/init/do_mounts_initrd.c	2003-10-25 22:26:11.000000000 +0400
+++ linux-2.6.0-test8/init/do_mounts_initrd.c	2003-10-26 02:03:37.000000000 +0400
@@ -109,12 +109,12 @@ int __init initrd_load(void)
 		 * in that case the ram disk is just set up here, and gets
 		 * mounted in the normal path.
 		 */
-		if (rd_load_image("/dev/initrd") && ROOT_DEV != Root_RAM0) {
-			sys_unlink("/dev/initrd");
+		if (rd_load_image("/initrd.img") && ROOT_DEV != Root_RAM0) {
+			sys_unlink("/initrd.img");
 			handle_initrd();
 			return 1;
 		}
 	}
-	sys_unlink("/dev/initrd");
+	sys_unlink("/initrd.img");
 	return 0;
 }

                 reply	other threads:[~2003-10-25 23:14 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=200310260223.22765.arvidjaar@mail.ru \
    --to=arvidjaar@mail.ru \
    --cc=akpm@osdl.org \
    --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