Commit Graph

201 Commits

Author SHA1 Message Date
Baoquan He 7fa73ec70f kdump fails loading if target is root fs by default while disk is mounted on save path
kdump now dumps vmcore to root partition by default in SAVE_PATCH
directory, e.g /var/crash defaultly. This is problematic when another
disk is mounted on /var or /var/crash, because the saved vmcore will
he hidden after dump in 1st kernel. This also has the potential of
blindly filling the root file system without a clue as to why.

Now fix this by failing the loading of kdump kernel if dump target
is root fs by default while different disk is mounted on save path.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2014-03-10 13:18:03 +08:00
Baoquan He 2afbb51946 mkdumprd: reorganize the code to make flow of script clear
Move the invocation of check_resettable() to be together with all
other invocation of functions. This can make the flow of script
clearer and more readable.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2014-03-10 13:17:39 +08:00
Baoquan He 8c527aba43 kdump-lib.sh: introduce two functions abstracted from get_block_dump_target for reuse
In function get_block_dump_target(), code block to get user configured
dump disk and get root fs device can be reused by other places. Now
abstract and wrap them into 2 new functions:

get_user_configured_dump_disk()
get_root_fs_device()

And put them into kdump-lib.sh.

Meanwhile change the get_block_dump_target() accordingly.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2014-03-10 13:17:21 +08:00
arthur 906dc0bca0 Relax restriction of dumping on encrypted target
Description:
Currently kdumpctl will fail to create kdump initramfs and start
kdump service while dump target is encrypted. This restriction is
too strict.

Resolution:
Just warn user that encrypted device is in dump path and second
kernel will wait on console for password to be entered.

Signed-off-by: arthur <zzou@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2014-02-28 14:55:16 +08:00
WANG Chao cdde81ddbd ssh: use ssh -n to redirect stdin from /dev/null
When we're parsing kdump.conf, we read it from stdin in a while
loop statement. If we don't use ssh -n within the loop, all rest of the
kdump.conf options, which are in stdin, will be eaten by ssh.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2014-01-17 11:32:47 +08:00
WANG Chao 7c48f71b6f kdump.sysconfig: default to "nofail" mount
Currently we have two issues against mounting filesystems by systemd.
1. If any failure in sysroot.mount, initrd.target won't be reached.
2. If any failure in mounting /etc/fstab, initrd.target won't be reached

Our kdump.sh is in dracut-pre-pivot hook which is ordered after
initrd.target. That means if systemd doesn't reach initrd.target,
pre-pivot service will not run.

Based on above, we can conclude that in order to run kdump.sh,
initrd.target must be reached.

To fix issue 1), we can add rootflags=nofail to 2nd kernel cmdline, so
that initrd.target will not require sysroot.mount. initrd.target
wouldn't care about the failures in sysroot.mount. That means
initrd.target can always be reached whether or not sysroot.mount fails.
So when initrd.target is reached, kdump.sh can be run.

To fix issue 2), we can append "nofail" mount options to every entry in
/etc/fstab. It has almost the same affects as to sysroot.mount.
initrd.target can be reached whether or not mount /etc/fstab fails. So
when initrd.target is reached, kdump.sh can be run.

