Accepting request 594068 from Kernel:kdump
OBS-URL: https://build.opensuse.org/request/show/594068 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kdump?expand=0&rev=97
This commit is contained in:
commit
e877445198
49
kdump-pass-IPv6-address-prefix-separately.patch
Normal file
49
kdump-pass-IPv6-address-prefix-separately.patch
Normal file
@ -0,0 +1,49 @@
|
||||
From: Michal Koutny <mkoutny@suse.com>
|
||||
Date: Mon, 26 Mar 2018 20:34:19 +0200
|
||||
Subject: IPv6 setup: pass address prefix in separate dracut arg
|
||||
References: bsc#1062026
|
||||
Upstream: merged
|
||||
Git-commit: c6fb83e6ebc310c615c145962f71b3f6f4819e88
|
||||
|
||||
Dracut distinguishes IPv6 addresses by bracket enclosing [1] so pass an
|
||||
IPv6 address as such. The address prefix is passed separately through
|
||||
netmask dracut argument (that is a slight misnomer as dracut just
|
||||
propagates that value to iproute2 tools [2] which interpret it as
|
||||
decimal number of prefix bits).
|
||||
|
||||
[1] https://github.com/dracutdevs/dracut/blob/031e2f7bb8aea447cd87e455b184106acb4aa435/modules.d/40network/net-lib.sh#L441
|
||||
[2] https://github.com/dracutdevs/dracut/blob/031e2f7bb8aea447cd87e455b184106acb4aa435/modules.d/40network/ifup.sh#L130
|
||||
---
|
||||
init/setup-kdump.functions | 7 ++++---
|
||||
1 file changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/init/setup-kdump.functions
|
||||
+++ b/init/setup-kdump.functions
|
||||
@@ -586,7 +586,7 @@ function kdump_ip6_config() # {{
|
||||
{
|
||||
local iface="$1"
|
||||
local bootif="$2"
|
||||
- local ipaddr peeraddr gwaddr hostname
|
||||
+ local ipaddr peeraddr gwaddr netmask hostname
|
||||
local family cidr rest prefix
|
||||
|
||||
hostname=$(hostname)
|
||||
@@ -598,7 +598,8 @@ function kdump_ip6_config() # {{
|
||||
|
||||
ipaddr="${cidr%/*}"
|
||||
prefix="${cidr:${#ipaddr}}"
|
||||
- ipaddr="[$ipaddr]$prefix"
|
||||
+ netmask="${prefix:1}"
|
||||
+ ipaddr="[$ipaddr]"
|
||||
set -- $rest
|
||||
|
||||
if [ "$1" == "peer" ] ; then
|
||||
@@ -609,7 +610,7 @@ function kdump_ip6_config() # {{
|
||||
peeraddr=
|
||||
fi
|
||||
|
||||
- echo "ip=$ipaddr:$peeraddr:$gwaddr::$hostname:$bootif:none"
|
||||
+ echo "ip=$ipaddr:$peeraddr:$gwaddr:$netmask:$hostname:$bootif:none"
|
||||
done < <(ip -6 address show dev "$iface" permanent scope global)
|
||||
} # }}}
|
||||
|
56
kdump-pass-all-IP-routes-to-kdump-environment.patch
Normal file
56
kdump-pass-all-IP-routes-to-kdump-environment.patch
Normal file
@ -0,0 +1,56 @@
|
||||
From: Michal Koutny <mkoutny@suse.com>
|
||||
Date: Mon, 26 Mar 2018 20:40:40 +0200
|
||||
Subject: IP setup: pass all routes to kdump environment
|
||||
References: bsc#1062026
|
||||
Upstream: merged
|
||||
Git-commit: 7013c7f7e081b1691a6b30ba213c39a5ab38e5fe
|
||||
|
||||
In some network setups the kdump target may not be routable through the
|
||||
default route. Thus pass all found routes.
|
||||
|
||||
---
|
||||
init/setup-kdump.functions | 12 ++++++++++++
|
||||
1 file changed, 12 insertions(+)
|
||||
|
||||
--- a/init/setup-kdump.functions
|
||||
+++ b/init/setup-kdump.functions
|
||||
@@ -550,6 +550,7 @@ function kdump_ip_config() # {{{
|
||||
local ipaddr peeraddr gwaddr netmask hostname
|
||||
local family cidr rest
|
||||
local prefix
|
||||
+ local routes r
|
||||
while read family cidr rest
|
||||
do
|
||||
[ "$family" = "inet" ] || continue
|
||||
@@ -572,6 +573,11 @@ function kdump_ip_config() # {{{
|
||||
hostname=$(hostname)
|
||||
|
||||
echo "ip=$ipaddr:$peeraddr:$gwaddr:$netmask:$hostname:$bootif:none"
|
||||
+
|
||||
+ routes=$(ip route show dev "$iface" | sed -n 's/\([0-9].*\) via \([^ ]*\).*/\1:\2/p')
|
||||
+ for r in $routes ; do
|
||||
+ echo "rd.route=$r:$bootif"
|
||||
+ done
|
||||
} # }}}
|
||||
|
||||
#
|
||||
@@ -588,6 +594,7 @@ function kdump_ip6_config() # {{
|
||||
local bootif="$2"
|
||||
local ipaddr peeraddr gwaddr netmask hostname
|
||||
local family cidr rest prefix
|
||||
+ local routes r
|
||||
|
||||
hostname=$(hostname)
|
||||
gwaddr=$(ip -6 route show ::/0 | sed -n 's/.* via \([^ ]*\).*/[\1]/p')
|
||||
@@ -612,6 +619,11 @@ function kdump_ip6_config() # {{
|
||||
|
||||
echo "ip=$ipaddr:$peeraddr:$gwaddr:$netmask:$hostname:$bootif:none"
|
||||
done < <(ip -6 address show dev "$iface" permanent scope global)
|
||||
+
|
||||
+ routes=$(ip -6 route show dev "$iface" | sed -n 's/\([0-9a-fA-F:].*\) via \([^ ]*\).*/[\1]:[\2]/p')
|
||||
+ for r in $routes ; do
|
||||
+ echo "rd.route=$r:$bootif"
|
||||
+ done
|
||||
} # }}}
|
||||
|
||||
#
|
51
kdump-remove-IPv6-brackets-for-getaddrinfo.patch
Normal file
51
kdump-remove-IPv6-brackets-for-getaddrinfo.patch
Normal file
@ -0,0 +1,51 @@
|
||||
From: Michal Koutny <mkoutny@suse.com>
|
||||
Date: Mon, 26 Mar 2018 20:43:40 +0200
|
||||
Subject: Routable: do not pass bracketed IPv6 to getaddrinfo
|
||||
References: bsc#1062026
|
||||
Upstream: merged
|
||||
Git-commit: ba186e82f9ea9b724fd48a1f119afb73b0063c12
|
||||
|
||||
It would be nicer to strip the brackets in URLParser and work with a
|
||||
plain IPv6 as hostname. However, since we pass that value to callees
|
||||
that expect bracketed form (e.g. NFS mount) we invert the convention and
|
||||
keep the bracketed version and use bare IPv6 to feed getaddrinfo only.
|
||||
|
||||
---
|
||||
kdumptool/routable.cc | 11 +++++++++--
|
||||
1 file changed, 9 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/kdumptool/routable.cc
|
||||
+++ b/kdumptool/routable.cc
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
#include "global.h"
|
||||
#include "routable.h"
|
||||
+#include "stringutil.h"
|
||||
#include "debug.h"
|
||||
|
||||
//{{{ NetLink ------------------------------------------------------------------
|
||||
@@ -459,8 +460,14 @@ bool Routable::resolve(void)
|
||||
{
|
||||
struct addrinfo hints;
|
||||
int res;
|
||||
+ KString raw_host(m_host);
|
||||
|
||||
- Debug::debug()->trace("resolve(%s)", m_host.c_str());
|
||||
+ // remove IPv6 URL bracketing for getaddrinfo
|
||||
+ if (raw_host.size() > 0 &&
|
||||
+ raw_host[0] == '[' && raw_host[raw_host.size()-1] == ']')
|
||||
+ raw_host = raw_host.substr(1, raw_host.size()-2);
|
||||
+
|
||||
+ Debug::debug()->trace("resolve(%s)", raw_host.c_str());
|
||||
|
||||
if (m_ai)
|
||||
freeaddrinfo(m_ai);
|
||||
@@ -469,7 +476,7 @@ bool Routable::resolve(void)
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
hints.ai_socktype = SOCK_RAW;
|
||||
do {
|
||||
- res = getaddrinfo(m_host.c_str(), NULL, &hints, &m_ai);
|
||||
+ res = getaddrinfo(raw_host.c_str(), NULL, &hints, &m_ai);
|
||||
} while (res == EAI_AGAIN);
|
||||
|
||||
if (res == 0)
|
42
kdump-skip-IPv4-if-no-address.patch
Normal file
42
kdump-skip-IPv4-if-no-address.patch
Normal file
@ -0,0 +1,42 @@
|
||||
From: Michal Koutny <mkoutny@suse.com>
|
||||
Date: Mon, 26 Mar 2018 20:51:19 +0200
|
||||
Subject: IP setup: don't bother with IPv4 if there are no addresses
|
||||
References: bsc#1062026
|
||||
Upstream: merged
|
||||
Git-commit: 7adc9d04d1eedd4f86c3d9a895ec725f553e3599
|
||||
|
||||
When an interface which is IPv6 only is used to store dump, kdump will
|
||||
attempt to create IPv4 configuration option which dracut cannot parse.
|
||||
|
||||
> [ 3.098548] dracut: FATAL: For argument 'ip=::10.100.33.254::germ184:eth1:none'\nValue 'none' without static configuration does not make sense
|
||||
> [ 3.115833] dracut: Refusing to continue
|
||||
|
||||
Use the same approach as with IPv6, i.e. configure it only when any
|
||||
IPv4 addresses are present.
|
||||
|
||||
---
|
||||
init/setup-kdump.functions | 12 +++++++-----
|
||||
1 file changed, 7 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/init/setup-kdump.functions
|
||||
+++ b/init/setup-kdump.functions
|
||||
@@ -572,12 +572,14 @@ function kdump_ip_config() # {{{
|
||||
gwaddr=$(ip route show 0/0 | sed -n 's/.* via \([^ ]*\).*/\1/p')
|
||||
hostname=$(hostname)
|
||||
|
||||
- echo "ip=$ipaddr:$peeraddr:$gwaddr:$netmask:$hostname:$bootif:none"
|
||||
+ if [ -n "$ipaddr" ] ; then
|
||||
+ echo "ip=$ipaddr:$peeraddr:$gwaddr:$netmask:$hostname:$bootif:none"
|
||||
|
||||
- routes=$(ip route show dev "$iface" | sed -n 's/\([0-9].*\) via \([^ ]*\).*/\1:\2/p')
|
||||
- for r in $routes ; do
|
||||
- echo "rd.route=$r:$bootif"
|
||||
- done
|
||||
+ routes=$(ip route show dev "$iface" | sed -n 's/\([0-9].*\) via \([^ ]*\).*/\1:\2/p')
|
||||
+ for r in $routes ; do
|
||||
+ echo "rd.route=$r:$bootif"
|
||||
+ done
|
||||
+ fi
|
||||
} # }}}
|
||||
|
||||
#
|
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,21 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Apr 6 16:48:57 UTC 2018 - ptesarik@suse.com
|
||||
|
||||
- kdump-pass-IPv6-address-prefix-separately.patch: IPv6 setup: pass
|
||||
address prefix in separate dracut arg (bsc#1062026).
|
||||
- kdump-pass-all-IP-routes-to-kdump-environment.patch: IP setup:
|
||||
pass all routes to kdump environment (bsc#1062026).
|
||||
- kdump-remove-IPv6-brackets-for-getaddrinfo.patch: Routable: do
|
||||
not pass bracketed IPv6 to getaddrinfo (bsc#1062026).
|
||||
- kdump-skip-IPv4-if-no-address.patch: IP setup: don't bother with
|
||||
IPv4 if there are no addresses (bsc#1062026).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
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
|
||||
|
||||
|
10
kdump.spec
10
kdump.spec
@ -91,6 +91,11 @@ 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
|
||||
Patch46: %{name}-pass-IPv6-address-prefix-separately.patch
|
||||
Patch47: %{name}-pass-all-IP-routes-to-kdump-environment.patch
|
||||
Patch48: %{name}-remove-IPv6-brackets-for-getaddrinfo.patch
|
||||
Patch49: %{name}-skip-IPv4-if-no-address.patch
|
||||
BuildRequires: asciidoc
|
||||
BuildRequires: cmake
|
||||
BuildRequires: gcc-c++
|
||||
@ -197,6 +202,11 @@ cp %{S:1} tests/data/
|
||||
%patch42 -p1
|
||||
%patch43 -p1
|
||||
%patch44 -p1
|
||||
%patch45 -p1
|
||||
%patch46 -p1
|
||||
%patch47 -p1
|
||||
%patch48 -p1
|
||||
%patch49 -p1
|
||||
|
||||
%build
|
||||
export CFLAGS="%{optflags}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user