[Patch v5 4/6] store the default dump target info when default target is a separate disk
Baoquan He
bhe at redhat.com
Mon Mar 31 07:17:04 UTC 2014
If default target is a separate disk, the related information need be
stored in /etc/kdump.conf of kdump initramfs. This includes the disk
info which will help to deduce the dump_code and path which the vmcore
will be written into.
Signed-off-by: Baoquan He <bhe at redhat.com>
---
dracut-module-setup.sh | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index bdadf7c..4c95e3d 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -261,6 +261,37 @@ kdump_install_net() {
fi
}
+default_dump_target_install_conf()
+{
+ local _target _fstype
+ local _s _t
+ local _mntpoint
+ local _path _save_path
+
+ is_user_configured_dump_target && return
+
+ _save_path=$(grep ^path "/etc/kdump.conf"| cut -d' ' -f2)
+ [ -z "$_save_path" ] && _save_path=$DEFAULT_PATH
+
+ _mntpoint=$(get_mntpoint_from_path $_save_path)
+ _target=$(get_target_from_path $_save_path)
+ if [ "$_mntpoint" != "/" ]; then
+ _fstype=$(get_fs_type_from_target $_target)
+
+ if [ "$_fstype" = "nfs" ];then
+ kdump_install_net "$_target"
+ else
+ _target=$(kdump_to_udev_name $_target)
+ fi
+
+ echo "$_fstype $_target" >> /tmp/$$-kdump.conf
+
+ _path=${_save_path##"$_mntpoint"}
+ sed -i -e "s#$_save_path#$_path#" /tmp/$$-kdump.conf
+ fi
+
+}
+
#install kdump.conf and what user specifies in kdump.conf
kdump_install_conf() {
sed -ne '/^#/!p' /etc/kdump.conf > /tmp/$$-kdump.conf
@@ -285,6 +316,8 @@ kdump_install_conf() {
esac
done < /etc/kdump.conf
+ default_dump_target_install_conf
+
kdump_check_fence_kdump
inst "/tmp/$$-kdump.conf" "/etc/kdump.conf"
rm -f /tmp/$$-kdump.conf
--
1.8.5.3
More information about the kexec
mailing list