Commit Graph

81 Commits

Author SHA1 Message Date
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