[PATCH] initrd with devfs enabled (Re: initrd and 2.6.0-test8)

From: viro
Date: Sat Oct 18 2003 - 14:42:39 EST


OK, that should do it - the problems happened if you had devfs
enabled; in that case late-boot code does temporary mount of devfs over
rootfs /dev, which made /dev/initrd inaccessible. For setups without
devfs that didn't happen.

Fix is trivial - put the file in question outside of /dev; IOW,
we simply replace "/dev/initrd" with "/initrd.image" in init/*. It works
here; please check if it fixes all initrd problems on your boxen.

diff -urN B8/init/do_mounts_initrd.c B8-current/init/do_mounts_initrd.c
--- B8/init/do_mounts_initrd.c Sat Oct 18 13:09:57 2003
+++ B8-current/init/do_mounts_initrd.c Sat Oct 18 15:26:58 2003
@@ -109,12 +109,12 @@
* 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.image") && ROOT_DEV != Root_RAM0) {
+ sys_unlink("/initrd.image");
handle_initrd();
return 1;
}
}
- sys_unlink("/dev/initrd");
+ sys_unlink("/initrd.image");
return 0;
}
diff -urN B8/init/do_mounts_rd.c B8-current/init/do_mounts_rd.c
--- B8/init/do_mounts_rd.c Sat Sep 27 22:05:01 2003
+++ B8-current/init/do_mounts_rd.c Sat Oct 18 15:27:22 2003
@@ -185,7 +185,7 @@
else
devblocks >>= 1;

- if (strcmp(from, "/dev/initrd") == 0)
+ if (strcmp(from, "/initrd.image") == 0)
devblocks = nblocks;

if (devblocks == 0) {
diff -urN B8/init/initramfs.c B8-current/init/initramfs.c
--- B8/init/initramfs.c Sat Oct 18 13:09:57 2003
+++ B8-current/init/initramfs.c Sat Oct 18 15:25:50 2003
@@ -497,7 +497,7 @@
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.image", O_WRONLY|O_CREAT, 700);
if (fd >= 0) {
sys_write(fd, (char *)initrd_start,
initrd_end - initrd_start);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/