diff options
author | Khalid Aziz <khalid@hp.com> | 2012-03-28 13:09:02 -0600 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2012-03-29 08:30:57 +0900 |
commit | a77ae20f1749878aa76d427868ca096c614d10a8 (patch) | |
tree | 53e0034aa4fe704f9e07fc6222902c6519cfc148 /kexec/kexec.c | |
parent | 0a71026346f9c20fcdb0341a097b3f1962e82d37 (diff) |
Add a descriptive error message for kexec load failure
kexec-tools package for debian includes a patch that adds a more
descriptive error message when someone tries to laod a crash kernel
and didn't remember to boot up with crashkernel= parameter. This
patch would be of general interest. This patch was originally written
by Alastair McKinstry.
Please apply.
Signed-off-by: Khalid Aziz <khalid.aziz@hp.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec/kexec.c')
-rw-r--r-- | kexec/kexec.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/kexec/kexec.c b/kexec/kexec.c index 19133fa..d2d05a8 100644 --- a/kexec/kexec.c +++ b/kexec/kexec.c @@ -718,10 +718,20 @@ static int my_load(const char *type, int fileind, int argc, char **argv, } info.kexec_flags |= native_arch; - if (file_type[i].load(argc, argv, kernel_buf, - kernel_size, &info) < 0) { - fprintf(stderr, "Cannot load %s\n", kernel); - return -1; + result = file_type[i].load(argc, argv, kernel_buf, kernel_size, &info); + if (result < 0) { + switch (result) { + case ENOCRASHKERNEL: + fprintf(stderr, + "No crash kernel segment found in /proc/iomem\n" + "Please check the crashkernel= boot parameter.\n"); + break; + case EFAILED: + default: + fprintf(stderr, "Cannot load %s\n", kernel); + break; + } + return result; } /* If we are not in native mode setup an appropriate trampoline */ if (arch_compat_trampoline(&info) < 0) { |