From 73c9eb71e9a1709f86b7683e0c532067900608c8 Mon Sep 17 00:00:00 2001 From: Steffen Maier Date: Thu, 9 Nov 2023 16:50:40 +0100 Subject: [PATCH] dracut-module-setup: remove old s390 network device config (#1937048) Since the previous commit reworks znet configuration to be based on the active system configuration, there is no dependency on any existing persistent configuration any more. Hence the old code handling systems with exactly one s390-specific nmconnection as persistent configuration can be removed. Migration of the old persistent device configuration mechanism with nmconnections (or ifcfg) to zdev is handled independently in s390utils. [https://github.com/steffen-maier/s390utils/pull/1/commits ("znet: migrate to consolidated persistent device config with zdev (#1937046,#1937048))"] Signed-off-by: Steffen Maier Reviewed-by: Philipp Rudo Reviewed-by: Coiby Xu --- dracut-module-setup.sh | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 01efdeb..e39bc13 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -467,20 +467,10 @@ kdump_setup_vlan() { _save_kdump_netifs "$_parent_netif" } -_find_znet_nmconnection() { - LANG=C grep -s -E -i -l \ - "^s390-subchannels=([0-9]\.[0-9]\.[a-f0-9]+;){0,2}" \ - "$1"/*.nmconnection | LC_ALL=C sed -e "$2" -} - # setup s390 znet -# -# Note part of code is extracted from ccw_init provided by s390utils kdump_setup_znet() { local _netif local _tempfile=$(mktemp --tmpdir="$_DRACUT_KDUMP_NM_TMP_DIR" kdump-dracut-zdev.XXXXXX) - local _config_file _unique_name _NM_conf_dir - local __sed_discard_ignored_files='/\(~\|\.bak\|\.old\|\.orig\|\.rpmnew\|\.rpmorig\|\.rpmsave\)$/d' if [[ "$(uname -m)" != "s390x" ]]; then return @@ -497,32 +487,6 @@ kdump_setup_znet() { --base "/etc=$initdir/etc" 2>&1 | ddebug done rm -f "$_tempfile" - - _NM_conf_dir="/etc/NetworkManager/system-connections" - - _config_file=$(_find_znet_nmconnection "$initdir/$_NM_conf_dir" "$__sed_discard_ignored_files") - if [[ -n "$_config_file" ]]; then - ddebug "$_config_file has already contained the znet config" - return - fi - - _config_file=$(LANG=C grep -s -E -i -l \ - "^[[:space:]]*SUBCHANNELS=['\"]?([0-9]\.[0-9]\.[a-f0-9]+,){0,2}" \ - /etc/sysconfig/network-scripts/ifcfg-* \ - | LC_ALL=C sed -e "$__sed_discard_ignored_files") - - if [[ -z "$_config_file" ]]; then - _config_file=$(_find_znet_nmconnection "$_NM_conf_dir" "$__sed_discard_ignored_files") - fi - - if [[ -n "$_config_file" ]]; then - _unique_name=$(cat /proc/sys/kernel/random/uuid) - nmcli connection clone --temporary "$_config_file" "$_unique_name" &> >(ddebug) - nmcli connection modify --temporary "$_unique_name" connection.autoconnect false - inst "/run/NetworkManager/system-connections/${_unique_name}.nmconnection" "${_NM_conf_dir}/${_unique_name}.nmconnection" - nmcli connection del "$_unique_name" &> >(ddebug) - fi - } kdump_get_remote_ip() {