Skip to content

Commit 21f9139

Browse files
committed
feat(ifcfg): minimize s390-specific network configuration aspects
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 <[email protected]>
1 parent 3009d8c commit 21f9139

File tree

1 file changed

+0
-41
lines changed

1 file changed

+0
-41
lines changed

modules.d/45ifcfg/write-ifcfg.sh

-41
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,10 @@ mkdir -m 0755 -p /tmp/ifcfg/
1010
# shellcheck disable=SC2174
1111
mkdir -m 0755 -p /tmp/ifcfg-leases/
1212

13-
get_config_line_by_subchannel() {
14-
local CHANNELS
15-
local line
16-
17-
CHANNELS="$1"
18-
while read -r line || [ -n "$line" ]; do
19-
if strstr "$line" "$CHANNELS"; then
20-
echo "$line"
21-
return 0
22-
fi
23-
done < /etc/ccw.conf
24-
return 1
25-
}
26-
2713
print_s390() {
2814
local _netif
2915
local SUBCHANNELS
30-
local OPTIONS
31-
local NETTYPE
32-
local CONFIG_LINE
3316
local i
34-
local OLD_IFS
3517

3618
_netif="$1"
3719
# if we find ccw channel, then use those, instead of
@@ -43,29 +25,6 @@ print_s390() {
4325
SUBCHANNELS=${SUBCHANNELS%,}
4426
echo "SUBCHANNELS=\"${SUBCHANNELS}\""
4527

46-
CONFIG_LINE=$(get_config_line_by_subchannel "$SUBCHANNELS")
47-
# shellcheck disable=SC2181
48-
[ $? -ne 0 -o -z "$CONFIG_LINE" ] && return 0
49-
50-
OLD_IFS=$IFS
51-
IFS=","
52-
# shellcheck disable=SC2086
53-
set -- $CONFIG_LINE
54-
IFS=$OLD_IFS
55-
NETTYPE=$1
56-
shift
57-
SUBCHANNELS="$1"
58-
OPTIONS=""
59-
shift
60-
while [ $# -gt 0 ]; do
61-
case $1 in
62-
*=*) OPTIONS="$OPTIONS $1" ;;
63-
esac
64-
shift
65-
done
66-
OPTIONS=${OPTIONS## }
67-
echo "NETTYPE=\"${NETTYPE}\""
68-
echo "OPTIONS=\"${OPTIONS}\""
6928
return 0
7029
}
7130

0 commit comments

Comments
 (0)