Signed-off-by: Coiby Xu <coxu(a)redhat.com>
---
dracut-module-setup.sh | 12 -------
kdump-lib.sh | 81 ------------------------------------------
2 files changed, 93 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 1351743..82a0e7d 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -85,18 +85,6 @@ kdump_is_vlan() {
[ -f /proc/net/vlan/"$1" ]
}
-# $1: netdev name
-source_ifcfg_file() {
- local ifcfg_file
-
- ifcfg_file=$(get_ifcfg_filename $1)
- if [ -f "${ifcfg_file}" ]; then
- . ${ifcfg_file}
- else
- dwarning "The ifcfg file of $1 is not found!"
- fi
-}
-
# $1: nmcli connection show output
kdump_setup_dns() {
local _nmcli_out="$1"
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 1b1fc85..1a8247c 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -419,31 +419,6 @@ get_nmcli_connection_show_by_ifname()
echo -n "$_nmcli_out"
}
-
-get_ifcfg_by_device()
-{
- grep -E -i -l "^[[:space:]]*DEVICE=\"*${1}\"*[[:space:]]*$" \
- /etc/sysconfig/network-scripts/ifcfg-* 2>/dev/null | head -1
-}
-
-get_ifcfg_by_hwaddr()
-{
- grep -E -i -l "^[[:space:]]*HWADDR=\"*${1}\"*[[:space:]]*$" \
- /etc/sysconfig/network-scripts/ifcfg-* 2>/dev/null | head -1
-}
-
-get_ifcfg_by_uuid()
-{
- grep -E -i -l "^[[:space:]]*UUID=\"*${1}\"*[[:space:]]*$" \
- /etc/sysconfig/network-scripts/ifcfg-* 2>/dev/null | head -1
-}
-
-get_ifcfg_by_name()
-{
- grep -E -i -l "^[[:space:]]*NAME=\"*${1}\"*[[:space:]]*$" \
- /etc/sysconfig/network-scripts/ifcfg-* 2>/dev/null | head -1
-}
-
is_nm_running()
{
[ "$(LANG=C nmcli -t --fields running general status 2>/dev/null)" =
"running" ]
@@ -455,62 +430,6 @@ is_nm_handling()
| grep -q "^\(${1}:connected\)\|\(${1}:connecting.*\)$"
}
-# $1: netdev name
-get_ifcfg_nmcli()
-{
- local nm_uuid nm_name
- local ifcfg_file
-
- # Get the active nmcli config name of $1
- if is_nm_running && is_nm_handling "${1}" ; then
- # The configuration "uuid" and "name" generated by nm is
wrote to
- # the ifcfg file as "UUID=<nm_uuid>" and
"NAME=<nm_name>".
- nm_uuid=$(LANG=C nmcli -t --fields uuid,device c show --active 2>/dev/null \
- | grep "${1}" | head -1 | cut -d':' -f1)
- nm_name=$(LANG=C nmcli -t --fields name,device c show --active 2>/dev/null \
- | grep "${1}" | head -1 | cut -d':' -f1)
- ifcfg_file=$(get_ifcfg_by_uuid "${nm_uuid}")
- [ -z "${ifcfg_file}" ] && ifcfg_file=$(get_ifcfg_by_name
"${nm_name}")
- fi
-
- echo -n "${ifcfg_file}"
-}
-
-# $1: netdev name
-get_ifcfg_legacy()
-{
- local ifcfg_file
-
- ifcfg_file="/etc/sysconfig/network-scripts/ifcfg-${1}"
- [ -f "${ifcfg_file}" ] && echo -n "${ifcfg_file}"
&& return
-
- ifcfg_file=$(get_ifcfg_by_name "${1}")
- [ -f "${ifcfg_file}" ] && echo -n "${ifcfg_file}"
&& return
-
- local hwaddr=$(get_hwaddr "${1}")
- if [ -n "$hwaddr" ]; then
- ifcfg_file=$(get_ifcfg_by_hwaddr "${hwaddr}")
- [ -f "${ifcfg_file}" ] && echo -n "${ifcfg_file}"
&& return
- fi
-
- ifcfg_file=$(get_ifcfg_by_device "${1}")
-
- echo -n "${ifcfg_file}"
-}
-
-# $1: netdev name
-# Return the ifcfg file whole name(including the path) of $1 if any.
-get_ifcfg_filename() {
- local ifcfg_file
-
- ifcfg_file=$(get_ifcfg_nmcli "${1}")
- if [ -z "${ifcfg_file}" ]; then
- ifcfg_file=$(get_ifcfg_legacy "${1}")
- fi
-
- echo -n "${ifcfg_file}"
-}
-
# returns 0 when omission of a module is desired in dracut_args
# returns 1 otherwise
is_dracut_mod_omitted() {
--
2.30.1