public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][2.6.0-test8] fix new initrd with devfs
@ 2003-10-25 23:23 Andrey Borzenkov
  0 siblings, 0 replies; only message in thread
From: Andrey Borzenkov @ 2003-10-25 23:23 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton

[-- 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;
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-10-25 23:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-25 23:23 [PATCH][2.6.0-test8] fix new initrd with devfs Andrey Borzenkov

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