Commit Graph

610 Commits

Author SHA1 Message Date
Baoquan He
04a558ec6d Release 2.0.3-72 2013-04-02 13:35:18 +08:00
Baoquan He
f21c4c9519 Pull kexec-tools-2.0.4 2013-04-02 11:35:30 +08:00
Baoquan
4b850d2f3a Check if block device as dump target is resettable
Some Smart Array (hpsa/cciss) adapters don't support reset, we need
to disable kdump on those devices, like rhel6 did.

In this patch, the dump target  is checked according to below
criteria if it's a block device.
If it's cciss disk but is resettbale, can be used as dump target.
If it's cciss disk but is not resettable, can not be used as dump
target.
If it's cciss disk and not resettable, but user set OVERRIDE_RESETTABLE
to 1 in /etc/sysconfig/kdump, can be taken as dump target. Because
user know the situation and want to have a try.

In this patch, added codes include 4 parts:
1)Add an option "override_resettable <0 | 1>" into kdump.conf, and
add related section into kdump.conf man page. In mkdumprd, will check
whether user has set a value, get that value if yes. By default, the
value is 0.

2)port utility functions from dracut-functions.sh.

3)The check_resettable function checks if dump target is a resettable
block device. This includes the case where default action dump_to_rootfs
is set.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-04-02 10:38:35 +08:00
Baoquan He
bbe46f9e22 mkdumprd: add function perror_exit
We use function to pass stdout to a variable, like get_persistent_dev
but it will echo some error message and exit in some cases, instead of
redirect all the echo to stderr, this patch adds a function perror_exit
to fix this and simplify/cleanup related code.

Also add another function perror() for cases where no need to exit.

Signed-off-by: Dave Young <dyoung@redhat.com>
Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-04-02 10:34:05 +08:00
Dave Young
dc8e283ff5 Deprecate blacklist option
Current blacklist option is different from the option in rhel6. In current
implementation blacklist just means omit the driver, but it should really
be preventing it being loaded in initramfs.

To keep consistent, just make the option as deprecated. User is suggested
to user dracut kernel cmdline rd.driver.blacklist instead.

[v1->v2]: improve man page description, thanks Vivek.

Tested in kvm guest with rd.driver.blacklist in kdump sysconfig

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-04-02 10:26:39 +08:00
Baoquan He
4f1111a667 Release 2.0.3-71 2013-03-27 10:44:43 +08:00
Baoquan He
5cfe0605eb Remove eppic support on ppc and s390 arch
Because makedumpfile is not supported on ppc and s390, so it makes
no sense to create the eppic_makedumpfile sub-package if there is
no makedumpfile binary to run it with.

Remove eppic contents related to ppc and s390 in kexec-tools.spec. This
will not build and install eppic on ppc and s390.
2013-03-27 10:37:46 +08:00
Baoquan He
1405ada767 Release 2.0.3-70 2013-03-18 11:12:59 +08:00
Baoquan He
9242fbb40a Change rules related to eppic in kexec-tools.spec
There's one mistake in rules related to eppic in kexec-tools.spec,
that caused kexec-tools-eppic to fail installation of i386. In this
patch remove that line of rule.

Meanwhile update eppic_030413.tar.gz.
2013-03-18 10:56:45 +08:00
Baoquan He
291d5678fb Release 2.0.3-69 2013-03-14 14:48:11 +08:00
Baoquan He
b255c4a026 Support for eppic language as a subpackage
This feature enables us to specify rules to scrub data in a
dumpfile with eppic macro instead of the current configuration
file (makedumpfile.conf). Currently, this feature works only
for symbols in vmlinux while the current feature can work also
for module symbols.

This library is backported from upstream, integrated and tested by
Dave Anderson.
2013-03-14 14:42:55 +08:00
Baoquan He
bead5d742f Release 2.0.3-68 2013-03-14 13:46:42 +08:00
Baoquan He
8281e9a37a Remove "-F" in CORE_COLLECTOR when dump_to_rootfs
If CORE_COLLECTOR is makedumpfile, "-F" is only allowed on ssh/raw,
removing it when dump_to_rootfs is necessary.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-03-14 11:20:57 +08:00
Baoquan He
603224b256 Change dump_to_rootfs to be a default option and reboot to be default action
Firstly rename dump_rootfs to dump_to_rootfs to remove the ambiguity
about dump_rootfs. Then add it as one of default options. That means
user can specify dump_to_rootfs to be default action manually, then
it will take action when specified target dump failed.

