diff -urN -X dontdiff linux/Documentation/kernel-parameters.txt rootcd/Documentation/kernel-parameters.txt --- linux/Documentation/kernel-parameters.txt Wed Jun 20 19:21:33 2001 +++ rootcd/Documentation/kernel-parameters.txt Thu Jul 12 15:46:43 2001 @@ -506,6 +506,9 @@ root= [KNL] root filesystem. + rootcd= [KNL] Mount root filesystem on the first CD-ROM if the + value is not 0. + rw [KNL] Mount root device read-write on boot. S [KNL] run init in single mode. diff -urN -X dontdiff linux/drivers/cdrom/cdrom.c rootcd/drivers/cdrom/cdrom.c --- linux/drivers/cdrom/cdrom.c Fri May 4 23:09:23 2001 +++ rootcd/drivers/cdrom/cdrom.c Thu Jul 12 15:45:27 2001 @@ -2492,6 +2492,11 @@ return proc_dostring(ctl, write, filp, buffer, lenp); } +kdev_t get_first_cdrom_dev(void) +{ + return topCdromPtr ? topCdromPtr->dev : 0; +} + /* Unfortunately, per device settings are not implemented through procfs/sysctl yet. When they are, this will naturally disappear. For now just update all drives. Later this will become the template on which diff -urN -X dontdiff linux/init/main.c rootcd/init/main.c --- linux/init/main.c Thu Jul 12 15:01:48 2001 +++ rootcd/init/main.c Thu Jul 12 15:45:48 2001 @@ -304,6 +304,17 @@ __setup("root=", root_dev_setup); +static int rootcd_enable __initdata = 0; + +static int __init rootcd_setup(char *str) +{ + get_option(&str, &rootcd_enable); + return 1; +} + +__setup("rootcd=", rootcd_setup); + + static int __init checksetup(char *line) { struct kernel_param *p; @@ -728,6 +739,7 @@ */ static void prepare_namespace(void) { + extern kdev_t get_first_cdrom_dev(void); /* drivers/cdrom/cdrom.c */ #ifdef CONFIG_BLK_DEV_INITRD int real_root_mountflags = root_mountflags; if (!initrd_start) @@ -747,6 +759,8 @@ #endif /* Mount the root filesystem.. */ + if (rootcd_enable) + ROOT_DEV = get_first_cdrom_dev(); mount_root(); mount_devfs_fs ();