Dracut has "--hostonly-cmdline" which can generate cmdlines(if any) regarding the dump target, it's an existing way for us to use to simplify the code. E.g. We can remove generate_lvm_cmdlines() if we use "--hostonly-cmdline"(see PATCH 4).
But "--hostonly-cmdline" has other issues(e.g. BZ1451717), it adds needless devices for kdump like root device. These issues can be solved with the help of dracut "--no-hostonly-default-device", we can have only one device being recognized (dump target) in most cases under kdump.
This patch series applies dracut's "--hostonly-cmdline" together with "--no-hostonly-default-device", and removes some old code accordingly.
Please "man dracut.cmdline" for "--hostonly-cmdline", "--no-hostonly-default-device" details.
See "--no-hostonly-default-device" patches: https://github.com/dracutdevs/dracut/pull/269
Also see the following former threads for some background: https://lists.fedoraproject.org/archives/list/kexec@lists.fedoraproject.org/...
Has passed tests about LUKS, iscsi, lvm, nfs, etc.
Xunlei Pang (9): Revert "mkdumprd: omit dracut modules in case of network dumping" Revert "mkdumprd: omit dracut modules in case of no dm target" Revert "mkdumprd: omit crypt when there is no crypt kdump target" Revert "kdumpctl: use generated rd.lvm.lv=X" kdumpctl: move is_fadump_capable() to kdump-lib.sh Change dump_to_rootfs to use "--mount" instead of "root=X" mkdumprd: apply dracut "--hostonly-cmdline" and "--no-hostonly-default-device" kdumpctl: remove some cmdline inheritage from 1st kernel module-setup: remove software iscsi cmdline generated by dracut
dracut-module-setup.sh | 5 +++++ kdump-lib.sh | 30 +++++++++---------------- kdumpctl | 61 ++++++++------------------------------------------ kexec-tools.spec | 2 +- mkdumprd | 61 +++++++------------------------------------------- 5 files changed, 34 insertions(+), 125 deletions(-)
This reverts commit fb522e972c9d26e2efdabeaed543b5b23e1866e0.
We are going to add "--no-hostonly-default-device" dracut argument in the following patch.
With the help of "--no-hostonly-default-device", dracut only adds the dump target as host devices, which naturally guarantees only required dracut modules being selected. --- mkdumprd | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/mkdumprd b/mkdumprd index d3ecbd6..68fe6e8 100644 --- a/mkdumprd +++ b/mkdumprd @@ -372,13 +372,12 @@ crypt_exists=0 omit_dracut_modules() { local target majmin - local dm_exists network_only + local dm_exists
# Skip fadump case is_fadump_capable && return
dm_exists=0 - network_only=1
for target in $(get_kdump_targets); do if [ -b "$target" ]; then @@ -386,9 +385,6 @@ omit_dracut_modules() # Check "dm" check_block_and_slaves is_dm $majmin && dm_exists=1 fi - - # Check nfs/ssh dumping - [[ "$target" != "nfs" && "$target" != "ssh" ]] && network_only=0 done
# Omit "crypt", BZ1451717 @@ -401,12 +397,6 @@ omit_dracut_modules() # "dm_exists=0" implies "crypt_exists=0" add_dracut_arg "--omit" "lvm dm multipath dmraid" fi - - # Further omit more modules in case of nfs/ssh dumping - if [ "$network_only" == "1" ]; then - # "network_only=1" implies "dm_exists=0" - add_dracut_arg "--omit" "iscsi fcoe fcoe-uefi" - fi }
if ! check_resettable; then
This reverts commit 821d1af0804825f01bdd540b626d81ea95a5414a.
We are going to add "--no-hostonly-default-device" dracut argument in the following patch.
With the help of "--no-hostonly-default-device", dracut only adds the dump target as host devices, which naturally guarantees only required dracut modules being selected. --- mkdumprd | 28 ---------------------------- 1 file changed, 28 deletions(-)
diff --git a/mkdumprd b/mkdumprd index 68fe6e8..8a2fe74 100644 --- a/mkdumprd +++ b/mkdumprd @@ -359,44 +359,16 @@ check_crypt() return 1 }
-is_dm() -{ - if [ -d "/sys/dev/block/$1/dm" ]; then - return 0 - fi - - return 1 -} - crypt_exists=0 omit_dracut_modules() { - local target majmin - local dm_exists - # Skip fadump case is_fadump_capable && return
- dm_exists=0 - - for target in $(get_kdump_targets); do - if [ -b "$target" ]; then - majmin=$(get_maj_min $target) - # Check "dm" - check_block_and_slaves is_dm $majmin && dm_exists=1 - fi - done - # Omit "crypt", BZ1451717 if [ "$crypt_exists" == "0" ]; then add_dracut_arg "--omit" "crypt" fi - - # Further omit more modules in case of no dm related target - if [ "$dm_exists" == "0" ]; then - # "dm_exists=0" implies "crypt_exists=0" - add_dracut_arg "--omit" "lvm dm multipath dmraid" - fi }
if ! check_resettable; then
This reverts commit 54a5bcc4ee86f8647fbe4c3766910fb28add5cac.
We are going to add "--no-hostonly-default-device" dracut argument in the following patch.
With the help of "--no-hostonly-default-device", dracut only adds the dump target as host devices, which naturally guarantees only required dracut modules being selected. --- kdump-lib.sh | 12 ------------ kdumpctl | 12 ++++++++++++ mkdumprd | 15 --------------- 3 files changed, 12 insertions(+), 27 deletions(-)
diff --git a/kdump-lib.sh b/kdump-lib.sh index 3f0af91..a33f172 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -6,7 +6,6 @@ DEFAULT_PATH="/var/crash/" FENCE_KDUMP_CONFIG_FILE="/etc/sysconfig/fence_kdump" FENCE_KDUMP_SEND="/usr/libexec/fence_kdump_send" -FADUMP_ENABLED_SYS_NODE="/sys/kernel/fadump_enabled"
perror_exit() { echo $@ >&2 @@ -482,14 +481,3 @@ get_dracut_args_target() { echo $1 | grep "--mount" | sed "s/.*--mount .(.*)/\1/" | cut -d' ' -f1 } - -is_fadump_capable() -{ - # Check if firmware-assisted dump is enabled - # if no, fallback to kdump check - if [ -f $FADUMP_ENABLED_SYS_NODE ]; then - rc=`cat $FADUMP_ENABLED_SYS_NODE` - [ $rc -eq 1 ] && return 0 - fi - return 1 -} diff --git a/kdumpctl b/kdumpctl index 2ad786c..fba6231 100755 --- a/kdumpctl +++ b/kdumpctl @@ -13,6 +13,7 @@ DUMP_TARGET="" DEFAULT_INITRD="" DEFAULT_INITRD_BAK="" TARGET_INITRD="" +FADUMP_ENABLED_SYS_NODE="/sys/kernel/fadump_enabled" FADUMP_REGISTER_SYS_NODE="/sys/kernel/fadump_registered" #kdump shall be the default dump mode DEFAULT_DUMP_MODE="kdump" @@ -942,6 +943,17 @@ handle_mode_switch() fi }
+is_fadump_capable() +{ + # Check if firmware-assisted dump is enabled + # if no, fallback to kdump check + if [ -f $FADUMP_ENABLED_SYS_NODE ]; then + rc=`cat $FADUMP_ENABLED_SYS_NODE` + [ $rc -eq 1 ] && return 0 + fi + return 1 +} + check_current_fadump_status() { # Check if firmware-assisted dump has been registered. diff --git a/mkdumprd b/mkdumprd index 8a2fe74..9f375e0 100644 --- a/mkdumprd +++ b/mkdumprd @@ -359,24 +359,11 @@ check_crypt() return 1 }
-crypt_exists=0 -omit_dracut_modules() -{ - # Skip fadump case - is_fadump_capable && return - - # Omit "crypt", BZ1451717 - if [ "$crypt_exists" == "0" ]; then - add_dracut_arg "--omit" "crypt" - fi -} - if ! check_resettable; then exit 1 fi
if ! check_crypt; then - crypt_exists=1 echo "Warning: Encrypted device is in dump path. User will prompted for password during second kernel boot." fi
@@ -461,8 +448,6 @@ then add_dracut_arg "--add-drivers" "$extra_modules" fi
-omit_dracut_modules - dracut "${dracut_args[@]}" "$@" _rc=$? sync
This reverts commit cb38b32dfc29673caaf6987aacbe10b9ee0051ae.
We are going to add "--hostonly-cmdline" dracut argument in the following patch.
With the help of "--hostonly-cmdline", dracut will generate "rd.lvm.lv=X" for us, no need to implement here again. --- kdumpctl | 47 ++--------------------------------------------- 1 file changed, 2 insertions(+), 45 deletions(-)
diff --git a/kdumpctl b/kdumpctl index fba6231..9c7e8dc 100755 --- a/kdumpctl +++ b/kdumpctl @@ -175,45 +175,6 @@ check_kdump_cpus() echo " try nr_cpus=$nr_min or larger instead" }
-# Generate rd.lvm.lv=X for the kdump targets if any. -generate_lvm_cmdlines() -{ - local lvm_cmdlines="" - - generate_lvm_cmdline() { - local majmin=$1 dev - - [ -d "/sys/dev/block/$majmin/dm" ] || return 0 - dev=/dev/mapper/$(< "/sys/dev/block/$majmin/dm/name") - - vg=$(lvm lvs --rows $dev -o vg_name --separator=* 2>/dev/null | cut -d "*" -f 2) - lv=$(lvm lvs --rows $dev -o lv_name --separator=* 2>/dev/null | cut -d "*" -f 2) - if [ -n "$vg" -a -n "$lv" ]; then - lvm_cmdlines="rd.lvm.lv=$vg/$lv $lvm_cmdlines" - fi - - return 0 - } - - for_each_block_target_all generate_lvm_cmdline - - echo "$lvm_cmdlines" -} - -# $1: function name -for_each_block_target_all() -{ - local dev majmin - - for dev in $(get_kdump_targets); do - [ -b "$dev" ] || continue - majmin=$(get_maj_min $dev) - check_block_and_slaves_all $1 $majmin - done - - return 0 -} - # This function performs a series of edits on the command line. # Store the final result in global $KDUMP_COMMANDLINE. prepare_cmdline() @@ -233,19 +194,15 @@ prepare_cmdline()
# Always remove "root=X", as we now explicitly generate all kinds # of dump target mount information including root fs. But we can - # not remove it in case of "default dump_to_rootfs". + # not remove it in case of fadump or "default dump_to_rootfs". # # We do this before KDUMP_COMMANDLINE_APPEND, if one really cares # about it(e.g. for debug purpose), then can pass "root=X" using # KDUMP_COMMANDLINE_APPEND. - if ! is_dump_to_rootfs; then + if [ $DEFAULT_DUMP_MODE != "fadump" ] && ! is_dump_to_rootfs; then cmdline=`remove_cmdline_param "$cmdline" root` fi
- # Remove all the inherited rd.lvm.lv=X and generate those as needed. - cmdline=`remove_cmdline_param "$cmdline" rd.lvm.lv` - cmdline="${cmdline} $(generate_lvm_cmdlines)" - cmdline="${cmdline} ${KDUMP_COMMANDLINE_APPEND}"
id=`get_bootcpu_apicid`
Make is_fadump_capable() a library function, as we will need it in mkdumprd.
Signed-off-by: Xunlei Pang xlpang@redhat.com --- kdump-lib.sh | 12 ++++++++++++ kdumpctl | 12 ------------ 2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/kdump-lib.sh b/kdump-lib.sh index a33f172..19d749f 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -6,6 +6,18 @@ DEFAULT_PATH="/var/crash/" FENCE_KDUMP_CONFIG_FILE="/etc/sysconfig/fence_kdump" FENCE_KDUMP_SEND="/usr/libexec/fence_kdump_send" +FADUMP_ENABLED_SYS_NODE="/sys/kernel/fadump_enabled" + +is_fadump_capable() +{ + # Check if firmware-assisted dump is enabled + # if no, fallback to kdump check + if [ -f $FADUMP_ENABLED_SYS_NODE ]; then + rc=`cat $FADUMP_ENABLED_SYS_NODE` + [ $rc -eq 1 ] && return 0 + fi + return 1 +}
perror_exit() { echo $@ >&2 diff --git a/kdumpctl b/kdumpctl index 9c7e8dc..4c11bc9 100755 --- a/kdumpctl +++ b/kdumpctl @@ -13,7 +13,6 @@ DUMP_TARGET="" DEFAULT_INITRD="" DEFAULT_INITRD_BAK="" TARGET_INITRD="" -FADUMP_ENABLED_SYS_NODE="/sys/kernel/fadump_enabled" FADUMP_REGISTER_SYS_NODE="/sys/kernel/fadump_registered" #kdump shall be the default dump mode DEFAULT_DUMP_MODE="kdump" @@ -900,17 +899,6 @@ handle_mode_switch() fi }
-is_fadump_capable() -{ - # Check if firmware-assisted dump is enabled - # if no, fallback to kdump check - if [ -f $FADUMP_ENABLED_SYS_NODE ]; then - rc=`cat $FADUMP_ENABLED_SYS_NODE` - [ $rc -eq 1 ] && return 0 - fi - return 1 -} - check_current_fadump_status() { # Check if firmware-assisted dump has been registered.
Currently, we kept "root=X" for the dump_to_rootfs case, this patch consolidates to use "--mount" for all the kdump mounts.
One advantage of this way is that dracut can correctly mark root (in case of dump_to_rootfs is specified) as the host device when "--no-hostonly-default-device" is added in the following patch.
Changed the code style in passing, as shellcheck tool reported: Use $(..) instead of deprecated `..`
Signed-off-by: Xunlei Pang xlpang@redhat.com --- kdumpctl | 17 +++++++---------- mkdumprd | 6 ++++++ 2 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/kdumpctl b/kdumpctl index 4c11bc9..114a09d 100755 --- a/kdumpctl +++ b/kdumpctl @@ -181,32 +181,29 @@ prepare_cmdline() local cmdline id
if [ -z "$KDUMP_COMMANDLINE" ]; then - cmdline=`cat /proc/cmdline` + cmdline=$(cat /proc/cmdline) else cmdline=${KDUMP_COMMANDLINE} fi
# These params should always be removed - cmdline=`remove_cmdline_param "$cmdline" crashkernel panic_on_warn` + cmdline=$(remove_cmdline_param "$cmdline" crashkernel panic_on_warn) # These params can be removed configurably - cmdline=`remove_cmdline_param "$cmdline" ${KDUMP_COMMANDLINE_REMOVE}` + cmdline=$(remove_cmdline_param "$cmdline" ${KDUMP_COMMANDLINE_REMOVE})
# Always remove "root=X", as we now explicitly generate all kinds - # of dump target mount information including root fs. But we can - # not remove it in case of fadump or "default dump_to_rootfs". + # of dump target mount information including root fs. # # We do this before KDUMP_COMMANDLINE_APPEND, if one really cares # about it(e.g. for debug purpose), then can pass "root=X" using # KDUMP_COMMANDLINE_APPEND. - if [ $DEFAULT_DUMP_MODE != "fadump" ] && ! is_dump_to_rootfs; then - cmdline=`remove_cmdline_param "$cmdline" root` - fi + cmdline=$(remove_cmdline_param "$cmdline" root)
cmdline="${cmdline} ${KDUMP_COMMANDLINE_APPEND}"
- id=`get_bootcpu_apicid` + id=$(get_bootcpu_apicid) if [ ! -z ${id} ] ; then - cmdline=`append_cmdline "${cmdline}" disable_cpu_apicid ${id}` + cmdline=$(append_cmdline "${cmdline}" disable_cpu_apicid ${id}) fi
KDUMP_COMMANDLINE=$cmdline diff --git a/mkdumprd b/mkdumprd index 9f375e0..5342dac 100644 --- a/mkdumprd +++ b/mkdumprd @@ -448,6 +448,12 @@ then add_dracut_arg "--add-drivers" "$extra_modules" fi
+if ! is_fadump_capable; then + # The 2nd rootfs mount stays behind the normal dump target mount, + # so it doesn't affect the logic of check_dump_fs_modified(). + is_dump_to_rootfs && add_mount "$(to_dev_name $(get_root_fs_device))" +fi + dracut "${dracut_args[@]}" "$@" _rc=$? sync
Dracut has "--hostonly-cmdline" which can generate cmdlines(if any) regarding the dump target, it's an existing way for us to use to simplify the code. E.g. We already removed generate_lvm_cmdlines(), to use "--hostonly-cmdline".
But "--hostonly-cmdline" has other issues(e.g. BZ1451717), it adds needless devices for kdump like root device.
Now dracut supports "--no-hostonly-default-device" which enables us to only add the kdump target, which can avoid needless devices being recognized under kdump. Thus "--hostonly-cmdline" side effects can be avoided with the help of "--no-hostonly-default-device".
This patch applies dracut's "--hostonly-cmdline" together with "--no-hostonly-default-device" to achieve above-mentioned purpose.
Signed-off-by: Xunlei Pang xlpang@redhat.com --- Note that "--no-hostonly-default-device" feature was merged in "dracut-046-7.git20170824.fc28".
kdump-lib.sh | 8 -------- kexec-tools.spec | 2 +- mkdumprd | 4 +++- 3 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/kdump-lib.sh b/kdump-lib.sh index 19d749f..d981c4f 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -186,14 +186,6 @@ get_kdump_targets() kdump_targets="$kdump_targets $_root" fi
- # NOTE: - # dracut parses devices from "/etc/fstab" with the "x-initrd.mount" option, - # which will be added as host_devs, it also includes usually simple devices - # (say mounted to /boot, /boot/efi/, etc) plus the root device. Then kdump - # must wait for these devices if initramfs is built with "--hostonly-cmdline". - # - # We don't pass "--hostonly-cmdline" to dracut, so there's no problem. - echo "$kdump_targets" }
diff --git a/kexec-tools.spec b/kexec-tools.spec index 1a37ef9..f356e32 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -47,7 +47,7 @@ Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units Requires(pre): coreutils sed zlib -Requires: dracut >= 044-117 +Requires: dracut >= 046-7 Requires: dracut-network >= 044-117 Requires: ethtool BuildRequires: zlib-devel zlib zlib-static elfutils-devel-static glib2-devel bzip2-devel ncurses-devel bison flex lzo-devel snappy-devel diff --git a/mkdumprd b/mkdumprd index 5342dac..6df144b 100644 --- a/mkdumprd +++ b/mkdumprd @@ -37,7 +37,7 @@ is_wdt_addition_needed [[ $? -eq 0 ]] && WDTCFG="-a watchdog"
extra_modules="" -dracut_args=("--hostonly" "--hostonly-i18n" "-o" "plymouth dash resume ifcfg" $WDTCFG) +dracut_args=("--hostonly" "--hostonly-cmdline" "--hostonly-i18n" "-o" "plymouth dash resume ifcfg" $WDTCFG) OVERRIDE_RESETTABLE=0
add_dracut_arg() { @@ -452,6 +452,8 @@ if ! is_fadump_capable; then # The 2nd rootfs mount stays behind the normal dump target mount, # so it doesn't affect the logic of check_dump_fs_modified(). is_dump_to_rootfs && add_mount "$(to_dev_name $(get_root_fs_device))" + + add_dracut_arg "--no-hostonly-default-device" fi
dracut "${dracut_args[@]}" "$@"
Now with the help of "--hostonly-cmdline", dracut will generate the needed cmdlines for the dump target, so we can avoid the corresponding duplicate or unnecessary inheritage.
Signed-off-by: Xunlei Pang xlpang@redhat.com --- kdumpctl | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/kdumpctl b/kdumpctl index 114a09d..0d70adc 100755 --- a/kdumpctl +++ b/kdumpctl @@ -199,6 +199,9 @@ prepare_cmdline() # KDUMP_COMMANDLINE_APPEND. cmdline=$(remove_cmdline_param "$cmdline" root)
+ # With the help of "--hostonly-cmdline", we can avoid some interitage. + cmdline=$(remove_cmdline_param "$cmdline" rd.lvm.lv rd.luks.uuid rd.dm.uuid rd.md.uuid fcoe) + cmdline="${cmdline} ${KDUMP_COMMANDLINE_APPEND}"
id=$(get_bootcpu_apicid)
After adding "--hostonly-cmdline", besides 99kdump, 95iscsi also generates iscsi related cmdline. IOW, we have duplicate software iscsi cmdlines.
Considering we need to setup special "kdump-eth*"(moreover, 95iscsi generated software iscsi cmdline doesn't work), we remove that of 95iscsi and use that of 99kdump.
Signed-off-by: Xunlei Pang xlpang@redhat.com --- dracut-module-setup.sh | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index ae13337..3eeda66 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -612,6 +612,11 @@ kdump_check_iscsi_targets () { # If our prerequisites are not met, fail anyways. type -P iscsistart >/dev/null || return 1
+ # Ugly: Remove software iscsi cmdline generated by dracut, + # and regenerate here mainly due to kdump_setup_ifname(). + grep "ip=ibft" ${initdir}/etc/cmdline.d/95iscsi.conf &>/dev/null + [ $? -ne 0 ] && rm -rf ${initdir}/etc/cmdline.d/95iscsi.conf + kdump_check_setup_iscsi() ( local _dev _dev=$1
Hi Xunlei, On 08/30/17 at 04:45pm, Xunlei Pang wrote:
After adding "--hostonly-cmdline", besides 99kdump, 95iscsi also generates iscsi related cmdline. IOW, we have duplicate software iscsi cmdlines.
Considering we need to setup special "kdump-eth*"(moreover, 95iscsi generated software iscsi cmdline doesn't work), we remove that of 95iscsi and use that of 99kdump.
kdump- prefix is another issue, it is probably one obstable for us to remove kdump specific soft iscsi code. But it is not the reason why we need remove duplicate iscsi cmdline genereated by dracut. How about remove the above paragraph for less confusion?
Signed-off-by: Xunlei Pang xlpang@redhat.com
dracut-module-setup.sh | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index ae13337..3eeda66 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -612,6 +612,11 @@ kdump_check_iscsi_targets () { # If our prerequisites are not met, fail anyways. type -P iscsistart >/dev/null || return 1
- # Ugly: Remove software iscsi cmdline generated by dracut,
- # and regenerate here mainly due to kdump_setup_ifname().
- grep "ip=ibft" ${initdir}/etc/cmdline.d/95iscsi.conf &>/dev/null
- [ $? -ne 0 ] && rm -rf ${initdir}/etc/cmdline.d/95iscsi.conf
Checked the dracut code, in dracut install_softiscsi will do nothin in case /sys/firmware/ibft, so how about do it like below?
[ ! -d /sys/firmware/ibft ] && rm -rf ${initdir}/etc/cmdline.d/95iscsi.conf
kdump_check_setup_iscsi() ( local _dev _dev=$1
-- 1.8.3.1 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org
Thanks Dave
On 09/05/17 at 04:55pm, Dave Young wrote:
Hi Xunlei, On 08/30/17 at 04:45pm, Xunlei Pang wrote:
After adding "--hostonly-cmdline", besides 99kdump, 95iscsi also generates iscsi related cmdline. IOW, we have duplicate software iscsi cmdlines.
Considering we need to setup special "kdump-eth*"(moreover, 95iscsi generated software iscsi cmdline doesn't work), we remove that of 95iscsi and use that of 99kdump.
kdump- prefix is another issue, it is probably one obstable for us to remove kdump specific soft iscsi code. But it is not the reason why we need remove duplicate iscsi cmdline genereated by dracut. How about remove the above paragraph for less confusion?
Signed-off-by: Xunlei Pang xlpang@redhat.com
dracut-module-setup.sh | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index ae13337..3eeda66 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -612,6 +612,11 @@ kdump_check_iscsi_targets () { # If our prerequisites are not met, fail anyways. type -P iscsistart >/dev/null || return 1
- # Ugly: Remove software iscsi cmdline generated by dracut,
- # and regenerate here mainly due to kdump_setup_ifname().
- grep "ip=ibft" ${initdir}/etc/cmdline.d/95iscsi.conf &>/dev/null
- [ $? -ne 0 ] && rm -rf ${initdir}/etc/cmdline.d/95iscsi.conf
Checked the dracut code, in dracut install_softiscsi will do nothin in case /sys/firmware/ibft, so how about do it like below?
[ ! -d /sys/firmware/ibft ] && rm -rf ${initdir}/etc/cmdline.d/95iscsi.conf
[ ! -d /sys/firmware/ibft ] && rm -f ${initdir}/etc/cmdline.d/95iscsi.conf
will be better..
kdump_check_setup_iscsi() ( local _dev _dev=$1
-- 1.8.3.1 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org
Thanks Dave
On 09/05/2017 at 04:55 PM, Dave Young wrote:
Hi Xunlei, On 08/30/17 at 04:45pm, Xunlei Pang wrote:
After adding "--hostonly-cmdline", besides 99kdump, 95iscsi also generates iscsi related cmdline. IOW, we have duplicate software iscsi cmdlines.
Considering we need to setup special "kdump-eth*"(moreover, 95iscsi generated software iscsi cmdline doesn't work), we remove that of 95iscsi and use that of 99kdump.
kdump- prefix is another issue, it is probably one obstable for us to remove kdump specific soft iscsi code. But it is not the reason why we need remove duplicate iscsi cmdline genereated by dracut. How about remove the above paragraph for less confusion?
ok
Signed-off-by: Xunlei Pang xlpang@redhat.com
dracut-module-setup.sh | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index ae13337..3eeda66 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -612,6 +612,11 @@ kdump_check_iscsi_targets () { # If our prerequisites are not met, fail anyways. type -P iscsistart >/dev/null || return 1
- # Ugly: Remove software iscsi cmdline generated by dracut,
- # and regenerate here mainly due to kdump_setup_ifname().
- grep "ip=ibft" ${initdir}/etc/cmdline.d/95iscsi.conf &>/dev/null
- [ $? -ne 0 ] && rm -rf ${initdir}/etc/cmdline.d/95iscsi.conf
Checked the dracut code, in dracut install_softiscsi will do nothin in case /sys/firmware/ibft, so how about do it like below?
[ ! -d /sys/firmware/ibft ] && rm -rf ${initdir}/etc/cmdline.d/95iscsi.conf
Oh, yes, the original code did have some issue, after some iscsi knowledge recall, let's focus on firmware iscsi: a) for cxgb4i(iBFT) the cmdline is: "rd.iscsi.firmware=1 ip=ibft" b) for be2iscsi(firmware behave like iBFT, but not iBFT) the cmdline is: "rd.iscsi.firmware=1", for such case there will not be "/sys/firmware/ibft". I.E. for all firmware cases, "rd.iscsi.firmware" always exists.
So I think we should change to use the following to do the correct thing: grep "rd.iscsi.firmware" ${initdir}/etc/cmdline.d/95iscsi.conf &>/dev/null [ $? -ne 0 ] && rm -f ${initdir}/etc/cmdline.d/95iscsi.conf
Regards, Xunlei
kdump_check_setup_iscsi() ( local _dev _dev=$1
-- 1.8.3.1 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org
Thanks Dave
On 09/06/17 at 09:01am, Xunlei Pang wrote:
On 09/05/2017 at 04:55 PM, Dave Young wrote:
Hi Xunlei, On 08/30/17 at 04:45pm, Xunlei Pang wrote:
After adding "--hostonly-cmdline", besides 99kdump, 95iscsi also generates iscsi related cmdline. IOW, we have duplicate software iscsi cmdlines.
Considering we need to setup special "kdump-eth*"(moreover, 95iscsi generated software iscsi cmdline doesn't work), we remove that of 95iscsi and use that of 99kdump.
kdump- prefix is another issue, it is probably one obstable for us to remove kdump specific soft iscsi code. But it is not the reason why we need remove duplicate iscsi cmdline genereated by dracut. How about remove the above paragraph for less confusion?
ok
Signed-off-by: Xunlei Pang xlpang@redhat.com
dracut-module-setup.sh | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index ae13337..3eeda66 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -612,6 +612,11 @@ kdump_check_iscsi_targets () { # If our prerequisites are not met, fail anyways. type -P iscsistart >/dev/null || return 1
- # Ugly: Remove software iscsi cmdline generated by dracut,
- # and regenerate here mainly due to kdump_setup_ifname().
- grep "ip=ibft" ${initdir}/etc/cmdline.d/95iscsi.conf &>/dev/null
- [ $? -ne 0 ] && rm -rf ${initdir}/etc/cmdline.d/95iscsi.conf
Checked the dracut code, in dracut install_softiscsi will do nothin in case /sys/firmware/ibft, so how about do it like below?
[ ! -d /sys/firmware/ibft ] && rm -rf ${initdir}/etc/cmdline.d/95iscsi.conf
Oh, yes, the original code did have some issue, after some iscsi knowledge recall, let's focus on firmware iscsi: a) for cxgb4i(iBFT) the cmdline is: "rd.iscsi.firmware=1 ip=ibft" b) for be2iscsi(firmware behave like iBFT, but not iBFT) the cmdline is: "rd.iscsi.firmware=1", for such case there will not be "/sys/firmware/ibft". I.E. for all firmware cases, "rd.iscsi.firmware" always exists.
So I think we should change to use the following to do the correct thing: grep "rd.iscsi.firmware" ${initdir}/etc/cmdline.d/95iscsi.conf &>/dev/null
Hmm, if so it sounds better to check the soft iscsi strings instead of depends on the complex ibft conditions, we can check rd.iscsi.initiator because for software iscsi setup we must add it.
How about use below condition?
grep "rd.iscsi.initiator" ${initdir}/etc/cmdline.d/95iscsi.conf &>/dev/null
[ $? -ne 0 ] && rm -f ${initdir}/etc/cmdline.d/95iscsi.conf
Regards, Xunlei
kdump_check_setup_iscsi() ( local _dev _dev=$1
-- 1.8.3.1 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org
Thanks Dave
Thanks Dave
On 09/06/17 at 12:41pm, Dave Young wrote:
On 09/06/17 at 09:01am, Xunlei Pang wrote:
On 09/05/2017 at 04:55 PM, Dave Young wrote:
Hi Xunlei, On 08/30/17 at 04:45pm, Xunlei Pang wrote:
After adding "--hostonly-cmdline", besides 99kdump, 95iscsi also generates iscsi related cmdline. IOW, we have duplicate software iscsi cmdlines.
Considering we need to setup special "kdump-eth*"(moreover, 95iscsi generated software iscsi cmdline doesn't work), we remove that of 95iscsi and use that of 99kdump.
kdump- prefix is another issue, it is probably one obstable for us to remove kdump specific soft iscsi code. But it is not the reason why we need remove duplicate iscsi cmdline genereated by dracut. How about remove the above paragraph for less confusion?
ok
Signed-off-by: Xunlei Pang xlpang@redhat.com
dracut-module-setup.sh | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index ae13337..3eeda66 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -612,6 +612,11 @@ kdump_check_iscsi_targets () { # If our prerequisites are not met, fail anyways. type -P iscsistart >/dev/null || return 1
- # Ugly: Remove software iscsi cmdline generated by dracut,
- # and regenerate here mainly due to kdump_setup_ifname().
- grep "ip=ibft" ${initdir}/etc/cmdline.d/95iscsi.conf &>/dev/null
- [ $? -ne 0 ] && rm -rf ${initdir}/etc/cmdline.d/95iscsi.conf
Checked the dracut code, in dracut install_softiscsi will do nothin in case /sys/firmware/ibft, so how about do it like below?
[ ! -d /sys/firmware/ibft ] && rm -rf ${initdir}/etc/cmdline.d/95iscsi.conf
Oh, yes, the original code did have some issue, after some iscsi knowledge recall, let's focus on firmware iscsi: a) for cxgb4i(iBFT) the cmdline is: "rd.iscsi.firmware=1 ip=ibft" b) for be2iscsi(firmware behave like iBFT, but not iBFT) the cmdline is: "rd.iscsi.firmware=1", for such case there will not be "/sys/firmware/ibft". I.E. for all firmware cases, "rd.iscsi.firmware" always exists.
So I think we should change to use the following to do the correct thing: grep "rd.iscsi.firmware" ${initdir}/etc/cmdline.d/95iscsi.conf &>/dev/null
Hmm, if so it sounds better to check the soft iscsi strings instead of depends on the complex ibft conditions, we can check rd.iscsi.initiator because for software iscsi setup we must add it.
How about use below condition?
grep "rd.iscsi.initiator" ${initdir}/etc/cmdline.d/95iscsi.conf &>/dev/null
Since dracut possibly add soft iscsi and rd.iscsi.firmware at same time, maybe add above condition should in below place kdump_setup_iscsi_device() { if is_ibft ${path}; then return fi
grep "rd.iscsi.initiator" ${initdir}/etc/cmdline.d/95iscsi.conf &>/dev/null [ $? -ne 0 ] && rm -f ${initdir}/etc/cmdline.d/95iscsi.conf
[ $? -ne 0 ] && rm -f ${initdir}/etc/cmdline.d/95iscsi.conf
Regards, Xunlei
kdump_check_setup_iscsi() ( local _dev _dev=$1
-- 1.8.3.1 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org
Thanks Dave
Thanks Dave
On 09/06/2017 at 12:52 PM, Dave Young wrote:
On 09/06/17 at 12:41pm, Dave Young wrote:
On 09/06/17 at 09:01am, Xunlei Pang wrote:
On 09/05/2017 at 04:55 PM, Dave Young wrote:
Hi Xunlei, On 08/30/17 at 04:45pm, Xunlei Pang wrote:
After adding "--hostonly-cmdline", besides 99kdump, 95iscsi also generates iscsi related cmdline. IOW, we have duplicate software iscsi cmdlines.
Considering we need to setup special "kdump-eth*"(moreover, 95iscsi generated software iscsi cmdline doesn't work), we remove that of 95iscsi and use that of 99kdump.
kdump- prefix is another issue, it is probably one obstable for us to remove kdump specific soft iscsi code. But it is not the reason why we need remove duplicate iscsi cmdline genereated by dracut. How about remove the above paragraph for less confusion?
ok
Signed-off-by: Xunlei Pang xlpang@redhat.com
dracut-module-setup.sh | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index ae13337..3eeda66 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -612,6 +612,11 @@ kdump_check_iscsi_targets () { # If our prerequisites are not met, fail anyways. type -P iscsistart >/dev/null || return 1
- # Ugly: Remove software iscsi cmdline generated by dracut,
- # and regenerate here mainly due to kdump_setup_ifname().
- grep "ip=ibft" ${initdir}/etc/cmdline.d/95iscsi.conf &>/dev/null
- [ $? -ne 0 ] && rm -rf ${initdir}/etc/cmdline.d/95iscsi.conf
Checked the dracut code, in dracut install_softiscsi will do nothin in case /sys/firmware/ibft, so how about do it like below?
[ ! -d /sys/firmware/ibft ] && rm -rf ${initdir}/etc/cmdline.d/95iscsi.conf
Oh, yes, the original code did have some issue, after some iscsi knowledge recall, let's focus on firmware iscsi: a) for cxgb4i(iBFT) the cmdline is: "rd.iscsi.firmware=1 ip=ibft" b) for be2iscsi(firmware behave like iBFT, but not iBFT) the cmdline is: "rd.iscsi.firmware=1", for such case there will not be "/sys/firmware/ibft". I.E. for all firmware cases, "rd.iscsi.firmware" always exists.
So I think we should change to use the following to do the correct thing: grep "rd.iscsi.firmware" ${initdir}/etc/cmdline.d/95iscsi.conf &>/dev/null
Hmm, if so it sounds better to check the soft iscsi strings instead of depends on the complex ibft conditions, we can check rd.iscsi.initiator because for software iscsi setup we must add it.
How about use below condition?
grep "rd.iscsi.initiator" ${initdir}/etc/cmdline.d/95iscsi.conf &>/dev/null
Since dracut possibly add soft iscsi and rd.iscsi.firmware at same time, maybe add
It won't, see 95iscsi, it's if else condition: cmdline() { local _iscsiconf=$(install_ibft) { if [ "$_iscsiconf" ] ; then echo ${_iscsiconf} else install_softiscsi fi } | sort | uniq }
above condition should in below place kdump_setup_iscsi_device() { if is_ibft ${path}; then return fi
grep "rd.iscsi.initiator" ${initdir}/etc/cmdline.d/95iscsi.conf &>/dev/null [ $? -ne 0 ] && rm -f ${initdir}/etc/cmdline.d/95iscsi.conf
Agree, it's a better place, actually I think we can simply add one line below:
rm -f ${initdir}/etc/cmdline.d/95iscsi.conf
because for firmware(is_ibft) cases, it will return.
Regards, Xunlei
[ $? -ne 0 ] && rm -f ${initdir}/etc/cmdline.d/95iscsi.conf
Regards, Xunlei
kdump_check_setup_iscsi() ( local _dev _dev=$1
-- 1.8.3.1 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org
Thanks Dave
Thanks Dave
On 09/06/17 at 01:44pm, Xunlei Pang wrote:
On 09/06/2017 at 12:52 PM, Dave Young wrote:
On 09/06/17 at 12:41pm, Dave Young wrote:
On 09/06/17 at 09:01am, Xunlei Pang wrote:
On 09/05/2017 at 04:55 PM, Dave Young wrote:
Hi Xunlei, On 08/30/17 at 04:45pm, Xunlei Pang wrote:
After adding "--hostonly-cmdline", besides 99kdump, 95iscsi also generates iscsi related cmdline. IOW, we have duplicate software iscsi cmdlines.
Considering we need to setup special "kdump-eth*"(moreover, 95iscsi generated software iscsi cmdline doesn't work), we remove that of 95iscsi and use that of 99kdump.
kdump- prefix is another issue, it is probably one obstable for us to remove kdump specific soft iscsi code. But it is not the reason why we need remove duplicate iscsi cmdline genereated by dracut. How about remove the above paragraph for less confusion?
ok
Signed-off-by: Xunlei Pang xlpang@redhat.com
dracut-module-setup.sh | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index ae13337..3eeda66 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -612,6 +612,11 @@ kdump_check_iscsi_targets () { # If our prerequisites are not met, fail anyways. type -P iscsistart >/dev/null || return 1
- # Ugly: Remove software iscsi cmdline generated by dracut,
- # and regenerate here mainly due to kdump_setup_ifname().
- grep "ip=ibft" ${initdir}/etc/cmdline.d/95iscsi.conf &>/dev/null
- [ $? -ne 0 ] && rm -rf ${initdir}/etc/cmdline.d/95iscsi.conf
Checked the dracut code, in dracut install_softiscsi will do nothin in case /sys/firmware/ibft, so how about do it like below?
[ ! -d /sys/firmware/ibft ] && rm -rf ${initdir}/etc/cmdline.d/95iscsi.conf
Oh, yes, the original code did have some issue, after some iscsi knowledge recall, let's focus on firmware iscsi: a) for cxgb4i(iBFT) the cmdline is: "rd.iscsi.firmware=1 ip=ibft" b) for be2iscsi(firmware behave like iBFT, but not iBFT) the cmdline is: "rd.iscsi.firmware=1", for such case there will not be "/sys/firmware/ibft". I.E. for all firmware cases, "rd.iscsi.firmware" always exists.
So I think we should change to use the following to do the correct thing: grep "rd.iscsi.firmware" ${initdir}/etc/cmdline.d/95iscsi.conf &>/dev/null
Hmm, if so it sounds better to check the soft iscsi strings instead of depends on the complex ibft conditions, we can check rd.iscsi.initiator because for software iscsi setup we must add it.
How about use below condition?
grep "rd.iscsi.initiator" ${initdir}/etc/cmdline.d/95iscsi.conf &>/dev/null
Since dracut possibly add soft iscsi and rd.iscsi.firmware at same time, maybe add
It won't, see 95iscsi, it's if else condition: cmdline() { local _iscsiconf=$(install_ibft) { if [ "$_iscsiconf" ] ; then echo ${_iscsiconf} else install_softiscsi fi } | sort | uniq }
above condition should in below place kdump_setup_iscsi_device() { if is_ibft ${path}; then return fi
grep "rd.iscsi.initiator" ${initdir}/etc/cmdline.d/95iscsi.conf &>/dev/null [ $? -ne 0 ] && rm -f ${initdir}/etc/cmdline.d/95iscsi.conf
Agree, it's a better place, actually I think we can simply add one line below:
rm -f ${initdir}/etc/cmdline.d/95iscsi.conf
because for firmware(is_ibft) cases, it will return.
Ok, good catch, let's go this way before we dropping our own softiscsi code..
Just update this patch should be enough.
Regards, Xunlei
[ $? -ne 0 ] && rm -f ${initdir}/etc/cmdline.d/95iscsi.conf
Regards, Xunlei
kdump_check_setup_iscsi() ( local _dev _dev=$1
-- 1.8.3.1 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org
Thanks Dave
Thanks Dave
Thanks Dave
On 09/06/2017 at 02:01 PM, Dave Young wrote:
On 09/06/17 at 01:44pm, Xunlei Pang wrote:
On 09/06/2017 at 12:52 PM, Dave Young wrote:
On 09/06/17 at 12:41pm, Dave Young wrote:
On 09/06/17 at 09:01am, Xunlei Pang wrote:
On 09/05/2017 at 04:55 PM, Dave Young wrote:
Hi Xunlei, On 08/30/17 at 04:45pm, Xunlei Pang wrote: > After adding "--hostonly-cmdline", besides 99kdump, 95iscsi > also generates iscsi related cmdline. IOW, we have duplicate > software iscsi cmdlines. > > Considering we need to setup special "kdump-eth*"(moreover, > 95iscsi generated software iscsi cmdline doesn't work), we > remove that of 95iscsi and use that of 99kdump. kdump- prefix is another issue, it is probably one obstable for us to remove kdump specific soft iscsi code. But it is not the reason why we need remove duplicate iscsi cmdline genereated by dracut. How about remove the above paragraph for less confusion?
ok
> Signed-off-by: Xunlei Pang xlpang@redhat.com > --- > dracut-module-setup.sh | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh > index ae13337..3eeda66 100755 > --- a/dracut-module-setup.sh > +++ b/dracut-module-setup.sh > @@ -612,6 +612,11 @@ kdump_check_iscsi_targets () { > # If our prerequisites are not met, fail anyways. > type -P iscsistart >/dev/null || return 1 > > + # Ugly: Remove software iscsi cmdline generated by dracut, > + # and regenerate here mainly due to kdump_setup_ifname(). > + grep "ip=ibft" ${initdir}/etc/cmdline.d/95iscsi.conf &>/dev/null > + [ $? -ne 0 ] && rm -rf ${initdir}/etc/cmdline.d/95iscsi.conf > + Checked the dracut code, in dracut install_softiscsi will do nothin in case /sys/firmware/ibft, so how about do it like below?
[ ! -d /sys/firmware/ibft ] && rm -rf ${initdir}/etc/cmdline.d/95iscsi.conf
Oh, yes, the original code did have some issue, after some iscsi knowledge recall, let's focus on firmware iscsi: a) for cxgb4i(iBFT) the cmdline is: "rd.iscsi.firmware=1 ip=ibft" b) for be2iscsi(firmware behave like iBFT, but not iBFT) the cmdline is: "rd.iscsi.firmware=1", for such case there will not be "/sys/firmware/ibft". I.E. for all firmware cases, "rd.iscsi.firmware" always exists.
So I think we should change to use the following to do the correct thing: grep "rd.iscsi.firmware" ${initdir}/etc/cmdline.d/95iscsi.conf &>/dev/null
Hmm, if so it sounds better to check the soft iscsi strings instead of depends on the complex ibft conditions, we can check rd.iscsi.initiator because for software iscsi setup we must add it.
How about use below condition?
grep "rd.iscsi.initiator" ${initdir}/etc/cmdline.d/95iscsi.conf &>/dev/null
Since dracut possibly add soft iscsi and rd.iscsi.firmware at same time, maybe add
It won't, see 95iscsi, it's if else condition: cmdline() { local _iscsiconf=$(install_ibft) { if [ "$_iscsiconf" ] ; then echo ${_iscsiconf} else install_softiscsi fi } | sort | uniq }
above condition should in below place kdump_setup_iscsi_device() { if is_ibft ${path}; then return fi
grep "rd.iscsi.initiator" ${initdir}/etc/cmdline.d/95iscsi.conf &>/dev/null [ $? -ne 0 ] && rm -f ${initdir}/etc/cmdline.d/95iscsi.conf
Agree, it's a better place, actually I think we can simply add one line below:
rm -f ${initdir}/etc/cmdline.d/95iscsi.conf
because for firmware(is_ibft) cases, it will return.
Ok, good catch, let's go this way before we dropping our own softiscsi code..
Just update this patch should be enough.
Ok, sent v3, thanks for your review!
Regards, Xunlei