[PATCH v3] Hardware iSCSI boot disk support
by WANG Chao
In 1st kernel, the iscsi device could be both software or hardware
based. But we only use software iscsi in 2nd kernel. This is fine for
software iscsi as it's consistent with 1st kernel. However kdump
bringing up hardware iscsi in software mode could lead conflicts with
dracut bringing up logic, depending on the configuration.
If boot disk is hardware iscsi, we should still use hardware iscsi in
2nd kernel. In this case, dracut will bring up the device like it does
for normal boot. kdump don't need to do extra work to configure software
iscsi.
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
dracut-module-setup.sh | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index d65c8c0..6f6648d 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -412,7 +412,11 @@ kdump_get_iscsi_initiator() {
return 1
}
-# No ibft handling yet.
+# Figure out if the iscsi session is based on iBFT or firmware
+kdump_handle_hw_iscsi() {
+ [ "$(kdump_iscsi_get_rec_val $1 "node.discovery_type")" = fw ]
+}
+
kdump_setup_iscsi_device() {
local path=$1
local tgt_name; local tgt_ipaddr;
@@ -435,6 +439,10 @@ kdump_setup_iscsi_device() {
return 1
fi
+ if kdump_handle_hw_iscsi ${path}; then
+ return 0
+ fi
+
tgt_name=$(kdump_iscsi_get_rec_val ${path} "node.name")
tgt_ipaddr=$(kdump_iscsi_get_rec_val ${path} "node.conn\[0\].address")
--
2.1.0
9 years, 3 months
[Patch v2 1/2] dracut-module-setup.sh: make some clean up
by Baoquan He
Chao pointed out that it's better to use get_option_value to get
get a specific config_val.
And also there's a potential risk when use below sed command to
do the replacement.
sed -i -e "s#$_save_path#$_path#" /tmp/$$-kdump.conf
Say user configure kdump.conf like the following. Then sed may
replace "/var/crash/post.sh" with something else, depanding on
mount point.
kdump_post /var/crash/post.sh
path /var/crash
So in this patch clean them up.
Signed-off-by: Baoquan He <bhe(a)redhat.com>
---
dracut-module-setup.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index d65c8c0..793495a 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -313,7 +313,7 @@ default_dump_target_install_conf()
is_user_configured_dump_target && return
- _save_path=$(grep ^path "/etc/kdump.conf"| cut -d' ' -f2)
+ _save_path=$(get_option_value "path")
[ -z "$_save_path" ] && _save_path=$DEFAULT_PATH
_mntpoint=$(get_mntpoint_from_path $_save_path)
@@ -331,7 +331,7 @@ default_dump_target_install_conf()
echo "$_fstype $_target" >> /tmp/$$-kdump.conf
_path=${_save_path##"$_mntpoint"}
- sed -i -e "s#$_save_path#$_path#" /tmp/$$-kdump.conf
+ sed -i -e "s#^path[[:space:]]\+$_save_path#path $_path#" /tmp/$$-kdump.conf
fi
}
@@ -346,7 +346,7 @@ kdump_install_conf() {
config_val=$(strip_comments $config_val)
case "$config_opt" in
ext[234]|xfs|btrfs|minix|raw)
- sed -i -e "s#$config_val#$(kdump_to_udev_name $config_val)#" /tmp/$$-kdump.conf
+ sed -i -e "s#^$config_opt[[:space:]]\+$config_val#$config_opt $(kdump_to_udev_name $config_val)#" /tmp/$$-kdump.conf
;;
ssh|nfs)
kdump_install_net "$config_val"
--
1.9.0
9 years, 3 months
[PATCH] mount fail if its mount point doesn't exist in /sysroot
by Baoquan He
Jerry Hoemann reported a bug that a mount will fail when he installed
a system with separate "/" "/var" and "/var/crash". That means root
disk /dev/a mounted on /, and another disk /dev/b is mounted on /var,
then the 3rd disk /dev/c mounted on /var/crash. Then kdump will fail
since mount will fail.
This is because the mount information will be written into
/$mntimage/etc/fstab like below. And the dump target is /dev/c. However
/dev/b is not related in kdump, its mount info is not necessary and not
saved. So when go into kdump kernel, it will find there's not a crash
dir under /sysroot/var. And in current implementation, if not a root
disk dump, sysroot is a read-only mount, no dir can be created in this
situation.
/dev/disk/by-uuid/cdcf007a-b623-45ee-8d73-a8be0d372440 /sysroot/var/crash xfs rw,relatime,...,x-initrd.mount 0 2
So in this patch, change the mount behavior to fix this bug. If dump
target is a root disk, mount point is /sysroot. If dump target is not
root, just mount it to /kdumproot/$_target. Now it works.
Signed-off-by: Baoquan He <bhe(a)redhat.com>
---
mkdumprd | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/mkdumprd b/mkdumprd
index a30d9ca..6ade88a 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -102,7 +102,13 @@ to_mount() {
_source=$(findmnt -k -f -n -r -o SOURCE $_dev)
_target=$(findmnt -k -f -n -r -o TARGET $_dev)
# mount under /sysroot in 2nd kernel, and we umount -R /sysroot before exit
- _target="/sysroot$_target"
+
+ if [ $_target = "/" ];then
+ _target="/sysroot"
+ else
+ _target="/kdumproot/$_target"
+ fi
+
_fstype=$(findmnt -k -f -n -r -o FSTYPE $_dev)
_options=$(findmnt --fstab -f -n -r -o OPTIONS $_dev)
[ -z "$_options" ] && _options=$(findmnt -k -f -n -r -o OPTIONS $_dev)
@@ -368,6 +374,7 @@ handle_default_dump_target()
fi
}
+
get_default_action_target()
{
local _target
--
1.8.5.3
9 years, 3 months
[PATCH] kdump, remove panic_on_warn from 2nd kernel cmdline
by Prarit Bhargava
With the inclusion of 'panic_on_warn',
http://marc.info/?l=linux-api&m=141570937328528&w=2
and which is now staged in Andrew Morton's tree, we need to remove
'panic_on_warn' from the 2nd kernel's cmdline. If it is included it is
possible a non-fatal warning could panic the second kernel.
Before:
[ 0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-3.10.0+
root=/dev/mapper/rhel_intel--canoepass--05-root ro
rd.lvm.lv=rhel_intel-canoepass-05/root
rd.lvm.lv=rhel_intel-canoepass-05/swap console=ttyS0,115200n81
LANG=en_US.UTF-8 systemd.debug panic_on_warn=1 irqpoll nr_cpus=1
reset_devices cgroup_disable=memory mce=off numa=off udev.children-max=2
panic=10 rootflags=nofail acpi_no_memhotplug disable_cpu_apicid=0
elfcorehdr=839092K
After:
[ 0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-3.10.0+
root=/dev/mapper/rhel_intel--canoepass--05-root ro
rd.lvm.lv=rhel_intel-canoepass-05/root
rd.lvm.lv=rhel_intel-canoepass-05/swap console=ttyS0,115200n81
LANG=en_US.UTF-8 systemd.debug irqpoll nr_cpus=1 reset_devices
cgroup_disable=memory mce=off numa=off udev.children-max=2 panic=10
rootflags=nofail acpi_no_memhotplug disable_cpu_apicid=0
elfcorehdr=839092K
Signed-off-by: Prarit Bhargava <prarit(a)redhat.com>
---
kdumpctl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl
index ee3214a..a9e5d2e 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -105,7 +105,7 @@ prepare_cmdline()
else
cmdline=${KDUMP_COMMANDLINE}
fi
- cmdline=`remove_cmdline_param "$cmdline" crashkernel hugepages hugepagesz`
+ cmdline=`remove_cmdline_param "$cmdline" crashkernel hugepages hugepagesz panic_on_warn`
cmdline="${cmdline} ${KDUMP_COMMANDLINE_APPEND}"
--
1.7.9.3
9 years, 3 months
[PATCH 0/4 v6] Enhance kdump to support ipv6
by Minfei Huang
v6:
- construct the patches, split more small patches
- wrap the similar functional code to make it more clearly
v5:
- modify the get_route function
v4:
- consistent the netdevice name to add the prefix "kdump-" before the ethX
v3:
- Support the static route
v2:
- Fix some bugs
Minfei Huang (4):
mkdumprd: Add proper prefix "kdump-" before ethX in 2nd kernel
kdump-lib: Add new lib to identify the ipv6 address or not
dracut-module-setup: Wrap the similar functional code to the function
ipv6: Enhance kdump to support ipv6
dracut-kdump.sh | 8 +-
dracut-module-setup.sh | 204 ++++++++++++++++++++++++++++++++++---------------
kdump-lib.sh | 26 +++++--
mkdumprd | 17 ++++-
4 files changed, 185 insertions(+), 70 deletions(-)
--
1.8.3.1
9 years, 3 months