]> granicus.if.org Git - zfs/commitdiff
Require gawk the usermode helper fails with awk
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 1 Jul 2010 23:20:11 +0000 (16:20 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 1 Jul 2010 23:38:08 +0000 (16:38 -0700)
For some reason when awk invoked by the usermode helper the command
always fails.  Interestingly gawk does not suffer from this problem
which is why I never observed this failure since the distro I tested
with all had gawk installed instead of awk.  Anyway, the simplest
thing to do here is to just make gawk mandatory.  I've added a
configure check for gawk specifically and have updated the command
to call gawk not awk.

config/spl-build.m4
configure
module/spl/spl-generic.c

index 40f072bf7191a4409308250adb0d74901f84ae59..4d6109a0e281deea950cdd626bdc69c793f33c60 100644 (file)
@@ -191,7 +191,16 @@ AC_DEFUN([SPL_AC_KERNEL], [
 dnl #
 dnl # Default SPL user configuration
 dnl #
-AC_DEFUN([SPL_AC_CONFIG_USER], [])
+AC_DEFUN([SPL_AC_CONFIG_USER], [
+       dnl # Explicitly check for gawk, we require it for the the usermode
+       dnl # helper.  For some reason the standard awk command does not
+       dnl # behave correctly when invoked from the usermode helper.
+       AS_IF([test "x$AWK" != xgawk], [
+                AC_MSG_ERROR([
+       *** Required util gawk missing.  Please install the required
+       *** gawk package for your distribution and try again.])
+       ])
+])
 
 AC_DEFUN([SPL_AC_LICENSE], [
        AC_MSG_CHECKING([spl license])
index 4c5df996f420695c9ce18a5d9668569189e9a0c2..8792553fec7a6768691f432ea29ec52f57ba2546 100755 (executable)
--- a/configure
+++ b/configure
@@ -14988,7 +14988,20 @@ _ACEOF
 
 
  ;;
-                user)      ;;
+                user)
+                               if test "x$AWK" != xgawk; then
+
+                { { $as_echo "$as_me:$LINENO: error:
+       *** Required util gawk missing.  Please install the required
+       *** gawk package for your distribution and try again." >&5
+$as_echo "$as_me: error:
+       *** Required util gawk missing.  Please install the required
+       *** gawk package for your distribution and try again." >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+
+   ;;
                 all)
 
 
@@ -18501,7 +18514,20 @@ _ACEOF
 
 
 
-                           ;;
+
+                               if test "x$AWK" != xgawk; then
+
+                { { $as_echo "$as_me:$LINENO: error:
+       *** Required util gawk missing.  Please install the required
+       *** gawk package for your distribution and try again." >&5
+$as_echo "$as_me: error:
+       *** Required util gawk missing.  Please install the required
+       *** gawk package for your distribution and try again." >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+
+   ;;
                srpm)                        ;;
                 *)
                 { $as_echo "$as_me:$LINENO: result: Error!" >&5
index 956be688223f2774e2462bc0fc5fb79855bee1f5..b9ab7109a33f5433704c8b8be8a2ebd71857d9b2 100644 (file)
@@ -338,7 +338,7 @@ EXPORT_SYMBOL(zone_get_hostid);
  * the requested address.
  */
 #define GET_KALLSYMS_ADDR_CMD                                          \
-       "awk '{ if ( $3 == \"kallsyms_lookup_name\") { print $1 } }' "  \
+       "gawk '{ if ( $3 == \"kallsyms_lookup_name\") { print $1 } }' " \
        "/proc/kallsyms >/proc/sys/kernel/spl/kallsyms_lookup_name"
 
 static int