On s390x RHEL9, vmcore can't be dumped to a nfs target for the following reasons, 1. ifcfg is retired and we can't get znet config info from /etc/sysconfig/network-scripts any more. 2. ipcalc is not installed by default, thus static route info can't be generated correctly. 3. rpc-statd.service can't be started because of a bug in dracut
These two patches address the first two issues and the third issue has been addressed by Kairui [1].
[1] https://github.com/dracutdevs/dracut/pull/1063
Changes since v1: - use regex to extract value from nmcli output and avoid using array to simplify code [Kairui] - take care of the case that nmcli could output "802-3-ethernet.s390-nettype: --"
Coiby Xu (2): read znet config from nmcli directly add dependency on ipcalc
dracut-module-setup.sh | 41 +++++++++++++++++++++++++++++++++++++---- kexec-tools.spec | 1 + 2 files changed, 38 insertions(+), 4 deletions(-)
From: Coiby Xu coiby.xu@gmail.com
Since Fedora 34, ifcfg has been deprecated. Read znet config from nmcli directly,
$ nmcli c show enc8000 connection.id: enc8000 connection.uuid: 02fbf6c2-b5bf-4ced-8a41-99a46ade828c connection.stable-id: -- connection.type: 802-3-ethernet connection.interface-name: enc8000 ... 802-3-ethernet.s390-subchannels: 0.0.8000,0.0.8001,0.0.8002 802-3-ethernet.s390-nettype: qeth 802-3-ethernet.s390-options: layer2=1,portname=z-104,portno=0
Reported-by: Jie Li jieli@redhat.com Signed-off-by: Coiby Xu coxu@redhat.com --- dracut-module-setup.sh | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 21143b4..390cb6d 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -317,17 +317,50 @@ kdump_setup_vlan() { fi }
+# parse s390 znet config from nmcli output +# $1: netdev name +# $2: option name +parse_znet_from_nmcli() { + # nmlci connection show $netdev has the following output if + # 1. there is active znet netdev + # 802-3-ethernet.s390-subchannels: 0.0.8000,0.0.8001,0.0.8002 + # 802-3-ethernet.s390-nettype: qeth + # 802-3-ethernet.s390-options: layer2=1,portname=z-104,portno=0 + # 2. or "--" to indicate no related znet options on Fedora or RHEL + # 802-3-ethernet.s390-subchannels: -- + # 802-3-ethernet.s390-nettype: -- + # 802-3-ethernet.s390-options: -- + # 3. no "s390-*" related lines + local _netdev=$1 + local _field=$2 + local val=$(nmcli conn show $_netdev | grep s390-$_field | sed "s/.*:\s*//g") + + if [ "$val" = "--" ]; then + val="" + fi + echo $val +} + # setup s390 znet cmdline # $1: netdev name kdump_setup_znet() { local _options="" local _netdev=$1
- source_ifcfg_file $_netdev + # 1. first read from nmcli output directly + NETTYPE=$(parse_znet_from_nmcli $_netdev nettype) + SUBCHANNELS=$(parse_znet_from_nmcli $_netdev subchannels ) + options=$(parse_znet_from_nmcli $_netdev options) + + # 2. if failed to get SUBCHANNELS, read from ifcfg_file + if [[ -z "$SUBCHANNELS" ]]; then + source_ifcfg_file $_netdev + + for i in $OPTIONS; do + _options=${_options},$i + done + fi
- for i in $OPTIONS; do - _options=${_options},$i - done echo rd.znet=${NETTYPE},${SUBCHANNELS}${_options} rd.znet_ifname=$_netdev:${SUBCHANNELS} > ${initdir}/etc/cmdline.d/30znet.conf }
On Mon, Feb 22, 2021 at 2:42 PM Coiby Xu coxu@redhat.com wrote:
From: Coiby Xu coiby.xu@gmail.com
Since Fedora 34, ifcfg has been deprecated. Read znet config from nmcli directly,
$ nmcli c show enc8000 connection.id: enc8000 connection.uuid: 02fbf6c2-b5bf-4ced-8a41-99a46ade828c connection.stable-id: -- connection.type: 802-3-ethernet connection.interface-name: enc8000 ... 802-3-ethernet.s390-subchannels: 0.0.8000,0.0.8001,0.0.8002 802-3-ethernet.s390-nettype: qeth 802-3-ethernet.s390-options: layer2=1,portname=z-104,portno=0
Reported-by: Jie Li jieli@redhat.com Signed-off-by: Coiby Xu coxu@redhat.com
dracut-module-setup.sh | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 21143b4..390cb6d 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -317,17 +317,50 @@ kdump_setup_vlan() { fi }
+# parse s390 znet config from nmcli output +# $1: netdev name +# $2: option name +parse_znet_from_nmcli() {
- # nmlci connection show $netdev has the following output if
- # 1. there is active znet netdev
- # 802-3-ethernet.s390-subchannels: 0.0.8000,0.0.8001,0.0.8002
- # 802-3-ethernet.s390-nettype: qeth
- # 802-3-ethernet.s390-options: layer2=1,portname=z-104,portno=0
- # 2. or "--" to indicate no related znet options on Fedora or RHEL
- # 802-3-ethernet.s390-subchannels: --
- # 802-3-ethernet.s390-nettype: --
- # 802-3-ethernet.s390-options: --
- # 3. no "s390-*" related lines
- local _netdev=$1
- local _field=$2
- local val=$(nmcli conn show $_netdev | grep s390-$_field | sed "s/.*:\s*//g")
- if [ "$val" = "--" ]; then
val=""
- fi
- echo $val
+}
# setup s390 znet cmdline # $1: netdev name kdump_setup_znet() { local _options="" local _netdev=$1
- source_ifcfg_file $_netdev
- # 1. first read from nmcli output directly
- NETTYPE=$(parse_znet_from_nmcli $_netdev nettype)
- SUBCHANNELS=$(parse_znet_from_nmcli $_netdev subchannels )
- options=$(parse_znet_from_nmcli $_netdev options)
- # 2. if failed to get SUBCHANNELS, read from ifcfg_file
- if [[ -z "$SUBCHANNELS" ]]; then
source_ifcfg_file $_netdev
for i in $OPTIONS; do
_options=${_options},$i
done
- fi
- for i in $OPTIONS; do
_options=${_options},$i
- done echo rd.znet=${NETTYPE},${SUBCHANNELS}${_options} rd.znet_ifname=$_netdev:${SUBCHANNELS} > ${initdir}/etc/cmdline.d/30znet.conf
}
-- 2.30.1
Looks good. Acked-by: Kairui Song kasong@redhat.com
-- Best Regards, Kairui Song
On Thu, Mar 11, 2021 at 01:43:31PM +0800, Kairui Song wrote:
On Mon, Feb 22, 2021 at 2:42 PM Coiby Xu coxu@redhat.com wrote:
From: Coiby Xu coiby.xu@gmail.com
Since Fedora 34, ifcfg has been deprecated. Read znet config from nmcli directly,
[...]
Looks good. Acked-by: Kairui Song kasong@redhat.com
Thanks for reviewing the patch! I'm going to submit a patch set to completely remove dependence on ifcfg scripts. So there is no need to apply this patch.
-- Best Regards, Kairui Song
On Mon, Feb 22, 2021 at 02:41:37PM +0800, Coiby Xu wrote:
From: Coiby Xu coiby.xu@gmail.com
Since Fedora 34, ifcfg has been deprecated. Read znet config from nmcli directly,
$ nmcli c show enc8000 connection.id: enc8000 connection.uuid: 02fbf6c2-b5bf-4ced-8a41-99a46ade828c connection.stable-id: -- connection.type: 802-3-ethernet connection.interface-name: enc8000 ... 802-3-ethernet.s390-subchannels: 0.0.8000,0.0.8001,0.0.8002 802-3-ethernet.s390-nettype: qeth 802-3-ethernet.s390-options: layer2=1,portname=z-104,portno=0
Reported-by: Jie Li jieli@redhat.com Signed-off-by: Coiby Xu coxu@redhat.com
dracut-module-setup.sh | 41 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 21143b4..390cb6d 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -317,17 +317,50 @@ kdump_setup_vlan() { fi }
+# parse s390 znet config from nmcli output +# $1: netdev name +# $2: option name +parse_znet_from_nmcli() {
- # nmlci connection show $netdev has the following output if
- # 1. there is active znet netdev
- # 802-3-ethernet.s390-subchannels: 0.0.8000,0.0.8001,0.0.8002
- # 802-3-ethernet.s390-nettype: qeth
- # 802-3-ethernet.s390-options: layer2=1,portname=z-104,portno=0
- # 2. or "--" to indicate no related znet options on Fedora or RHEL
- # 802-3-ethernet.s390-subchannels: --
- # 802-3-ethernet.s390-nettype: --
- # 802-3-ethernet.s390-options: --
- # 3. no "s390-*" related lines
- local _netdev=$1
- local _field=$2
- local val=$(nmcli conn show $_netdev | grep s390-$_field | sed "s/.*:\s*//g")
- if [ "$val" = "--" ]; then
val=""
- fi
- echo $val
+}
# setup s390 znet cmdline # $1: netdev name kdump_setup_znet() { local _options="" local _netdev=$1
- source_ifcfg_file $_netdev
- # 1. first read from nmcli output directly
- NETTYPE=$(parse_znet_from_nmcli $_netdev nettype)
- SUBCHANNELS=$(parse_znet_from_nmcli $_netdev subchannels )
- options=$(parse_znet_from_nmcli $_netdev options)
- # 2. if failed to get SUBCHANNELS, read from ifcfg_file
- if [[ -z "$SUBCHANNELS" ]]; then
source_ifcfg_file $_netdev
for i in $OPTIONS; do
_options=${_options},$i
done
- fi
- for i in $OPTIONS; do
_options=${_options},$i
- done echo rd.znet=${NETTYPE},${SUBCHANNELS}${_options} rd.znet_ifname=$_netdev:${SUBCHANNELS} > ${initdir}/etc/cmdline.d/30znet.conf
}
-- 2.30.1
I'm going to submit a new patch to replace this one.
Nacked-by: Coiby Xu coxu@redhat.com
From: Coiby Xu coiby.xu@gmail.com
ipcalc is needed for generating 45route-static.conf. However, on newer Fedora, e.g. 34, dracut-network drops dependency on dhcp-client which requires ipcalc. Make kexec-tools explicitly depends on ipcalc.
Reported-by: Jie Li jieli@redhat.com Acked-by: Kairui Song kasong@redhat.com Signed-off-by: Coiby Xu coxu@redhat.com --- kexec-tools.spec | 1 + 1 file changed, 1 insertion(+)
diff --git a/kexec-tools.spec b/kexec-tools.spec index 378058e..aded893 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -63,6 +63,7 @@ Requires: dracut >= 050 Requires: dracut-network >= 050 Recommends: dracut-squash >= 050 Requires: ethtool +Requires: ipcalc BuildRequires: make BuildRequires: zlib-devel elfutils-devel glib2-devel bzip2-devel ncurses-devel bison flex lzo-devel snappy-devel BuildRequires: pkgconfig intltool gettext
On Mon, Feb 22, 2021 at 2:42 PM Coiby Xu coxu@redhat.com wrote:
From: Coiby Xu coiby.xu@gmail.com
ipcalc is needed for generating 45route-static.conf. However, on newer Fedora, e.g. 34, dracut-network drops dependency on dhcp-client which requires ipcalc. Make kexec-tools explicitly depends on ipcalc.
Reported-by: Jie Li jieli@redhat.com Acked-by: Kairui Song kasong@redhat.com Signed-off-by: Coiby Xu coxu@redhat.com
kexec-tools.spec | 1 + 1 file changed, 1 insertion(+)
diff --git a/kexec-tools.spec b/kexec-tools.spec index 378058e..aded893 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -63,6 +63,7 @@ Requires: dracut >= 050 Requires: dracut-network >= 050 Recommends: dracut-squash >= 050 Requires: ethtool +Requires: ipcalc BuildRequires: make BuildRequires: zlib-devel elfutils-devel glib2-devel bzip2-devel ncurses-devel bison flex lzo-devel snappy-devel BuildRequires: pkgconfig intltool gettext -- 2.30.1
Hi Coiby,
This patch is already acked and merged, so you don't have to send it again.
Hi Rairui,
On Mon, Feb 22, 2021 at 03:02:14PM +0800, Kairui Song wrote:
On Mon, Feb 22, 2021 at 2:42 PM Coiby Xu coxu@redhat.com wrote:
From: Coiby Xu coiby.xu@gmail.com
ipcalc is needed for generating 45route-static.conf. However, on newer Fedora, e.g. 34, dracut-network drops dependency on dhcp-client which requires ipcalc. Make kexec-tools explicitly depends on ipcalc.
Reported-by: Jie Li jieli@redhat.com Acked-by: Kairui Song kasong@redhat.com Signed-off-by: Coiby Xu coxu@redhat.com
kexec-tools.spec | 1 + 1 file changed, 1 insertion(+)
diff --git a/kexec-tools.spec b/kexec-tools.spec index 378058e..aded893 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -63,6 +63,7 @@ Requires: dracut >= 050 Requires: dracut-network >= 050 Recommends: dracut-squash >= 050 Requires: ethtool +Requires: ipcalc BuildRequires: make BuildRequires: zlib-devel elfutils-devel glib2-devel bzip2-devel ncurses-devel bison flex lzo-devel snappy-devel BuildRequires: pkgconfig intltool gettext -- 2.30.1
Hi Coiby,
This patch is already acked and merged, so you don't have to send it again.
Thanks for the reminding! I forgot to rebase on the latest rawhide branch.
-- Best Regards, Kairui Song