Blame 0018-feat-ifcfg-minimize-s390-specific-network-configurat.patch

218d2d
From 110fec3e41faf47277447f1c56635c5a876c1f96 Mon Sep 17 00:00:00 2001
218d2d
From: Steffen Maier <maier@linux.ibm.com>
218d2d
Date: Wed, 26 Jul 2023 12:59:19 +0200
218d2d
Subject: [PATCH 18/23] feat(ifcfg): minimize s390-specific network
218d2d
 configuration aspects
218d2d
218d2d
Since consolidated s390 network device configuration with zdev is used,
218d2d
it takes care of all s390-specific settings.
218d2d
None of the s390-specific ifcfg variables should be used anymore.
218d2d
NETTYPE and OPTIONS can be removed entirely.
218d2d
SUBCHANNELS is kept because there are some dependency chains
218d2d
(probably around the interface identifiying key, which is not HWADDR):
218d2d
218d2d
modules.d/35network-legacy/module-setup.sh
218d2d
parses (sources) each of /etc/sysconfig/network-scripts/ifcfg-*
218d2d
and if that contains SUBCHANNELS, creates a symlink from the ifcfg file to
218d2d
/etc/sysconfig/network-scripts/ccw-${SUBCHANNELS}.conf
218d2d
218d2d
modules.d/35network-legacy/ifup.sh installed as /sbin/ifup
218d2d
checks during team setup if a slave interface is an s390 channel-attached
218d2d
network interface and then parses (sources)
218d2d
/etc/sysconfig/network-scripts/ccw-${SUBCHANNELS}.conf
218d2d
from above, if that file exists
218d2d
218d2d
Signed-off-by: Steffen Maier <maier@linux.ibm.com>
218d2d
---
218d2d
 modules.d/45ifcfg/write-ifcfg.sh | 41 --------------------------------
218d2d
 1 file changed, 41 deletions(-)
218d2d
218d2d
diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh
218d2d
index 4ca96e98..a7804b50 100755
218d2d
--- a/modules.d/45ifcfg/write-ifcfg.sh
218d2d
+++ b/modules.d/45ifcfg/write-ifcfg.sh
218d2d
@@ -10,28 +10,10 @@ mkdir -m 0755 -p /tmp/ifcfg/
218d2d
 # shellcheck disable=SC2174
218d2d
 mkdir -m 0755 -p /tmp/ifcfg-leases/
218d2d
 
218d2d
-get_config_line_by_subchannel() {
218d2d
-    local CHANNELS
218d2d
-    local line
218d2d
-
218d2d
-    CHANNELS="$1"
218d2d
-    while read -r line || [ -n "$line" ]; do
218d2d
-        if strstr "$line" "$CHANNELS"; then
218d2d
-            echo "$line"
218d2d
-            return 0
218d2d
-        fi
218d2d
-    done < /etc/ccw.conf
218d2d
-    return 1
218d2d
-}
218d2d
-
218d2d
 print_s390() {
218d2d
     local _netif
218d2d
     local SUBCHANNELS
218d2d
-    local OPTIONS
218d2d
-    local NETTYPE
218d2d
-    local CONFIG_LINE
218d2d
     local i
218d2d
-    local OLD_IFS
218d2d
 
218d2d
     _netif="$1"
218d2d
     # if we find ccw channel, then use those, instead of
218d2d
@@ -43,29 +25,6 @@ print_s390() {
218d2d
     SUBCHANNELS=${SUBCHANNELS%,}
218d2d
     echo "SUBCHANNELS=\"${SUBCHANNELS}\""
218d2d
 
218d2d
-    CONFIG_LINE=$(get_config_line_by_subchannel "$SUBCHANNELS")
218d2d
-    # shellcheck disable=SC2181
218d2d
-    [ $? -ne 0 -o -z "$CONFIG_LINE" ] && return 0
218d2d
-
218d2d
-    OLD_IFS=$IFS
218d2d
-    IFS=","
218d2d
-    # shellcheck disable=SC2086
218d2d
-    set -- $CONFIG_LINE
218d2d
-    IFS=$OLD_IFS
218d2d
-    NETTYPE=$1
218d2d
-    shift
218d2d
-    SUBCHANNELS="$1"
218d2d
-    OPTIONS=""
218d2d
-    shift
218d2d
-    while [ $# -gt 0 ]; do
218d2d
-        case $1 in
218d2d
-            *=*) OPTIONS="$OPTIONS $1" ;;
218d2d
-        esac
218d2d
-        shift
218d2d
-    done
218d2d
-    OPTIONS=${OPTIONS## }
218d2d
-    echo "NETTYPE=\"${NETTYPE}\""
218d2d
-    echo "OPTIONS=\"${OPTIONS}\""
218d2d
     return 0
218d2d
 }
218d2d
 
218d2d
-- 
218d2d
2.42.0
218d2d