From 62630aa7dd24b73e93662332459985bd1e70e82370d7909a3ac4992f8806c64d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Tesa=C5=99=C3=ADk?= Date: Fri, 6 Apr 2018 15:14:23 +0000 Subject: [PATCH] Accepting request 594027 from home:ptesarik:branches:Kernel:kdump - kdump-use-bus-id-to-identify-qeth-devices.patch: Use bus id to identify qeth devices (bsc#1085617). OBS-URL: https://build.opensuse.org/request/show/594027 OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/kdump?expand=0&rev=160 --- ...-use-bus-id-to-identify-qeth-devices.patch | 95 +++++++++++++++++++ kdump.changes | 6 ++ kdump.spec | 2 + 3 files changed, 103 insertions(+) create mode 100644 kdump-use-bus-id-to-identify-qeth-devices.patch diff --git a/kdump-use-bus-id-to-identify-qeth-devices.patch b/kdump-use-bus-id-to-identify-qeth-devices.patch new file mode 100644 index 0000000..0659ece --- /dev/null +++ b/kdump-use-bus-id-to-identify-qeth-devices.patch @@ -0,0 +1,95 @@ +From: Petr Tesarik +Date: Fri, 6 Apr 2018 14:43:06 +0200 +Subject: Use bus id to identify qeth devices +References: bsc#1085617 +Upstream: merged +Git-commit: 5c608e4d8adf57e66ce85ec62bf59887e6b860e7 + +QETH devices may not have a stable MAC address, so dracut's ifname= +parameter is not useful. The device's bus ID is stable, but there +is (currently) no support in dracut, so a custom udev rule must be +generated instead. + +Signed-off-by: Petr Tesarik +--- + init/setup-kdump.functions | 47 ++++++++++++++++++++++++++++++++++++--------- + 1 file changed, 38 insertions(+), 9 deletions(-) + +--- a/init/setup-kdump.functions ++++ b/init/setup-kdump.functions +@@ -453,6 +453,24 @@ function kdump_vlan_config() # { + # + # Parameters: + # 1) device device name ++# Output: ++# permanent hardware address ++function kdump_hwaddr() # {{{ ++{ ++ local _iface="$1" ++ local _type=$(<"/sys/class/net/$_iface/addr_assign_type") ++ if [ "$_type" -eq 0 ] ++ then ++ cat "/sys/class/net/$kdump_iface/address" ++ else ++ ethtool -P "$kdump_iface" | sed 's/^[^:]*: *//' ++ fi ++} # }}} ++ ++# Get the ifname parameter for a given device ++# ++# Parameters: ++# 1) device device name + # Output variables: + # kdump_netif corresponding ifname= initrd parameter added + # kdump_iface device name in initrd +@@ -466,16 +484,16 @@ function kdump_ifname_config() # + if [ -z "$ifkind" ] + then + kdump_hwif="$kdump_hwif $kdump_iface" ++ local _drv=$( readlink "/sys/class/net/$kdump_iface/device/driver" ) + +- local hwaddr +- local addrtype=$(<"/sys/class/net/$kdump_iface/addr_assign_type") +- if [ "$addrtype" -eq 0 ] +- then +- hwaddr=$(<"/sys/class/net/$kdump_iface/address") +- else +- hwaddr=$(ethtool -P "$kdump_iface" | sed 's/^[^:]*: *//') +- fi +- [ -n "$hwaddr" ] && kdump_netif="$kdump_netif ifname=$kdump_iface:$hwaddr" ++ case "$_drv" in ++ */qeth) ++ ;; ++ *) ++ local hwaddr=$(kdump_hwaddr "$kdump_iface") ++ [ -n "$hwaddr" ] && kdump_netif="$kdump_netif ifname=$kdump_iface:$hwaddr" ++ ;; ++ esac + else + case "$ifkind" in + bridge) +@@ -1063,6 +1081,13 @@ function kdump_setup_qeth() # {{ + _cdev2="${_cdev2##*/}" + local _layer2=$("${_root}/etc/udev/rules.d/51-qeth-${_dev}.rules" <"${_root}/etc/udev/rules.d/70-persistent-net-${_iface}.rules" <