aboutsummaryrefslogtreecommitdiffstats
path: root/patches/boot/mount_root-clarify-error-messages-for-when-no-rootfs.patch
blob: 286993eae52244c89eccad1badb900c52b15084e (plain)
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
50
51
52
53
54
55
From ca14e0ea8ac29797e9eedfda5456b818a83626e8 Mon Sep 17 00:00:00 2001
From: Paul Gortmaker <paul.gortmaker@windriver.com>
Date: Thu, 26 Nov 2009 07:32:09 -0800
Subject: [PATCH] mount_root: clarify error messages for when no rootfs found

To an end user who doesn't really know linux that well, a
message like:

  Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

may just look like cryptic computer speak indicating some
deep and complex problem, instead of the reality that they
have a simple local configuration problem.  Ideally it would
be nice to not use the misleading "panic" at all, but since
various panic notifiers are historically expecting to be
called when there is no valid rootfs, we can't change that.

So instead, this tries to make it 100% clear to folks of
any background that it is an end user configuration issue.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
 init/do_mounts.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/init/do_mounts.c b/init/do_mounts.c
index 5fdef94f0864..73d5b89d0c24 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -231,7 +231,9 @@ void __init mount_root_generic(char *name, char *pretty_name, int flags)
 			pr_err("\n");
 		}
 
-		panic("VFS: Unable to mount root fs on %s", b);
+		printk(KERN_EMERG "VFS: Unable to mount root fs on %s\n", b);
+		printk(KERN_EMERG "User configuration error - no valid root filesystem found\n");
+		panic("Invalid configuration from end user prevents continuing");
 	}
 	if (!(flags & SB_RDONLY)) {
 		flags |= SB_RDONLY;
@@ -244,7 +246,9 @@ void __init mount_root_generic(char *name, char *pretty_name, int flags)
 	for (i = 0, p = fs_names; i < num_fs; i++, p += strlen(p)+1)
 		printk(" %s", p);
 	printk("\n");
-	panic("VFS: Unable to mount root fs on \"%s\" or %s", pretty_name, b);
+	printk(KERN_EMERG "VFS: Unable to mount root fs on \"%s\" or %s\n", pretty_name, b);
+	printk(KERN_EMERG "User configuration error - no valid root filesystem found\n");
+	panic("Invalid configuration from end user prevents continuing");
 out:
 	put_page(page);
 }
-- 
2.34.1