patch-2.1.86 linux/init/main.c

Next file: linux/kernel/acct.c
Previous file: linux/include/net/ip.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.85/linux/init/main.c linux/init/main.c
@@ -426,7 +426,7 @@
 	{ NULL, 0 }
 };
 
-__initfunc(dev_t name_to_dev_t(char *line))
+__initfunc(kdev_t name_to_kdev_t(char *line))
 {
 	int base = 0;
 	if (strncmp(line,"/dev/",5) == 0) {
@@ -447,7 +447,7 @@
 
 __initfunc(static void root_dev_setup(char *line, int *num))
 {
-	ROOT_DEV = name_to_dev_t(line);
+	ROOT_DEV = name_to_kdev_t(line);
 }
 
 /*
@@ -1002,10 +1002,10 @@
 	memory_start = paging_init(memory_start,memory_end);
 	trap_init();
 	init_IRQ();
-	memory_start = console_init(memory_start,memory_end);
 	sched_init();
 	time_init();
 	parse_options(command_line);
+	memory_start = console_init(memory_start,memory_end);
 #ifdef CONFIG_MODULES
 	init_modules();
 #endif
@@ -1165,14 +1165,16 @@
 
 #ifdef CONFIG_BLK_DEV_INITRD
 	root_mountflags = real_root_mountflags;
-	if (mount_initrd && ROOT_DEV != real_root_dev && ROOT_DEV == MKDEV(RAMDISK_MAJOR,0)) {
+	if (mount_initrd && ROOT_DEV != real_root_dev
+	    && MAJOR(ROOT_DEV) == RAMDISK_MAJOR && MINOR(ROOT_DEV) == 0) {
 		int error;
 		int i, pid;
 
 		pid = kernel_thread(do_linuxrc, "/linuxrc", SIGCHLD);
 		if (pid>0)
 			while (pid != wait(&i));
-		if (real_root_dev != MKDEV(RAMDISK_MAJOR, 0)) {
+		if (MAJOR(real_root_dev) != RAMDISK_MAJOR
+		     || MINOR(real_root_dev) != 0) {
 			error = change_root(real_root_dev,"/initrd");
 			if (error)
 				printk(KERN_ERR "Change root to /initrd: "

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov