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
This commit is contained in:
parent
58fc460f50
commit
62630aa7dd
95
kdump-use-bus-id-to-identify-qeth-devices.patch
Normal file
95
kdump-use-bus-id-to-identify-qeth-devices.patch
Normal file
@ -0,0 +1,95 @@
|
||||
From: Petr Tesarik <ptesarik@suse.com>
|
||||
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 <ptesarik@suse.com>
|
||||
---
|
||||
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=$(</sys/class/net/$_iface/device/layer2)
|
||||
local _portno=$(</sys/class/net/$_iface/device/portno)
|
||||
+ local _type=$(</sys/class/net/$_iface/type)
|
||||
+ local _dev_id _dev_id_match
|
||||
+ if [ "$_layer2" -ne 0 ]
|
||||
+ then
|
||||
+ _dev_id=""$(</sys/class/net/$_iface/dev_id)
|
||||
+ _dev_id_match=", ATTR{dev_id}==\"$_dev_id\""
|
||||
+ fi
|
||||
|
||||
cat >"${_root}/etc/udev/rules.d/51-qeth-${_dev}.rules" <<EOF
|
||||
ACTION=="add", SUBSYSTEM=="drivers", KERNEL=="qeth", IMPORT{program}="collect $_dev %k $_cdev0 $_cdev1 $_cdev2 qeth"
|
||||
@@ -1081,6 +1106,10 @@ ACTION=="add", SUBSYSTEM=="ccwgroup", KE
|
||||
ACTION=="add", SUBSYSTEM=="ccwgroup", KERNEL=="$_dev", ATTR{layer2}="$_layer2"
|
||||
ACTION=="add", SUBSYSTEM=="ccwgroup", KERNEL=="$_dev", ATTR{online}="1"
|
||||
EOF
|
||||
+
|
||||
+ cat >"${_root}/etc/udev/rules.d/70-persistent-net-${_iface}.rules" <<EOF
|
||||
+SUBSYSTEM=="net", ACTION=="add", DRIVERS=="qeth"$_dev_id_match, KERNELS=="$_dev", ATTR{type}=="$_type", NAME="$_iface"
|
||||
+EOF
|
||||
} # }}}
|
||||
|
||||
#
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Apr 6 12:49:54 UTC 2018 - ptesarik@suse.com
|
||||
|
||||
- kdump-use-bus-id-to-identify-qeth-devices.patch: Use bus id to
|
||||
identify qeth devices (bsc#1085617).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Mar 13 15:48:28 UTC 2018 - ptesarik@suse.com
|
||||
|
||||
|
@ -91,6 +91,7 @@ Patch41: %{name}-always-kexec_load-if-kexec_file_load-fails.patch
|
||||
Patch42: %{name}-nokaslr.patch
|
||||
Patch43: %{name}-no-crashkernel-in-Xen-PV-DomU.patch
|
||||
Patch44: %{name}-always-copy-timezone.patch
|
||||
Patch45: %{name}-use-bus-id-to-identify-qeth-devices.patch
|
||||
BuildRequires: asciidoc
|
||||
BuildRequires: cmake
|
||||
BuildRequires: gcc-c++
|
||||
@ -197,6 +198,7 @@ cp %{S:1} tests/data/
|
||||
%patch42 -p1
|
||||
%patch43 -p1
|
||||
%patch44 -p1
|
||||
%patch45 -p1
|
||||
|
||||
%build
|
||||
export CFLAGS="%{optflags}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user