diff -urN wt2-3c/init/do_mounts.c wt2/init/do_mounts.c --- wt2-3c/init/do_mounts.c Sun Mar 3 17:17:51 2002 +++ wt2/init/do_mounts.c Sun Mar 3 19:14:17 2002 @@ -284,6 +284,24 @@ fs_names = __getname(); get_fs_names(fs_names); +#if defined CONFIG_TMPFS && defined CONFIG_BLK_DEV_INITRD_DYN_TMPFS + if (ROOT_DEV == MKDEV(UNNAMED_MAJOR, 0xfe)) { + extern unsigned long initrd_dyn_fssize; + char fs_data[80] = {0}; + int err; + + if (initrd_dyn_fssize > 0) + snprintf(fs_data, sizeof(fs_data), "size=%luk", initrd_dyn_fssize); + + err = sys_mount("/dev/root", "/root", "tmpfs", root_mountflags, fs_data); + if (!err) + goto done; + + printk(KERN_ERR "VFS: Unable to mount root fs via initrd, trying floppy.\n"); + ROOT_DEV = MKDEV(FLOPPY_MAJOR, 0); + } +#endif + #ifdef CONFIG_ROOT_NFS if (MAJOR(ROOT_DEV) == UNNAMED_MAJOR) { void *data; @@ -509,6 +527,11 @@ /* Mount the root filesystem.. */ mount_root(); + +#ifdef CONFIG_BLK_DEV_INITRD_DYN + initrd_dyn_mkroot(); +#endif + sys_chdir("/root"); ROOT_DEV = current->fs->pwdmnt->mnt_sb->s_dev; printk("VFS: Mounted root (%s filesystem)%s.\n", @@ -517,8 +540,7 @@ #ifdef CONFIG_BLK_DEV_INITRD root_mountflags = real_root_mountflags; - if (mount_initrd && ROOT_DEV != real_root_dev - && MAJOR(ROOT_DEV) == RAMDISK_MAJOR && MINOR(ROOT_DEV) == 0) { + if (mount_initrd && MAJOR(ROOT_DEV) == RAMDISK_MAJOR && MINOR(ROOT_DEV) == 0) { int error; int i, pid; sys_mkdir("/old", 0700);