summaryrefslogtreecommitdiffstats
path: root/sys-kernel/boest-v4.4.198/0014-4.4-2900_dev-root-proc-mount-fix.patch.patch
blob: 1e616bd83f8b86c59d7237df76a1d1feaa2eaea5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From 44c36b5b34fe5afc0794c8d0cb179f2d94f66491 Mon Sep 17 00:00:00 2001
From: Mike Pagano <mpagano@gentoo.org>
Date: Sun, 10 Jan 2016 12:18:55 -0500
Subject: [PATCH 14/20] 4.4:2900_dev-root-proc-mount-fix.patch


---
 init/do_mounts.c | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/init/do_mounts.c b/init/do_mounts.c
index dea5de95c2dd..fb2528149b9f 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -490,7 +490,11 @@ void __init change_floppy(char *fmt, ...)
 	va_start(args, fmt);
 	vsprintf(buf, fmt, args);
 	va_end(args);
-	fd = sys_open("/dev/root", O_RDWR | O_NDELAY, 0);
+	if (saved_root_name[0])
+		fd = sys_open(saved_root_name, O_RDWR | O_NDELAY, 0);
+	else
+		fd = sys_open("/dev/root", O_RDWR | O_NDELAY, 0);
+
 	if (fd >= 0) {
 		sys_ioctl(fd, FDEJECT, 0);
 		sys_close(fd);
@@ -534,11 +538,17 @@ void __init mount_root(void)
 #endif
 #ifdef CONFIG_BLOCK
 	{
-		int err = create_dev("/dev/root", ROOT_DEV);
-
-		if (err < 0)
-			pr_emerg("Failed to create /dev/root: %d\n", err);
-		mount_block_root("/dev/root", root_mountflags);
+		if (saved_root_name[0] == '/') {
+	       	int err = create_dev(saved_root_name, ROOT_DEV);
+			if (err < 0)
+				pr_emerg("Failed to create %s: %d\n", saved_root_name, err);
+			mount_block_root(saved_root_name, root_mountflags);
+		} else {
+			int err = create_dev("/dev/root", ROOT_DEV);
+			if (err < 0)
+				pr_emerg("Failed to create /dev/root: %d\n", err);
+			mount_block_root("/dev/root", root_mountflags);
+		}
 	}
 #endif
 }