Commit 26d32e6e authored by Kai Germaschewski's avatar Kai Germaschewski

do_mounts: Fix boot from ramdisk

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