Resolves bz845916.
For raw dump code below:
$CORE_COLLECTOR /proc/vmcore | dd of=$1 bs=$DD_BLKSIZE >> /tmp/dd_progress_file 2>&1 || return 1
in case pipe fails it will still return 0, Fix this by return the PIPESTATUS[0] at the end of this fuction.
Signed-off-by: Chao Wang <chaowang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
Kdump dracut hooks need to enter emergency shell, currently it directly call
"sh -i -l", with recent dracut this does not work anymore without proper ctty.
change to call dracut lib function _emergency_shell instead of directly call
'sh -i -l'
This patch depends on dracut patch:
http://permalink.gmane.org/gmane.linux.kernel.initramfs/2821
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
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>
dump_nfs mount the nfs share to /mnt, it's not what we expected.
Change to use dracut fstab mount infrastructure for this.
After the fix nfs dump is just same as localfs dump.
The --mount for nfs does not work before, it depend on the upstream patch:
1. dracut fix to autoload nfs.ko in case nfs4. the patch post as below:
http://permalink.gmane.org/gmane.linux.kernel.initramfs/2768
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
nfs will be handled in fstab-sys as well as localfs.
so rename dump_localfs to dump_fs firstly.
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
in dump_localfs, we should error out if fstab mount fails
Also error out if mkdir fails.
vivek: display error message for debugging purpose.
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
We should use systemctl instead of service to start/restart the kdump service
update kexec-kdump-howto.txt as well.
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
we now switched to systemd, 'service kdump propagate' does not work anymore.
update the alert message to use 'kdumpctl propagate'
vivek: update kexec-kdump-howto.txt as well.
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
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>
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>
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>
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>
We do not depend on busybox anymore, so remove it from Requires field.
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
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>
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>
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>
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>
In case explict DNS setup in ifcfg file, we should add proper cmdline
for dracut network use.
Add a kdump_setup_dns function to handle this.
v1->v2: vivek: use echo instead of 'echo -n'
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
exit the saved $? instead of the wrong one after echo line
v1->v2: vivek, save the return value instead of exit 1
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
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>
module_setup.sh removed comment and blank lines of kdump.conf, then install it
to initramfs, but it leaved the /tmp/$$-kdump.conf which should be removed.
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
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>
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>
Update: use /sys/class/net/bondX/bonding/mode
We should set the mode of the bonding properly
in the second kernel too.
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
Update: error out vlan over bridge case
This patch adds support for vlan tagged bonding,
in theory, we could support other complex setup as well,
in practice, this is not easy, so just support vlan
tagged bonding, which is the one we support in RHEL6.
Note, this patch depends on the dracut patch:
http://marc.info/?l=initramfs&m=134025049228510&w=2
Cc: Dave Young <dyoung@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
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>
Original patch is from Amerigo, but it has changed a lot:
remove multi dump
refreshed with latest git for the dump instruction function restructure
fixed the behavior of do_kdump_pre, if kdump_pre fails it will reboot
update the docs
check the existance and executable of kdump_pre/post files,
also check the timestamp of them for rebuilding.
refresh patch,
Address comments from vivek:
s/hush/bash in docs
fix the copy-paste error in kdump post error message
s/reboot\/halt/reboot in kexec-kdump-howto.txt
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Resolves: bz805778
Simply the logic and optimize the code
Move check_exist, check_executable, rebuild_initrd to functions
remove BOOTDIR which is not used
Note: There might be modules which are newer than last built initramfs,
we always rebuild the initramfs when extra_moduels= is specified.
Signed-off-by: Dave Young <dyoung@redhat.com>
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>
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>
move conf_file as a global variable to the top.
vivek: return earlier if kdump.conf is not found in read_kdump_conf to
avoid the deep indent.
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
let add_dump_code only deal with real dump instruction,
move other logic out of that function, so it's easier for future features
like kdump_pre and kdump_post.
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
default action is handled in DUMP_INSTRUCTIONI. If default_action failed
current logic will cause mount_root_run_init, It does not make much sense.
changes to: let reboot -f does not depend on return status of DUMP_INSTRUCTION
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Do not reboot in dump_rootfs function, also do not directly call dump_rootfs
for default dump. Instead just adding it to DUMP_INSTRUCTION as other
user specified dump target.
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
This patch depends on the latest dracut in git.
It adds support of dumping over a vlan device.
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
This patch fixes dumping over a bonding interface,
we should pass ifname= for all its underlying slaves,
which is required by dracut.
And it separates the code into a different function.
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
This patch fixes dumping over a bridge interface,
we should pass ifname= for all its underlying devices,
which is required by dracut.
And it separates the code into different functions,
for later patches to use.
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
Update core_collector in kdump.conf[.5]:
1. accept <command> not limited to makedumpfile
2. add notes about default core_collector
3. add notes about flattened vmcore
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
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>
All these options are not valid for current mkdumprd. So remove them.
Leave a minimal mkdumprd.8
Signed-off-by: Dave Young <dyoung@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
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>
-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>