commit:     6b4d839cd9febc3d8e9f4f666512aedab63c870b
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 13 14:18:52 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sun Oct 13 14:18:52 2019 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=6b4d839c

gen_determineargs.sh: determine_real_args(): Check early if ZFS is installed

This will allow us to error out early if ZFS is missing but was
requested.

Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 gen_determineargs.sh | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index cf76ee2..dbb61c4 100755
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -749,11 +749,21 @@ determine_real_args() {
                        fi
                fi
 
-               if isTrue "${ZFS}" && isTrue "$(tc-is-cross-compiler)"
+               if isTrue "${ZFS}"
                then
-                       local error_msg="Using binpkg for ZFS is not supported."
-                       error_msg+=" Therefore we cannot cross-compile like 
requested!"
-                       gen_die "${error_msg}"
+                       if isTrue "$(tc-is-cross-compiler)"
+                       then
+                               local error_msg="Using binpkg for ZFS is not 
supported."
+                               error_msg+=" Therefore we cannot cross-compile 
like requested!"
+                               gen_die "${error_msg}"
+                       fi
+
+                       if [ ! -x "/sbin/zfs" ]
+                       then
+                               local error_msg="'/sbin/zfs' is required for 
--zfs but file does not exist or is not executable!"
+                               error_msg+=" Is sys-fs/zfs installed?"
+                               gen_die "${error_msg}"
+                       fi
                fi
 
                if isTrue "${MULTIPATH}"

Reply via email to