Skip to contentSkip to conversation

fix new initrd with devfs

PATCH New Andrey Borzenkov 1 participant 1 message Oct 25, 2003 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix new initrd with devfs

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

init/initramfs.c renamed from tmp/linux-2.6.0-test8/init/initramfs.c +1 -1
@@ -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);
init/do_mounts_rd.c renamed from tmp/linux-2.6.0-test8/init/do_mounts_rd.c +1 -1
@@ -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) {
init/do_mounts_initrd.c renamed from tmp/linux-2.6.0-test8/init/do_mounts_initrd.c +3 -3
@@ -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;
 }