]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(lvm): ignore expected error message from lvm config
authorDavid Teigland <teigland@redhat.com>
Mon, 28 Mar 2022 14:35:11 +0000 (09:35 -0500)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Tue, 29 Mar 2022 02:38:48 +0000 (02:38 +0000)
The "lvm config" commands that check the filter settings will
often find nothing set and report an error message:
"Configuration node devices/filter not found"
Direct these messages to /dev/null so they do not appear as
noise in system logs.

modules.d/90lvm/lvm_scan.sh

index 89f077aef9940ff60b90a707c6725767385af4ed..980e449071b8602effb606ad275021499b7cf755 100755 (executable)
@@ -52,13 +52,13 @@ no_lvm_conf_filter() {
     # Save lvm config results in /run to avoid running
     # lvm config commands for every PV that's scanned.
 
-    filter=$(lvm config devices/filter | grep "$filter=")
+    filter=$(lvm config devices/filter 2> /dev/null | grep "$filter=")
     if [ -n "$filter" ]; then
         printf '%s\n' "$filter" > /run/lvm/initrd_filter
         return 1
     fi
 
-    global_filter=$(lvm config devices/global_filter | grep "$global_filter=")
+    global_filter=$(lvm config devices/global_filter 2> /dev/null | grep "$global_filter=")
     if [ -n "$global_filter" ]; then
         printf '%s\n' "$global_filter" > /run/lvm/initrd_global_filter
         return 1