Blame SOURCES/0398-dracut-nbd-Only-complain-of-missing-binary-in-hoston.patch

a0a3b4
From 3186a0aa15822d69c8eb073bfc76665a1315957c Mon Sep 17 00:00:00 2001
a0a3b4
From: Thomas Renninger <trenn@suse.de>
a0a3b4
Date: Thu, 11 Dec 2014 15:46:33 +0100
a0a3b4
Subject: [PATCH] dracut: nbd: Only complain of missing binary in hostonly mode
a0a3b4
 if
a0a3b4
a0a3b4
 rootfs is on nbd
a0a3b4
a0a3b4
In not hostonly mode, require_binaries will still complain.
a0a3b4
If in hostonly mode and the module is explicitly added via -a nbd, then
a0a3b4
install() section will still complain later:
a0a3b4
dracut-install: ERROR: installing 'nbd-client'
a0a3b4
a0a3b4
Signed-off-by: Thomas Renninger <trenn@suse.de>
a0a3b4
(cherry picked from commit e683985d103f1b0f15a9ccd9678169f4fb7aeb5f)
a0a3b4
---
a0a3b4
 modules.d/95nbd/module-setup.sh | 3 +--
a0a3b4
 1 file changed, 1 insertion(+), 2 deletions(-)
a0a3b4
a0a3b4
diff --git a/modules.d/95nbd/module-setup.sh b/modules.d/95nbd/module-setup.sh
a0a3b4
index 7e8a416..270a9d3 100755
a0a3b4
--- a/modules.d/95nbd/module-setup.sh
a0a3b4
+++ b/modules.d/95nbd/module-setup.sh
a0a3b4
@@ -4,8 +4,6 @@
a0a3b4
 
a0a3b4
 check() {
a0a3b4
     local _rootdev
a0a3b4
-    # If our prerequisites are not met, fail.
a0a3b4
-    require_binaries nbd-client || return 1
a0a3b4
 
a0a3b4
     # if an nbd device is not somewhere in the chain of devices root is
a0a3b4
     # mounted on, fail the hostonly check.
a0a3b4
@@ -16,6 +14,7 @@ check() {
a0a3b4
         [[ -b /dev/block/$_rootdev ]] || return 1
a0a3b4
         check_block_and_slaves is_nbd "$_rootdev" || return 255
a0a3b4
     }
a0a3b4
+    require_binaries nbd-client || return 1
a0a3b4
 
a0a3b4
     return 0
a0a3b4
 }