Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.2:Ports
kdump
kdump-net-0009-kind-from-wicked.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File kdump-net-0009-kind-from-wicked.patch of Package kdump
From: Petr Tesarik <ptesarik@suse.com> Date: Fri, 2 Sep 2016 08:33:29 +0200 Subject: Get configured interface kind using wicked References: bsc#980328 Patch-mainline: v0.8.16 Git-commit: ee7e1d0a5a5f025015fc8345efface6d7301244b The kdump interface may not be up or even present when running mkdumprd, so ip(8) cannot be used. To solve it, read the configured values using wicked. The problem with wicked show-config is that the interface kind is not contained in the XML; it must be inferred from the presence or absence of certain elements... Oh, well. Signed-off-by: Petr Tesarik <ptesarik@suse.com> --- init/setup-kdump.functions | 55 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) --- a/init/setup-kdump.functions +++ b/init/setup-kdump.functions @@ -170,7 +170,60 @@ function kdump_netdev_mode() # { # interface kind (IFLA_INFO_KIND) function kdump_ifkind() # {{{ { - ip -d link show "$1" | sed -n '3{s/^ *\([^ ]*\).*/\1/;s/.*_slave$//;p}' + local if="$1" + + # ovs-system is special, because it's recognized by its name + if [ "$if" = "ovs-system" ] + then + echo ovs-system + + # get kind using wicked if possible + elif [ -n "$(type -P wicked)" ] + then + local -a elems=( + infiniband + infiniband:child + bond + team + ovs-bridge + bridge + vlan + macvlan + macvtap + dummy + wireless + tun + tap + ipip + gre + sit + ) + local elem opt var + for elem in "${elems[@]}" + do + opt="$opt;${elem//[-:]/_}=%{$elem or false}" + done + + var="${elems[@]}" + var="${var//[-:]/_}" + local $var + eval $(wicked show-config | \ + wicked xpath --reference "/interface[name='$if']" "${opt#;}") + + for elem in "${elems[@]}" + do + var="${elem//[-:]/_}" + if [ "${!var}" = true ] + then + echo "$elem" + break + fi + done + + # fall back to reading the current state via netlink + else + ip -d link show "$1" | sed -n '3{s/^ *\([^ ]*\).*/\1/;s/.*_slave$//;p}' + fi } # }}} #
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor