summaryrefslogtreecommitdiffstats
path: root/modules.d/45net-lib
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-26 10:33:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-26 10:33:11 +0000
commit203af7302854f453fa4a05ecefd4403b6c8a4f8d (patch)
tree967fdacafe332baabd12b57725505c138d0f3bbf /modules.d/45net-lib
parentAdding upstream version 102. (diff)
downloaddracut-203af7302854f453fa4a05ecefd4403b6c8a4f8d.tar.xz
dracut-203af7302854f453fa4a05ecefd4403b6c8a4f8d.zip
Adding upstream version 103.upstream/103upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xmodules.d/45net-lib/ifname-genrules.sh2
-rwxr-xr-xmodules.d/45net-lib/module-setup.sh3
-rwxr-xr-xmodules.d/45net-lib/net-lib.sh12
3 files changed, 9 insertions, 8 deletions
diff --git a/modules.d/45net-lib/ifname-genrules.sh b/modules.d/45net-lib/ifname-genrules.sh
index b9b95c4..34b7a2e 100755
--- a/modules.d/45net-lib/ifname-genrules.sh
+++ b/modules.d/45net-lib/ifname-genrules.sh
@@ -17,7 +17,7 @@ command -v parse_ifname_opts > /dev/null || . /lib/net-lib.sh
if [ -f /tmp/ifname-"$ifname_if" ]; then
read -r oldmac < /tmp/ifname-"$ifname_if"
fi
- if [ -n "$oldif" -a -n "$oldmac" -a "$oldif" = "$ifname_if" -a "$oldmac" = "$ifname_mac" ]; then
+ if [ -n "$oldif" ] && [ -n "$oldmac" ] && [ "$oldif" = "$ifname_if" ] && [ "$oldmac" = "$ifname_mac" ]; then
# skip same ifname= declaration
continue
fi
diff --git a/modules.d/45net-lib/module-setup.sh b/modules.d/45net-lib/module-setup.sh
index 8053aa6..ed5e5ed 100755
--- a/modules.d/45net-lib/module-setup.sh
+++ b/modules.d/45net-lib/module-setup.sh
@@ -1,6 +1,7 @@
#!/bin/bash
check() {
+ require_binaries ip awk grep || return 1
return 255
}
@@ -14,7 +15,7 @@ install() {
inst_simple "$moddir/net-lib.sh" "/lib/net-lib.sh"
inst_hook pre-udev 50 "$moddir/ifname-genrules.sh"
inst_hook cmdline 91 "$moddir/dhcp-root.sh"
- inst_multiple ip sed awk grep pgrep tr
+ inst_multiple ip awk grep
inst_multiple -o arping arping2
dracut_need_initqueue
}
diff --git a/modules.d/45net-lib/net-lib.sh b/modules.d/45net-lib/net-lib.sh
index 9d88e0d..dc6be88 100755
--- a/modules.d/45net-lib/net-lib.sh
+++ b/modules.d/45net-lib/net-lib.sh
@@ -319,7 +319,7 @@ ibft_to_cmdline() {
gw="[${gw}]"
fi
fi
- if [ -n "$ip" ] && [ -n "$mask" -o -n "$prefix" ]; then
+ if [ -n "$ip" ] && [ -n "$mask" ] || [ -n "$prefix" ]; then
echo "ip=$ip::$gw:$mask:$hostname:$dev:none${dns1:+:$dns1}${dns2:+:$dns2}"
else
warn "${iface} does not contain a valid iBFT configuration"
@@ -517,7 +517,7 @@ ip_to_var() {
return 0
fi
- if [ "$2" = "dhcp" -o "$2" = "on" -o "$2" = "any" -o "$2" = "dhcp6" -o "$2" = "auto6" -o "$2" = "either6" ]; then
+ if [ "$2" = "dhcp" ] || [ "$2" = "on" ] || [ "$2" = "any" ] || [ "$2" = "dhcp6" ] || [ "$2" = "auto6" ] || [ "$2" = "either6" ]; then
# format: ip=<interface>:{dhcp|on|any|dhcp6|auto6}[:[<mtu>][:<macaddr>]]
[ -n "$1" ] && dev="$1"
[ -n "$2" ] && autoconf="$2"
@@ -546,16 +546,16 @@ ip_to_var() {
;;
[0-9]*)
mtu="$8"
- if [ -n "${9}" -a -z "${10}" ]; then
+ if [ -n "${9}" ] && [ -z "${10}" ]; then
macaddr="${9}"
- elif [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then
+ elif [ -n "${9}" ] && [ -n "${10}" ] && [ -n "${11}" ] && [ -n "${12}" ] && [ -n "${13}" ] && [ -n "${14}" ]; then
macaddr="${9}:${10}:${11}:${12}:${13}:${14}"
fi
;;
*)
- if [ -n "${9}" -a -z "${10}" ]; then
+ if [ -n "${9}" ] && [ -z "${10}" ]; then
macaddr="${9}"
- elif [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then
+ elif [ -n "${9}" ] && [ -n "${10}" ] && [ -n "${11}" ] && [ -n "${12}" ] && [ -n "${13}" ] && [ -n "${14}" ]; then
macaddr="${9}:${10}:${11}:${12}:${13}:${14}"
fi
;;