Browse code

recreate /dev/root in linux-esx kernel

Change-Id: Ie76fe5d3e6ecd9a011cc2cd4b59bd6bc11c511f6
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/4394
Reviewed-by: Alexey Makhalov <amakhalov@vmware.com>
Reviewed-by: Srivatsa S. Bhat <srivatsab@vmware.com>
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Bo Gan <ganb@vmware.com>

Bo Gan authored on 2017/10/31 07:52:13
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,42 @@
0
+From fe52a1d246edc822e796d9c7890551e6a4049a27 Mon Sep 17 00:00:00 2001
1
+From: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
2
+Date: Fri, 20 Nov 2015 14:01:26 -0600
3
+Subject: [PATCH 102/127] init: do_mounts: recreate /dev/root
4
+
5
+Rootfs shows as is mounted in /dev/root, but this devices is not present in
6
+/dev directory.
7
+
8
+Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
9
+---
10
+ init/do_mounts.c | 8 ++++++++
11
+ 1 file changed, 8 insertions(+)
12
+
13
+diff --git a/init/do_mounts.c b/init/do_mounts.c
14
+index c2de5104aad2..c6db994a7213 100644
15
+--- a/init/do_mounts.c
16
+@@ -549,6 +549,7 @@ void __init mount_root(void)
17
+ void __init prepare_namespace(void)
18
+ {
19
+ 	int is_floppy;
20
++	int err;
21
+ 
22
+ 	if (root_delay) {
23
+ 		printk(KERN_INFO "Waiting %d sec before mounting root device...\n",
24
+@@ -602,6 +603,13 @@ void __init prepare_namespace(void)
25
+ 	devtmpfs_mount("dev");
26
+ 	sys_mount(".", "/", NULL, MS_MOVE, NULL);
27
+ 	sys_chroot(".");
28
++#ifdef CONFIG_BLOCK
29
++	/* recreate the /dev/root */
30
++	err = create_dev("/dev/root", ROOT_DEV);
31
++
32
++	if (err < 0)
33
++		pr_emerg("Failed to create /dev/root: %d\n", err);
34
++#endif
35
+ }
36
+ 
37
+ static bool is_tmpfs;
38
+-- 
39
+2.14.1
40
+
... ...
@@ -2,7 +2,7 @@
2 2
 Summary:        Kernel
3 3
 Name:           linux-esx
4 4
 Version:        4.9.64
5
-Release:        1%{?dist}
5
+Release:        2%{?dist}
6 6
 License:        GPLv2
7 7
 URL:            http://www.kernel.org/
8 8
 Group:          System Environment/Kernel
... ...
@@ -41,6 +41,7 @@ Patch23:        ACPICA-Namespace-fix-operand-cache-leak.patch
41 41
 # Fix CVE-2017-1000252
42 42
 Patch24:        kvm-dont-accept-wrong-gsi-values.patch
43 43
 
44
+Patch25:       init-do_mounts-recreate-dev-root.patch
44 45
 
45 46
 BuildRequires: bc
46 47
 BuildRequires: kbd
... ...
@@ -102,6 +103,7 @@ The Linux package contains the Linux kernel doc files
102 102
 %patch22 -p1
103 103
 %patch23 -p1
104 104
 %patch24 -p1
105
+%patch25 -p1
105 106
 
106 107
 %build
107 108
 # patch vmw_balloon driver
... ...
@@ -198,6 +200,8 @@ ln -sf linux-%{uname_r}.cfg /boot/photon.cfg
198 198
 /usr/src/linux-headers-%{uname_r}
199 199
 
200 200
 %changelog
201
+*   Mon Nov 27 2017 Bo Gan <ganb@vmware.com> 4.9.64-2
202
+-   Recreate /dev/root in init
201 203
 *   Tue Nov 21 2017 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.9.64-1
202 204
 -   Version update
203 205
 *   Mon Nov 06 2017 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 4.9.60-1