From 2393fb2f99df0fd3e1d1452787674f93c758aba5 Mon Sep 17 00:00:00 2001 From: Alexander Viro Date: Mon, 20 Oct 2003 07:34:10 -0700 Subject: [PATCH] [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 --- init/do_mounts_initrd.c | 6 +++--- init/do_mounts_rd.c | 2 +- init/initramfs.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c index 9a0ab579ae4fe..452b522cbcfa6 100644 --- a/init/do_mounts_initrd.c +++ b/init/do_mounts_initrd.c @@ -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; } diff --git a/init/do_mounts_rd.c b/init/do_mounts_rd.c index e500fb11033b6..c4074ad08906a 100644 --- a/init/do_mounts_rd.c +++ b/init/do_mounts_rd.c @@ -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) { diff --git a/init/initramfs.c b/init/initramfs.c index 42eda038009f7..38d00d06ebd35 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -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); -- 2.53.0