6edea0
From fc05c818dd862de2b6771dabe242bc9d26aa2160 Mon Sep 17 00:00:00 2001
6edea0
From: Jan Synacek <jsynacek@redhat.com>
6edea0
Date: Thu, 11 Jun 2020 11:29:41 +0200
6edea0
Subject: [PATCH] Adapt to the new udevadm version output
6edea0
6edea0
See https://bugzilla.redhat.com/show_bug.cgi?id=1804252.
6edea0
6edea0
RHEL-only
6edea0
6edea0
Resolves: #1846034
6edea0
---
6edea0
 dracut-init.sh                 | 2 +-
6edea0
 modules.d/01fips/fips.sh       | 2 +-
6edea0
 modules.d/99base/dracut-lib.sh | 4 ++--
6edea0
 modules.d/99base/init.sh       | 2 +-
6edea0
 4 files changed, 5 insertions(+), 5 deletions(-)
6edea0
6edea0
diff --git a/dracut-init.sh b/dracut-init.sh
6edea0
index ab07cabf..032c38c2 100644
6edea0
--- a/dracut-init.sh
6edea0
+++ b/dracut-init.sh
6edea0
@@ -444,7 +444,7 @@ inst_rules_wildcard() {
6edea0
 }
6edea0
 
6edea0
 prepare_udev_rules() {
6edea0
-    [ -z "$UDEVVERSION" ] && export UDEVVERSION=$(udevadm --version)
6edea0
+    [ -z "$UDEVVERSION" ] && export UDEVVERSION=$(udevadm --version | { read v _ ; echo $v ; })
6edea0
 
6edea0
     for f in "$@"; do
6edea0
         f="${initdir}/etc/udev/rules.d/$f"
6edea0
diff --git a/modules.d/01fips/fips.sh b/modules.d/01fips/fips.sh
6edea0
index 559952ca..03da6861 100755
6edea0
--- a/modules.d/01fips/fips.sh
6edea0
+++ b/modules.d/01fips/fips.sh
6edea0
@@ -27,7 +27,7 @@ mount_boot()
6edea0
 
6edea0
         if ! [ -e "$boot" ]; then
6edea0
             udevadm trigger --action=add >/dev/null 2>&1
6edea0
-            [ -z "$UDEVVERSION" ] && UDEVVERSION=$(udevadm --version)
6edea0
+            [ -z "$UDEVVERSION" ] && UDEVVERSION=$(udevadm --version | { read v _ ; echo $v ; })
6edea0
             i=0
6edea0
             while ! [ -e $boot ]; do
6edea0
                 if [ $UDEVVERSION -ge 143 ]; then
6edea0
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
6edea0
index 56dd63ef..96dd55ad 100755
6edea0
--- a/modules.d/99base/dracut-lib.sh
6edea0
+++ b/modules.d/99base/dracut-lib.sh
6edea0
@@ -531,7 +531,7 @@ incol2() {
6edea0
 }
6edea0
 
6edea0
 udevsettle() {
6edea0
-    [ -z "$UDEVVERSION" ] && export UDEVVERSION=$(udevadm --version)
6edea0
+    [ -z "$UDEVVERSION" ] && export UDEVVERSION=$(udevadm --version | { read v _ ; echo $v ; })
6edea0
 
6edea0
     if [ $UDEVVERSION -ge 143 ]; then
6edea0
         udevadm settle --exit-if-exists=$hookdir/initqueue/work $settle_exit_if_exists
6edea0
@@ -541,7 +541,7 @@ udevsettle() {
6edea0
 }
6edea0
 
6edea0
 udevproperty() {
6edea0
-    [ -z "$UDEVVERSION" ] && export UDEVVERSION=$(udevadm --version)
6edea0
+    [ -z "$UDEVVERSION" ] && export UDEVVERSION=$(udevadm --version | { read v _ ; echo $v ; })
6edea0
 
6edea0
     if [ $UDEVVERSION -ge 143 ]; then
6edea0
         for i in "$@"; do udevadm control --property=$i; done
6edea0
diff --git a/modules.d/99base/init.sh b/modules.d/99base/init.sh
6edea0
index a5633936..732a7f46 100755
6edea0
--- a/modules.d/99base/init.sh
6edea0
+++ b/modules.d/99base/init.sh
6edea0
@@ -92,7 +92,7 @@ fi
6edea0
 
6edea0
 trap "emergency_shell Signal caught!" 0
6edea0
 
6edea0
-export UDEVVERSION=$(udevadm --version)
6edea0
+export UDEVVERSION=$(udevadm --version | { read v _ ; echo $v ; })
6edea0
 if [ $UDEVVERSION -gt 166 ]; then
6edea0
     # newer versions of udev use /run/udev/rules.d
6edea0
     export UDEVRULESD=/run/udev/rules.d
6edea0