Secondly, in rhel7 and fedora, when default action is not specified,
the default 'default' is dump_to_rootfs. Namely when specified target
dump failed, the kdump initrd will mount root and save kdump from
initramfs context. However in rhel6, the default 'default' is 'reboot'.
That means when specified target dump failed, the kdump initrd will
reboot systems. For being consistent with rhel6, change the default
'default' back to 'reboot'. And this can also keep logic simple, easier
to understand. Primarily, Our default dump target is root filesystem.
So keeping "default" as "dump_to_rootfs" and trying to dump to root
filesystem again when first attempt fails does not make much sense.

Meanwhile add the relevant description into kdump.conf,kdump.conf.5
and kexec-kdump-howto.txt.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-03-14 11:13:18 +08:00
dyoung@redhat.com
ff7d629a56 dracut-module-setup.sh: remove UUID/LABEL quotes before using it
blkid do not support UUID/LABEL with quotes, remove the quotes before converting
to dev name, or the result devname will be nul.

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
2013-03-14 10:42:15 +08:00
Dave Young
81735539b8 add function to check kdump config file
Add a function check_config to check kdump config file.
1. move multi dump target checking into this function
2. check invalid config options and obsolete config options
3. check null config value.

[v2->v3]: add detail doc about deprecated options in kdump.conf manpage.
[v3->v4]: print out the bad config option in case it is not valid.
[v4->v5]: improve documentation according to comments from Vivek.
[v5->v6]: s/Deprecated/Invalid for invalid config options.

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Marc Milgram <mmilgram@redhat.com>
2013-03-14 10:40:13 +08:00
dyoung@redhat.com
69777ccff7 kdumpctl: rename function name check_config
check_config is actually checking the files timestamp and rebuilding initrd.
Rename it to check_rebuild instead thus check_config can be used for checking
config file valid or not.

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-03-14 10:38:09 +08:00
dyoung@redhat.com
218456d453 check dump target mounting earlier
Moving the checking target mount code a little earlier to ensure
dump target is mounted and fail out early before other handlings.

This change also cleanup a bit for the related code.

Tested UUID/devname local dump, also tested the non-exist kdump target.

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-03-14 10:35:44 +08:00
dyoung@redhat.com
4b9c868b8d use findmnt instead of blkid in mkdumprd
Previously to_dev_name use blkid to get dev name from dump target,
but blkid can not handle UUID/LABEL with quotes so to_dev_name will
silently fail.

Because we enforce dump target being mounted before creating kdump
initrd, so change to use findmnt is fine. findmnt can handle input
params with quotes.

to_dev_name is not necessary anymore, just remove it.
Also there's another user of it is for checking if the dev is root
or not, here change to use findmnt for this as well.

Tested the rootfs dump, UUID with/without quotes dump.

Signed-off-by: Dave Young <dyoung@redhat.com>
Reviewed-by: Caspar Zhang <czhang@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
2013-03-14 10:35:22 +08:00
Baoquan He
b4b0a27d8a Return to start() function when check_ssh_target failed
In old code, kdumpctl program exit directly when check_ssh_target failed
without printing "Starting kdump: FAILED". Then when manually invoke
"kdumpctl restart", only print "Stopping kdump: OK", but no "Starting
kdump: FAILED". That is unreasonable.

In this patch change check_ssh_target() to return when it failed. Then
check the returned value in start() function and print status if the
returned value is not 0.

Meanwhile change "space" to "tab" in function check_ssh_target(), make
those be consistent with the whole script file.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2013-02-27 11:21:04 +08:00
Baoquan He
c8ce08763f kdumpctl:print out the service status
In kdumpctl, some printings are incomplete, like "Starting kdump:" or
"Stopping kdump:". Now add the service status to the end of such kind
of printing.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2013-02-27 11:20:18 +08:00
Baoquan He
dd02c559ae Remove useless codes related to LOGGER in kdumpctl
In fedora, systemd take control of services. During bootup and manually
invoke "systemctl restart kdump.service", the standard Output/Error
are all redirected to journal/syslog. Then particular LOGGER is useless
in kdumpctl.

In this patch, remove codes related to LOGGER. But for noticing user,
trying to add substituted printing to Standard Output/Err.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2013-02-27 11:19:52 +08:00
dyoung@redhat.com
e074e3952b tune sysconfig to save memory usage
tune sysconfig to save 2nd kernel memory usage

The memory in 2nd kernel is limited, we need to use as less memory as we can
to ensure vmcore capturing ok.

I'm doing below improvements in this patch:

1)
numa support is not necessary for kdump kernel, so disable it by adding numa=off
to save some kernel mm memory usage.

2)
Also add udev.children-max=2 to cmdline to limit max udev chidren processes.

3)
For ppc64, ehea driver will by default enable multi queue feature which will
use a lot of memory. Almost each ppc machine will oom for network(ssh/nfs)
kdump. The module param use_mcs=0 is used to disable multi queue feature.

Tested these params on an IBM machine with 2 numa nodes which ooms even for
local dump to rootfs.

With this patch oom does not happen for local/ssh dump, but for nfs dump oom
still happens in the middle of makedumpfile vmcore copying. So there should be
other improvement yet.

For ehea driver there's other params we can use, but because it's hard to
measure the saved memory, I'm waiting for input from IBM people. We can add
them later.

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-02-27 10:16:14 +08:00
Baoquan He
71d27e8b17 Release 2.0.3.67 2013-02-19 17:33:11 +08:00
Baoquan He
c5052f6512 pull makedumpfile 1.5.3 2013-02-19 17:33:03 +08:00
Baoquan He
2cc052a071 Revert: Merge an upstream patch for fix a ppc64 makedumpfile bug with with CONFIG_SPARSEMEM_EXTREME
This reverts commit 05b67ee95c.

The old commit was merged for a emergent bug fixing on release 1.5.1
of makedumpfile. Now the upstream has been updated to v1.5.3, and this
patch has been included already.

For updating to makedumpfile v1.5.3, revert it.
2013-02-19 15:02:52 +08:00
Baoquan He
01bb9af7ed Rectify the get_host_ip implementation
In previous implementation of get_host_ip, global variable HOST_IP
is used to be a intermediate variable. In this case, if finally
failed to get HOST_IP, the original default value is also overwritten.
It's buggy.

Eg. in ssh case, when faied to get host ip, the default local host ip
"127.0.0.1" is lost too. that's not expected.

Change it by adding a local variable as intermediate variable.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2013-02-19 14:27:39 +08:00
Baoquan He
c64f56348c Modify codes related to dump dir to make it clearer
In previous patch, get_host_ip was introduced to make the dump dir
more readable and back compatible with rhel6. But the implementation
is not good, making variable DATEDIR ambiguous. In this patch, modify
those codes to make it clearer.

About code checking returned value of get_host_ip, if not zero the
function do_default_action is called. That looks buggy, it will
continue going through the later code flow. Add FINAL_ACTION after
invoking do_default_action.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2013-02-19 14:22:04 +08:00
Baoquan He
8777b97020 Revert: Revert: Merge an upstream patch for fix a ppc64 makedumpfile bug with with CONFIG_SPARSEMEM_EXTREME
This reverts commit 11261a5bca.

Because failed to compile makedumpfile v1.5.2 on ppc64. Reverting
this revert is necessary.
2013-02-16 18:14:57 +08:00
Baoquan He
a431cab7ee Revert: Release 2.0.3-67
Because failed to compile makedumpfile v1.5.2 on ppc64, revert this
release.
2013-02-16 18:06:40 +08:00
Baoquan He
80ba39086a Release 2.0.3-67
makedumpfile v1.5.2
2013-02-16 17:37:53 +08:00
Baoquan He
11261a5bca Revert: Merge an upstream patch for fix a ppc64 makedumpfile bug with with CONFIG_SPARSEMEM_EXTREME
This reverts commit 05b67ee95c.

The old commit was merged for a emergent bug fixing on release 1.5.1
of makedumpfile. Now the upstream has been updated to v1.5.2, and this
patch has been included already.

For updating to makedumpfile v1.5.2, revert it.
2013-02-16 17:20:54 +08:00
Baoquan He
42b0a0bb46 Remove comma which is redundant
In man page, the removed comma is unnecessary, remove it in this page.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2013-02-16 15:19:41 +08:00
Dave Young
1a882465f8 Release 2.0.3-66 2013-02-05 10:36:50 +08:00
Dave Young
05b67ee95c Merge an upstream patch for fix a ppc64 makedumpfile bug with with CONFIG_SPARSEMEM_EXTREME 2013-02-01 14:39:56 +08:00
WANG Chao
0f07159657 kexec-tools.spec: remove kdump image when a corresponding kernel is removed.
Current kdump image name prefix has changed from initrd to initramfs.
Tested on a vm running Fedora 18.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
2013-01-28 14:27:54 +08:00
Dave Young
e9e10df925 Release 2.0.3-65 2013-01-28 14:15:00 +08:00
Cong Wang
97e107b5ab Add support for team devices
V4: Sync with the latest teamd

