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