If the mount failures block kdump from working properly (for example,
the dump target isn't mounted), the error handling will be done by
"default" action specified in /etc/kdump.conf. Otherwise kdump will
ignore the mount failures and dump as expected.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2013-09-27 15:45:24 +08:00
Baoquan He 59e28ddf75 Strip inline comments from the kdump config file before use
From: Wade Mealing <wmealing@redhat.com>

The RHEL 5 release of mkdumprd allowed for comments in the kdump config
file as shown below:

net 192.168.1.1 # this is the comment part

This patch strips them out during processing, but leaves the configuration
file in original condition.

Signed-off-by: Wade Mealing <wmealing@redhat.com>
Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-09-27 10:09:25 +08:00
WANG Chao a8921f04ae Introduce kdump-lib.sh for kdump shared functions
Currently in the whole kdump framework, we have some common functions
used across not only mkdumprd context and dracut context, but also 1st
kernel and 2nd kernel. We defined these functions at each script, which
is obviously not decent.

So let's introduce kdump-lib.sh for the shared functions and put it
to /lib/kdump/kdump-lib.sh.

It starts small, as you can see, only 3 functions are extracted. But in
the future more and more common functions can be added.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-09-27 10:07:13 +08:00
WANG Chao 791706939e mkdumprd: check return value of subshell
Currently some functions are used in subshell to assign string to a
variable. For example:
 _mnt=$(to_mount "$1")

In this case if we call perror_exit in the subshell, subshell will exit
1, but the parent process (mkdumprd) won't exit.

So we should handle the exit code of a subshell if the subshell calls
perror_exit over a failure.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-07-12 10:02:30 +08:00
WANG Chao 43da5c516d mkdumprd: get_persistent_dev() return original dev if no persistent dev exists.
kvm virtio-blk device, for example /dev/vdb, doesn't have serial id by
default. So there's no persistent device node under /dev/disk/ for
/dev/vdb.
In case no persistent dev for dump target, we should use the original
device name directly, not failing the mkdumprd.

v2: update warn message from Vivek.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-07-12 10:00:37 +08:00
Baoquan He 83ef43e522 mkdumprd: return error if no write permission on save path of server for ssh
When ssh dump, if user doesn't have write permission on save path
of server, the crash kernel can be loaded successfully, but finally
kdump will fail because write is not allowed.

Let's check it in the service start phase, if no write permission
print error message and exit.

For differentiation, change the name of old function mkdir_save_path
to mkdir_save_path_fs.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-06-18 10:36:16 +08:00
WANG Chao 928c5f1294 mkdumprd: remove -M option for dracut
We shouldn't output what dracut module are used when rebuilding kdump
initrd. It's confusing to user.

And since we've introduced dracut_args in kdump.conf, we can safely
remove this mandatory -M and let user add as his/her need.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-06-13 11:28:25 +08:00
dyoung@redhat.com fe96b47828 add dracut_args option to kdump.conf
mkdumprd call dracut to rebuilding kdump initrd, sometimes passing extra
dracut args is helpful. For example user can enable debug output with
--debug, --printsize to print roughly increased initramfs size by each module,
--omit-drivers to omit kernel modules, etc.

This patch enables dracut_args option for passing extra args to dracut.
Also it modifies add_dracut_arg() to treat a string with-in quote as single
string because for dracut options which has its own args, the args need to be
quoted and space seperated.

If add_dracut_arg() gets an string read from kdump.conf and if that string
contains double quotes, then while converting to positional parameters
those double quotes are not interpreted. Hence if /etc/kdump.conf contains
following.

dracut_args --add-drivers "driver1 driver2"

then add_dracut_args() sees following positional parameters

$1= --add-drivers
$2= "driver1
$3= driver2"

Notice, double quotes have been ignored and parameters have been broken
based on white space.

Modify add_dracut_arg() to look for parameters starting with " and
if one is found, it tries to merge all the next parameters till one
is found with ending double quote. Hence effectively simulating
following behavior.

$1= --add-drivers
$2= "driver1 driver2"

[v1->v2]: address quoted substring in dracut_args, also handle the leading
and ending spaces in substring.
[v2->v3]: fix dracut arguments seperator in kdump.conf.
[v3->v4]: improve changelog, thanks vivek.
[v4->v5]: make the manpage more verbose [vivek].

Tested with below dracut_args test cases:
1. dracut_args --add-drivers "pcspkr virtio_net" --omit-drivers "sdhci-pci hid-logitech-dj e1000"
2. dracut_args --add-drivers "   pcspkr virtio_net   " --omit-drivers "sdhci-pci hid-logitech-dj e1000"

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-04-27 10:44:48 +08:00
dyoung@redhat.com 1effb09942 error out if dump target is encrypted
We do not support dump to an encrypted disk now, so adding the functions to
error out if any of the dump target is encrypted.

This patch is based on the check resettable patches from BaoQuan which added
some dracut functions for iterating block devices.

Currently dracut support an encrypted rootfs, but it need interacive entering
passcode. It might be possible to use some keyfile to pass the key checking.
But let's fisrtly check and error out. In the future if there's such
requirement we can look into it that time.

Tested in F18 with encrypted root, encrypted disk other than root and
dump_to_rootfs with encrypted root.

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2013-04-11 16:55:18 +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
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 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
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 f21cbb5165 handle readonly mounted filesystem
We need fs dump target being mounted firstly before creating mkdumprd
This is because we want to get the mount options from kernel mountinfo
instead of simply mount it without considering mount options.

To avoid the filesystem being used by something other than kdump we
suggest them to mount it as 'ro', mkdumprd will remount it as 'rw' when
necessary and remount it back to 'ro'

In 2nd kernel kdump will still use 'rw' to mount it though.

Tested local read-only mounted fs dump.

[v1->v2]: improve documentation
          add error handling for `mount -o remount,ro`

Fixed the changelog per Vivek's comment
The code was reviewed by Vivek.

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-12-12 17:13:54 +08:00
dyoung@redhat.com 4d9bb7face get_ssh_size: use -n to redirect stdin from /dev/null
Resolves: bug 868990

ssh will send local stdin input to remote side, this cause trouble
when we call ssh in the loop of parsing kdump.conf.

Ie. if we specify both 'ssh' and 'core_collector' option in kdump.conf,
and put 'core_collector' behind 'ssh', there will be no chance to
handle 'core_collector' because in get_ssh_size() ssh eat all the later
input of the while loop.

Fix this by use /dev/null as stdin in get_ssh_size().

Tested in fedora kvm guest.

Signed-off-by: Dave Young <dyoung@redhat.com>
Suggested-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-11-16 14:13:27 +08:00
Dave Young fca70aadfd improve persistent name handling
For devices with filesystem, udev /dev/disk/by-uuid/* links are usually
reliable. But one exception is multipath devices, child and top layer
device may have same uuid.

As dm devices maintain /dev/mapper/* as persistent names, so converting to
/dev/mapper/* firstly then try by-uuid/* and by-id/*

Also because user know better what's the persistent name we just document well
to suggest user use persistent name in kdump.conf. it's suggested to
to use lvm or multipath canonical names or uuid/label.

Updated kdump.conf examples and related chunks in kexec-kdump-howto.txt
use lvm /dev/vg/<devname> in examples

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-10-11 09:43:30 +08:00
Dave Young 4ff4287ce7 pass persistent name to dracut --device
For raw device dump, also pass persistent name to dracut --device to fix
the device renaming problem.

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-09-20 11:03:24 +08:00
Dave Young 9d161703a6 pass persistent name to dracut --mount
currently --mount param are retrieved from /proc/mounts, but the device
name could be renamed in initramfs. So here convert them to persistent
names before passing to dracut

lvm canonical dev name is /dev/mapper/lvname-link which will be showed
in /proc/mounts
here fix get_mp function by using findmnt utils to find the mount point.

This patch depends on below dracut patch:
http://permalink.gmane.org/gmane.linux.kernel.initramfs/2903

[chaowang]:
in case device is not mounted we should not echo the mount line in to_mount()
use findmnt -n to strip the header line
for nfs don't pass persistent name to dracut
[vivek]:
improve variable names

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-09-20 11:03:19 +08:00
Dave Young fea5fd770f mkdumprd: add function get_persistent_dev
Copy the function get_persistent_dev from dracut for us to handle the
persistent name issues.
[vivek] add error handling for get_persistent_dev

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-09-20 11:03:09 +08:00
Dave Young 5f68617954 pass raw device as dracut argument
For raw device upon complex storage such as multipath and iscsi
dracut does not resolve the module dependency automaticlly,
I sent a patch for the device pass via dracut argument "--device"
see below for reference:
http://permalink.gmane.org/gmane.linux.kernel.initramfs/2836

Add --device <device> in mkdumprd for raw dump to fix this issue.

Testing:
raw dump on iscsi targets.

Signed-off-by: Dave Young <dyoung@redhat.com>
Tested-by: Chao Wang <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-08-29 09:42:18 +08:00
Dave Young b47c0915d2 refactor net option
Currently net options means either nfs or ssh dump.
Better to split these two into standalone options. That's more clear to user.

after the split, ssh dump need user specify "ssh user@host"
nfs dump need user specify "nfs host:nfsshare"

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-07-23 15:31:28 +08:00
Dave Young 6520b8f245 remove useless dracut cmdline '-c /dev/null'
For "-c /dev/null" Harald mentioned that it is useless.
In fact, dracut code [[ -f /dev/null ]] will return false thus it will still use
the default config file

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Cong Wang <amwang@redhat.com>
2012-07-12 11:15:36 +08:00
Dave Young 7699429c09 remove useless dracut cmdline for kernel-modules and kdumpbase
kernel-modules and kdumpbase will be included automaticlly when check() pass.
So no need explictly specify them in dracut cmdline.

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-07-12 11:15:35 +08:00
Dave Young 4d37a55bc1 install core_collector in module-setup.sh
file install code should stay in module-setup.sh, move core_collector installation
code as well.

Note: mkdumpfile is installed twice before, one is dracut cmdline, another is
module_setup.sh. This patch removed the duplicate code in dracut cmdline.

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-07-12 11:15:35 +08:00
Dave Young 9f5af7aca8 install extra_bins in module-setup.sh
moving file install code to module-setup.sh looks better.
This patch move extra_bins installation to module-setup.sh

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-07-12 11:15:35 +08:00
Dave Young 1c38f02031 improve warning message of space checking
For core_collector like makedumpfile use case, it will compress and filter the
vmcore so free space small than memtotal is mostly ok. But we can not guarantee
it will be always ok.

The "there is not enough space" is not accurate, improve it to "there might be
not enough space"

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-07-12 11:15:35 +08:00
Dave Young ec8e35a790 do not mount root twice
Resolves: bz821997

dracut will mount rootfs for us, so we need not pass root to fstab again here.
Here remove the root-mount line.

This will depends on the root=cmdline is right, by default kdump will
inherit it from /proc/cmdline.

Vivek: add document about the assumption for the root= cmdline issue.

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-07-12 11:15:35 +08:00
Dave Young 88b03bf0ba do not add fstab-sys module in dracut cmdline
fstab-sys module will be added automaticlly when there's --mount passed
So no need to explictly add it in dracut cmdline

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-07-12 11:15:35 +08:00
Dave Young b14b692242 omit dash module
dash is be default omited in f17, but we use -o in command line so our omit
modules list will overwrite the system configs, so dash will be installed to
initramfs.

Here avoid install dash by adding it to the '-o' list
Also remove dash dependency from rpm spec

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-07-12 11:15:35 +08:00
dyoung@redhat.com 7148c0a30d add s390x netdev setup
s390x netdev need special cmdline to bring up
parse the ifcfg file to append proper cmdline, also add znet dracut module

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-07-05 16:52:12 +08:00
dyoung@redhat.com a71cead537 add check_size function for fs dump
Resolves: bz806196

Adding check_size function for filesystem dump, also move common code to
top of the file because get_fs_size need know the mount point.

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-07-05 16:39:27 +08:00
dyoung@redhat.com 2cb3c1cbc4 add ssh check_size
check available size of ssh target before dumping
remove unused check_remote()
v2: vivek: add error handling

Resolves: bz806196

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-07-05 16:39:08 +08:00
dyoung@redhat.com ea5c605d16 blacklist patch apply fix
The original blacklist patch was applied without conflict.
But in fact there's exactly same context with amerigo's original patch and
it's in wrong place!

Moving it to the right switch branch..

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-07-05 16:38:29 +08:00
dyoung@redhat.com 1b30666cac add blacklist option
For the "blacklist" here, it means prevent the kernel modules
from loading into kdump initrd, which is different from RHEL6.

Signed-off-by: Dave Young <dyoung@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-06-22 15:38:42 +08:00
Dave Young b30eb78ab2 raw core_collector fix
1. only append '-F' for default core_collector internally
2. error out if user does not add '-F' for makedumpfile

v1->v2: refresh because of new core collector verify function
v2->v3: optimize the code, remove local variable for default core_collector

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-06-14 09:57:07 +08:00
Dave Young 2697669fa9 ssh core_collector fix
1. add core_collector filter support to ssh dump
2. scp can be specified in kdump.conf
3. error out if no '-F' with makedumpfile
4. add proper explanation and examples to kdump.conf[.5] and kexec-kdump-howto.txt.

v1->v2: add verify_core_collector function
v2->v3: optimize the code, remove local variable for default core_collector

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-06-14 09:56:10 +08:00
Dave Young 7a7ecb150b omit plymouth module
Resolves: bz821997

while root is set to dump target, it can not be unmounted because plymouthd
are holding it. umount failing will cause calling of default_action.

Omit plymouth module to fix this issue.
Also drop "--add dash" or dracut will report error "dash is not found", this
is because default fedora dracut.conf will omit dash.

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-06-06 16:26:32 +08:00
Dave Young 7e82b251c6 mkdumprd: remove --debug
dracut args pass through will be introduced later, remove this firstly.

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-06-06 16:24:32 +08:00
Dave Young d88c0390b8 mkdumprd: remove noconf
noconf is not supported, remove the --noconf in mkdumprd

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-06-06 16:24:28 +08:00
Dave Young d6cc7ff7dc makedumprd: remove -d
-d option is not implemented and unused, remove it from mkdumprd

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-06-06 16:24:23 +08:00
Vivek Goyal 015dd4c67c mkdumprd: Start using --hostonly and --add kdumpbase while calling dracut
BZ: 817044

Harald suggested that we use --add kdumpbase instead of -m kdumpbsae. As
-m means only use modules specified on the command line. I am not sure
that kdump will ever know the list of modules it wants to use. It might
be a good idea to let dracut decide it based on --mount option.

Also start using --hostonly to make sure atleast our default dumping to
root disk always works.

I also noticed that with --add and --hostonly initramfs size came down. So
for the time being just bring down the initramfs size.

But it still looks big and this area will require more experimentation and
bug fixing to make sure we are generatiing optimal size images for kdump
purposes and get rid of bloat. I am just beginning to understand dracut,
so expect more churn in this area down the line from me.

I am posting this patch for the bz opened again F18. As it is reducing
initramfs size significantly, I think it is a good idea to commit it
in F17 branch also.

Following is image size comparision.

Dump to root disk.
------------------
vanilla compressed: 13MB
hostonly compressed: 7.5MB

Dump to nfs
-----------
vanilla compressed: 24MB
hostonly compressed: 13MB

Dump over ssh
-------------
vanilla compressed: 23.5 MB
hostonly compressed: 12 MB

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2012-05-02 10:08:18 +08:00
Dave Young 24eaa7da8f port raw dump from rhel6 [v7]
Resolves: bz805783

kdumpctl: save_raw if found vmcore
mkdumprd: checking available size of raw disk
dracut module: do the dumping

Note, add a dir /kdumpscripts for monitor_dd_progress and future
kdump scripts
[v1->v2]: monitor_dd_process become a script instead of a function
          add missed utils
          use pipe with dc
[v2->v3]: Don: fix dd_progress_file typo
          Vivek: move [ -f $conf_file ] earlier
                 don't split keyfile= and [ -f keyfile ]
                 move default core_collector earlier
                 move non-makedumpfile warnings to mkdumprd
                 make check available size a common function
          Amerigo: use less pipe for grep then awk print
                   use shell (( )) instead of dc
          use cut instead of awk
          no need install dc and awk
          make DD_BLKSIZE a variable
          don't add 0755 file in git, chmod in module-setup.sh
[v3->v4]: vivek: kdumpctl multi raw target handling
          monitor_dd_progress- fix wrong size calculation:
          the tail -1 of dd pregress file is in bytes instead of blocks
          only print the whole dd src file size for non-filtered case
          check [ -b raw target device ] before dump
[v4->v5]: vivek: move check [ -b $1 ] before monitor_dd_progress
          remove multi target function
[v5->v6]: vivek: only warning for raw dump of non-makedumpfile core_collector
[v6->v7]: kdumpctl should return 0 when there's no raw target

Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2012-05-02 10:06:51 +08:00
Dave Young ba0aa24316 Add ssh dump support
Add ssh dump support

changes including below items:
1. sshkey option
2. sshkey propagate
3. fix a bug of  _server ip calculation for dump target string
4. change the prefix of kdump hook from 93 to 01 to avoid dhclient and
   other cleanups happening before us
5. enable network with dracut cmdline rd.neednet=1 when there's network
   target config

[v1 - v2]:
Only check_ssh_target when there's ssh dump target in kdump config file

[v2 -> v3]
style fixes: trailing spaces and space before tab indent
remove set -x
simply check_ssh_target
use awk to get sshkey option value
change pivot hook order to 0000

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-02-22 14:12:57 +08:00
Cong Wang f51fd99344 Really upload the dracut module this time 2012-01-25 17:21:43 +08:00
Cong Wang c461ec7057 Fix various bugs for nfs dump 2012-01-25 16:58:35 +08:00
Cong Wang 2630148dc7 Handle rootfs correctly 2012-01-25 12:18:51 +08:00
Cong Wang a0f1142b60 Fix add_dracut_arg in mkdumprd 2012-01-10 22:34:47 +08:00
Cong Wang 113404857a Update kdump dracut module with the latest dracut kdump branch 2012-01-10 13:28:27 +08:00
Cong Wang 2d16a847d4 Use an array to hold arguments to avoid quote problems 2011-12-16 18:06:45 +08:00
wangcong 005c06fa9f Update kdump dracut module to use the latest dracut feature 2011-12-16 14:21:02 +08:00
Amerigo Wang c5ebc6337d mkdumprd: move module inclusion code to module-setup.sh 2011-08-01 17:19:24 +08:00
Amerigo Wang 108f6ac2cc mkdumprd: use shutdown module of dracut to handle reboot/shutdown/halt. 2011-07-28 22:50:43 +08:00
Amerigo Wang 52dbdacb5f wait for loginit 2011-07-27 20:37:49 +08:00
Amerigo Wang 75b0166343 mkdumprd: don't use consolehelper 2011-07-27 19:45:59 +08:00
Amerigo Wang 1345d1582d mkdumprd: support core_collector and extran_bins 2011-07-25 18:02:37 +08:00
Amerigo Wang c5f74a28e8 Bypass -d option. 2011-07-21 21:04:09 +08:00
Amerigo Wang 57ae098fd0 Update initramfs code. 2011-07-21 18:51:33 +08:00
Neil Horman fe18fead61 Resolves: bz 710744 2011-06-06 15:43:54 -04:00
Neil Horman 678b7b882f Fix misuse of basename in mkdumprd
Resolves bz: 683769
2011-03-28 11:08:50 -04:00
Neil Horman 2fb552037c remove emitdms call and code as its no longer needed 2011-03-10 11:04:43 -05:00
Neil Horman 771517d3a8 Resolves: bz 645734 2010-10-22 06:56:33 -04:00
Neil Horman be84f84fee Resolves: bz 635893 2010-09-22 06:58:35 -04:00
Lubomir Rintel dc002368a1 Pull EL6 kdump fixes into Rawhide Resolves: 597588 2010-06-13 19:20:48 +00:00
Neil Horman 68d2a8081e Resolves: bz 572569 2010-03-11 16:06:06 +00:00
Neil Horman 66d844ee90 Resolves: bz 566135 2010-02-17 16:49:26 +00:00
Neil Horman 5a44a04f67 Resolves: bz519767 2009-12-01 17:56:44 +00:00
Neil Horman 0376606424 Resolves: bz 505701 2009-06-15 16:58:42 +00:00
Neil Horman 64c7c7b164 Resolves: bz 494416 2009-04-07 13:57:21 +00:00
Neil Horman 94baf10fb4 Resoves: bz 493707 2009-04-03 20:06:29 +00:00
Neil Horman 352a954156 Resolves: bz 469001 2008-10-29 13:37:34 +00:00
Neil Horman ced35688d2 Resolves: bz 455998 2008-08-27 11:26:34 +00:00
Neil Horman b4a96a8bbc Resolves: bz 443878) 2008-07-14 14:52:37 +00:00
Neil Horman 51a3406429 Resolves: bz 443878 2008-06-11 10:51:51 +00:00
Neil Horman 558bea7d40 Mass Update of RHEL5 patches 2008-06-05 15:18:53 +00:00
Neil Horman f178fa14a0 Resolves: bz 443878 2008-04-24 17:09:32 +00:00
Neil Horman dbc5e5bd2e Bunches of bugfixes from RHEL5 + bz 428684 2008-02-22 12:40:20 +00:00
Neil Horman 79df4118e8 Resolves: bz 433350 2008-02-19 20:01:55 +00:00
Neil Horman 4a8369b55e Resolves: bz 252170 2007-08-22 15:14:11 +00:00
Neil Horman 9611e10df6 Resolves: bz 250341 2007-08-01 17:44:53 +00:00
Neil Horman 7c84ec10fe Resolves: bz248797 2007-07-19 12:33:57 +00:00
Neil Horman d60d8254be Resolves: bz222911 2007-06-19 11:05:47 +00:00
Neil Horman 42b55e6012 Resolves: bz215056 2007-03-15 17:36:03 +00:00
Neil Horman 88c0ba0f32 Updating kdump.init and mkdumprd to equiv. of -163.el5 2007-01-25 20:13:28 +00:00
Neil Horman d3c4b95f8a Updating fc7 with all RHEL5 work 2006-12-15 21:05:01 +00:00
Neil Horman a5a9abd60f updating mkdumprd to use ifup/down in busybox and to use chkconfig properly 2006-09-28 16:16:04 +00:00
Neil Horman 27e9206ed0 final updates for busybox conversion 2006-09-23 01:49:08 +00:00
Neil Horman 31a04fb720 further updates to mkdumprd for scp dumping with busybox 2006-09-22 19:09:02 +00:00
Neil Horman f9718a1ad6 checking in initial changes to convert kdump to use busybox rather than
nash
2006-09-18 17:59:46 +00:00
Neil Horman ae7dce0148 updating mkdumprd 2006-08-31 13:23:33 +00:00
Neil Horman 91d1880e3e fixing kcp.c typo and making scp work in mkdumprd 2006-08-30 20:34:16 +00:00
Neil Horman 3060ffe3d7 updating kexec-tools with new kcp utiltiy 2006-08-24 11:55:28 +00:00
Neil Horman 19eed8f6b0 fixing several typo bugs 2006-08-18 17:00:45 +00:00
Neil Horman ea179a207a adding kexec frontend 2006-07-20 03:36:18 +00:00