Commit 2393fb2f authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] Fix initrd with devfs enabled

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
parent d2c46c6c
...@@ -109,12 +109,12 @@ int __init initrd_load(void) ...@@ -109,12 +109,12 @@ int __init initrd_load(void)
* in that case the ram disk is just set up here, and gets * in that case the ram disk is just set up here, and gets
* mounted in the normal path. * mounted in the normal path.
*/ */
if (rd_load_image("/dev/initrd") && ROOT_DEV != Root_RAM0) { if (rd_load_image("/initrd.image") && ROOT_DEV != Root_RAM0) {
sys_unlink("/dev/initrd"); sys_unlink("/initrd.image");
handle_initrd(); handle_initrd();
return 1; return 1;
} }
} }
sys_unlink("/dev/initrd"); sys_unlink("/initrd.image");
return 0; return 0;
} }
...@@ -185,7 +185,7 @@ int __init rd_load_image(char *from) ...@@ -185,7 +185,7 @@ int __init rd_load_image(char *from)
else else
devblocks >>= 1; devblocks >>= 1;
if (strcmp(from, "/dev/initrd") == 0) if (strcmp(from, "/initrd.image") == 0)
devblocks = nblocks; devblocks = nblocks;
if (devblocks == 0) { if (devblocks == 0) {
......
...@@ -497,7 +497,7 @@ void __init populate_rootfs(void) ...@@ -497,7 +497,7 @@ void __init populate_rootfs(void)
return; return;
} }
printk("it isn't (%s); looks like an initrd\n", err); 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) { if (fd >= 0) {
sys_write(fd, (char *)initrd_start, sys_write(fd, (char *)initrd_start,
initrd_end - initrd_start); initrd_end - initrd_start);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment