]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
feat(ifcfg): minimize s390-specific network configuration aspects
authorSteffen Maier <maier@linux.ibm.com>
Wed, 26 Jul 2023 10:59:19 +0000 (12:59 +0200)
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Sat, 4 May 2024 02:36:51 +0000 (22:36 -0400)
Since consolidated s390 network device configuration with zdev is used,
it takes care of all s390-specific settings.
None of the s390-specific ifcfg variables should be used anymore.
NETTYPE and OPTIONS can be removed entirely.
SUBCHANNELS is kept because there are some dependency chains
(probably around the interface identifiying key, which is not HWADDR):

modules.d/35network-legacy/module-setup.sh
parses (sources) each of /etc/sysconfig/network-scripts/ifcfg-*
and if that contains SUBCHANNELS, creates a symlink from the ifcfg file to
/etc/sysconfig/network-scripts/ccw-${SUBCHANNELS}.conf

modules.d/35network-legacy/ifup.sh installed as /sbin/ifup
checks during team setup if a slave interface is an s390 channel-attached
network interface and then parses (sources)
/etc/sysconfig/network-scripts/ccw-${SUBCHANNELS}.conf
from above, if that file exists

Signed-off-by: Steffen Maier <maier@linux.ibm.com>
modules.d/45ifcfg/write-ifcfg.sh

index 4ca96e98728960b7f19ebbf07f952b376c78b7a0..a7804b5053915ab8146c9e6ff4983bb9a619f24e 100755 (executable)
@@ -10,28 +10,10 @@ mkdir -m 0755 -p /tmp/ifcfg/
 # shellcheck disable=SC2174
 mkdir -m 0755 -p /tmp/ifcfg-leases/
 
-get_config_line_by_subchannel() {
-    local CHANNELS
-    local line
-
-    CHANNELS="$1"
-    while read -r line || [ -n "$line" ]; do
-        if strstr "$line" "$CHANNELS"; then
-            echo "$line"
-            return 0
-        fi
-    done < /etc/ccw.conf
-    return 1
-}
-
 print_s390() {
     local _netif
     local SUBCHANNELS
-    local OPTIONS
-    local NETTYPE
-    local CONFIG_LINE
     local i
-    local OLD_IFS
 
     _netif="$1"
     # if we find ccw channel, then use those, instead of
@@ -43,29 +25,6 @@ print_s390() {
     SUBCHANNELS=${SUBCHANNELS%,}
     echo "SUBCHANNELS=\"${SUBCHANNELS}\""
 
-    CONFIG_LINE=$(get_config_line_by_subchannel "$SUBCHANNELS")
-    # shellcheck disable=SC2181
-    [ $? -ne 0 -o -z "$CONFIG_LINE" ] && return 0
-
-    OLD_IFS=$IFS
-    IFS=","
-    # shellcheck disable=SC2086
-    set -- $CONFIG_LINE
-    IFS=$OLD_IFS
-    NETTYPE=$1
-    shift
-    SUBCHANNELS="$1"
-    OPTIONS=""
-    shift
-    while [ $# -gt 0 ]; do
-        case $1 in
-            *=*) OPTIONS="$OPTIONS $1" ;;
-        esac
-        shift
-    done
-    OPTIONS=${OPTIONS## }
-    echo "NETTYPE=\"${NETTYPE}\""
-    echo "OPTIONS=\"${OPTIONS}\""
     return 0
 }