]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] Fix initrd with devfs enabled
authorAlexander Viro <viro@parcelfarce.linux.theplanet.co.uk>
Mon, 20 Oct 2003 14:34:10 +0000 (07:34 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Mon, 20 Oct 2003 14:34:10 +0000 (07:34 -0700)
This fixes initrd with devfs.  With that combination the late-boot code
does temporary mount of devfs over rootfs /dev, which made /dev/initrd
inaccessible.  For setups without devfs that didn't happen.

The fix is trivial - put the file in question outside of /dev; IOW,
we simply replace "/dev/initrd" with "/initrd.image" in init/*.

Confirmed to fix the problem by Valdis Kletnieks

init/do_mounts_initrd.c
init/do_mounts_rd.c
init/initramfs.c

index 9a0ab579ae4fee08c369d6c790a089d2a53752b6..452b522cbcfa6470a53717299dc284abc5827a1a 100644 (file)
@@ -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.image") && ROOT_DEV != Root_RAM0) {
+                       sys_unlink("/initrd.image");
                        handle_initrd();
                        return 1;
                }
        }
-       sys_unlink("/dev/initrd");
+       sys_unlink("/initrd.image");
        return 0;
 }
index e500fb11033b6416fead153acd891684ea73331c..c4074ad08906a88c99d72fa3b9e947aa87c37c04 100644 (file)
@@ -185,7 +185,7 @@ int __init rd_load_image(char *from)
        else
                devblocks >>= 1;
 
-       if (strcmp(from, "/dev/initrd") == 0)
+       if (strcmp(from, "/initrd.image") == 0)
                devblocks = nblocks;
 
        if (devblocks == 0) {
index 42eda038009f77cd7f1a80fa56d4ca2fd01b571b..38d00d06ebd352064e42e8ee580b7a9ef3c1a787 100644 (file)
@@ -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.image", O_WRONLY|O_CREAT, 700);
                if (fd >= 0) {
                        sys_write(fd, (char *)initrd_start,
                                        initrd_end - initrd_start);