From 5e82789fe78f4ed4de85e4466b9f79bdc9992961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C4=8Cajka?= Date: Wed, 20 May 2020 13:31:29 +0000 Subject: [PATCH] - avoid dependency on network-scrips --- ccw_init | 13 +++++++++++-- s390utils.spec | 1 - 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ccw_init b/ccw_init index a691ae0..23e8ed9 100644 --- a/ccw_init +++ b/ccw_init @@ -24,6 +24,17 @@ get_config_line_by_subchannel() return 1 } +# borrowed from network-scrips, initscripts along with the get_config_by_subchannel +[ -z "$__sed_discard_ignored_files" ] && __sed_discard_ignored_files='/\(~\|\.bak\|\.old\|\.orig\|\.rpmnew\|\.rpmorig\|\.rpmsave\)$/d' + +get_config_by_subchannel () +{ + LANG=C grep -E -i -l \ + "^[[:space:]]*SUBCHANNELS=['\"]?([0-9]\.[0-9]\.[a-f0-9]+,){0,2}${1}(,[0-9]\.[0-9]\.[a-f0-9]+){0,2}['\"]?([[:space:]]+#|[[:space:]]*$)" \ + /etc/sysconfig/network-scripts/ifcfg-* \ + | LC_ALL=C sed -e "$__sed_discard_ignored_files" +} + CHANNEL=${DEVPATH##*/} if [ $MODE = "dracut" ]; then @@ -49,8 +60,6 @@ if [ $MODE = "dracut" ]; then elif [ $MODE = "normal" ]; then NOLOCALE="yes" - . /etc/sysconfig/network-scripts/network-functions - CONFIG_FILE=$(get_config_by_subchannel $CHANNEL) if [ -n "$CONFIG_FILE" ]; then diff --git a/s390utils.spec b/s390utils.spec index 1798f36..aede4b6 100644 --- a/s390utils.spec +++ b/s390utils.spec @@ -152,7 +152,6 @@ Requires: gawk sed coreutils Requires: sysfsutils Requires: sg3_utils Requires: ethtool -Requires: network-scripts Requires: tar %{?systemd_requires} BuildRequires: perl-generators