]> git.hungrycats.org Git - linux/commitdiff
do_mounts: Fix boot from ramdisk
authorKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>
Thu, 6 Mar 2003 12:27:31 +0000 (06:27 -0600)
committerKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>
Thu, 6 Mar 2003 12:27:31 +0000 (06:27 -0600)
Russell King investigated a failure case I introduced: When booting
with "load_ramdisk=1", we use the kernel root= parameter to determine
from what device to get the contents to copy into a ramdisk and then
mount that ramdisk as root.

For the copy to work, /dev/root needs to point to the device to load the
ramdisk from.

init/do_mounts.c
init/do_mounts.h
init/do_mounts_rd.c

index b27e822f4499a2928b2a826841fd203cb67a2ea3..0db87ed3810b12a8ed8e68fe29f87764aaefb7d8 100644 (file)
@@ -17,7 +17,7 @@ extern int get_filesystem_list(char * buf);
 int __initdata rd_doload;      /* 1 = load RAM disk, 0 = don't load */
 
 int root_mountflags = MS_RDONLY | MS_VERBOSE;
-static char * __initdata root_device_name;
+char * __initdata root_device_name;
 static char __initdata saved_root_name[64];
 
 /* this is initialized in init/main.c */
index 29358b0902c6b239a10bd5347a3c17b3a4b20cb3..297ab11723d34f103a984283794701308bbdccbd 100644 (file)
@@ -27,6 +27,7 @@ void  change_floppy(char *fmt, ...);
 void  mount_block_root(char *name, int flags);
 void  mount_root(void);
 extern int root_mountflags;
+extern char *root_device_name;
 
 #ifdef CONFIG_DEVFS_FS
 
index e0c58303f270a07c196a2124ddbd22d309d23c5f..be82c3fb89f14689548d73238bceafca372ed433 100644 (file)
@@ -242,6 +242,7 @@ int __init rd_load_disk(int n)
 {
        if (rd_prompt)
                change_floppy("root floppy disk to be loaded into RAM disk");
+       create_dev("/dev/root", ROOT_DEV, root_device_name);
        create_dev("/dev/ram", MKDEV(RAMDISK_MAJOR, n), NULL);
        return rd_load_image("/dev/root");
 }