V3: Drop patch 2/2 which harms readability
    Move inst_dir to kdump_setup_team()
    Avoid saying why teamdctl fails
    Error out for vlan over team, like bridge
    Remove the useless exit in kdump_get_perm_addr()

V2: remove the tmp config file in /tmp
    split the non-team part

BZ: https://bugzilla.redhat.com/show_bug.cgi?id=874025
(This BZ is against RHEL7 though...)

Depends on dracut patch:
http://article.gmane.org/gmane.linux.kernel.initramfs/3043

and depends on latest version of teamd.

This patch adds support for team devices on kdump side.
I tested team active-backup mode and round-robin mode,
vmcore can be dumped over ssh successfully.

Note, currently we don't support stacked devices
on/under team, it is tricky and can be added on request.

Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2013-01-28 14:04:27 +08:00
Dave Young
2c5d631e7d Update translation file po/it.po 2013-01-28 14:02:09 +08:00
Dave Young
5325594fca remove wait for net ok function
After recent dracut network changes, waiting for nic ready stuff is handled
in cmdline hooks when generate udev rules. So wait_for_net_ok is not
necessary any more in kdump.sh, Removing the code here.

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-01-28 14:01:05 +08:00
Dave Young
ae1db90332 add bootdev cmdline param
With recent dracut a bootdev is needed in cmdline, so dracut can waiting for
this nic ready early in initqueue. So in this patch bootdev=${_netnic} is added

[v1->v2]: use standard cmdline file name 70bootdev.conf

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
2013-01-28 14:00:58 +08:00
Dave Young
4874a9539a kdumpnic cmdline file name cleanup
use standard cmdline file name start with digit number: 60kdumpnic.conf

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
2013-01-28 14:00:54 +08:00
Dave Young
009b983103 Release 2.0.3-64 2013-01-04 14:14:16 +08:00
Dave Young
b865438443 Pull patch kexec-tools-2.0.3-ppc-exec-stack-fix.patch
fix issue of exec on stack for ppc32
2012-12-21 15:19:55 +08:00
Dave Young
440fc959ee Release 2.0.3-63 2012-12-21 11:37:01 +08:00
Dave Young
8770ac2d6f revert explictly handling of PIPESTATUS
To simplify the code logic, remove the previous PIPESTATUS handling because
previous patch "enable pipefail bash option" added pipefail option which will
also resolve this issue.

This is a reverting of below commit:
commit 3111ff74c9
Author: Chao Wang <chaowang@redhat.com>
Date:   Mon Aug 6 14:49:52 2012 +0800

    Change return value to indicate the result of dump_raw() correctly.

    Resolves bz845916.
    For raw dump code below:
    $CORE_COLLECTOR /proc/vmcore | dd of=$1 bs=$DD_BLKSIZE >> /tmp/dd_progress_f
    in case pipe fails it will still return 0, Fix this by return the PIPESTATUS

    Signed-off-by: Chao Wang <chaowang@redhat.com>
    Acked-by: Dave Young <dyoung@redhat.com>

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
2012-12-21 11:33:30 +08:00
Dave Young
e36d4ab60d enable pipefail bash option
Follwing code will not return 1 if CORE_COLLECTOR /proc/vmcore fail:
$CORE_COLLECTOR /proc/vmcore | ssh $_opt $2 "dd bs=512 of=$_dir/vmcore-incomplete" || return 1

Fix it by enabling pipefail option

Tested in F18 with ssh dump.

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
2012-12-21 11:33:07 +08:00
WANG Chao
8fddece4e9 wrong ssh key fix
To get sshkey from kdump.conf we should filter out comment.
Fix it by change awk pattern to use ^sshkey

Acked-by: Baoquan He <bhe@redhat.com>
2012-12-21 11:32:31 +08:00
Dave Young
c53d3d2a10 Update sources 2012-12-21 11:17:17 +08:00
Dave Young
9e81dab151 Update 3 po files:
po/gu.po
po/or.po
po/zh_CN.po

These translations missed one '\n' so build fails with:
msgfmt --statistics --verbose -o gu.mo gu.po
gu.po:73: `msgid' and `msgstr' entries do not both begin with '\n'

Fix them by adding one more "\n"
2012-12-21 11:14:47 +08:00