diff --git a/kdump-pass-IPv6-address-prefix-separately.patch b/kdump-pass-IPv6-address-prefix-separately.patch new file mode 100644 index 0000000..f5b1ad6 --- /dev/null +++ b/kdump-pass-IPv6-address-prefix-separately.patch @@ -0,0 +1,49 @@ +From: Michal Koutny +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) + } # }}} + diff --git a/kdump-pass-all-IP-routes-to-kdump-environment.patch b/kdump-pass-all-IP-routes-to-kdump-environment.patch new file mode 100644 index 0000000..a0087eb --- /dev/null +++ b/kdump-pass-all-IP-routes-to-kdump-environment.patch @@ -0,0 +1,56 @@ +From: Michal Koutny +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 + } # }}} + + # diff --git a/kdump-remove-IPv6-brackets-for-getaddrinfo.patch b/kdump-remove-IPv6-brackets-for-getaddrinfo.patch new file mode 100644 index 0000000..68bdf20 --- /dev/null +++ b/kdump-remove-IPv6-brackets-for-getaddrinfo.patch @@ -0,0 +1,51 @@ +From: Michal Koutny +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) diff --git a/kdump-skip-IPv4-if-no-address.patch b/kdump-skip-IPv4-if-no-address.patch new file mode 100644 index 0000000..5b0e38d --- /dev/null +++ b/kdump-skip-IPv4-if-no-address.patch @@ -0,0 +1,42 @@ +From: Michal Koutny +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 + } # }}} + + # 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" <