diff options
author | Ken'ichi Ohmichi <oomichi@mxs.nes.nec.co.jp> | 2007-09-07 18:10:02 +0900 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2007-10-19 12:26:38 +0900 |
commit | 61198670cc428626dc3a1d76eb7b2f0b11707eb6 (patch) | |
tree | 8e2ca7561af2cc5551f9e52edbea5461486ec00d | |
parent | 2e152ffba39a9234dfa984966deba273824e73c1 (diff) |
Pass vmcoreinfo's address and size #2
There is a compatibility problem that the kexec command fails on
kernels which don't have /sys/kernel/vmcoreinfo:
# ls /sys/kernel/
debug kexec_crash_loaded kexec_loaded security uevent_helper
uevent_seqnum
#
(There is not /sys/kernel/vmcoreinfo.)
#
# kexec -p --args-linux vmlinuz --initrd=initrd.img
Could not open "/sys/kernel/vmcoreinfo": No such file or directory
#
To fix the problem, could you please apply the attached patch ?
The fixed part is the same as the patch in the following mail.
Cc: "Ken'ichi Ohmichi" <oomichi@mxs.nes.nec.co.jp>
Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r-- | kexec/crashdump.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/kexec/crashdump.c b/kexec/crashdump.c index a35f7a7..42ec3ab 100644 --- a/kexec/crashdump.c +++ b/kexec/crashdump.c @@ -122,12 +122,8 @@ int get_kernel_vmcoreinfo(uint64_t *addr, uint64_t *len) *len = 0; sprintf(kdump_info, "/sys/kernel/vmcoreinfo"); - fp = fopen(kdump_info, "r"); - if (!fp) { - die("Could not open \"%s\": %s\n", kdump_info, - strerror(errno)); - return -1; - } + if (!(fp = fopen(kdump_info, "r"))) + return 0; if (!fgets(line, sizeof(line), fp)) die("Cannot parse %s: %s\n", kdump_info, strerror(errno)); |