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