mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-01-26 18:04:22 +03:00
Remove the gawk dependency.
This reverts commit 1814251453
.
Demote the gawk call back to awk and ensure that stderr is attached. GNU gawk
tolerates a missing stderr handle, but many utilities do not, which could be
why a regular awk call was unexplainably failing on some systems.
Use argv[0] instead of sh_path for consistency internally and with other Linux
drivers.
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
parent
fa6f7d8f9d
commit
ad35b6a6e9
@ -211,25 +211,10 @@ AC_DEFUN([SPL_AC_KERNEL_CONFIG], [
|
|||||||
** You must rebuild your kernel without this option.]), [])
|
** You must rebuild your kernel without this option.]), [])
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl #
|
|
||||||
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.
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([SPL_AC_GAWK], [
|
|
||||||
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.])
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # Default SPL user configuration
|
dnl # Default SPL user configuration
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([SPL_AC_CONFIG_USER], [
|
AC_DEFUN([SPL_AC_CONFIG_USER], [])
|
||||||
SPL_AC_GAWK
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # Check for rpm+rpmbuild to build RPM packages. If these tools
|
dnl # Check for rpm+rpmbuild to build RPM packages. If these tools
|
||||||
|
34
configure
vendored
34
configure
vendored
@ -15719,22 +15719,7 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
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)
|
all)
|
||||||
|
|
||||||
|
|
||||||
@ -19797,22 +19782,7 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;;
|
||||||
|
|
||||||
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) ;;
|
srpm) ;;
|
||||||
*)
|
*)
|
||||||
{ $as_echo "$as_me:$LINENO: result: Error!" >&5
|
{ $as_echo "$as_me:$LINENO: result: Error!" >&5
|
||||||
|
@ -414,21 +414,25 @@ EXPORT_SYMBOL(zone_get_hostid);
|
|||||||
|
|
||||||
#ifndef HAVE_KALLSYMS_LOOKUP_NAME
|
#ifndef HAVE_KALLSYMS_LOOKUP_NAME
|
||||||
/*
|
/*
|
||||||
* Because kallsyms_lookup_name() is no longer exported in the
|
* The kallsyms_lookup_name() kernel function is not an exported symbol in
|
||||||
* mainline kernel we are forced to resort to somewhat drastic
|
* Linux 2.6.19 through 2.6.32 inclusive.
|
||||||
* measures. This function replaces the functionality by performing
|
*
|
||||||
* an upcall to user space where /proc/kallsyms is consulted for
|
* This function replaces the functionality by performing an upcall to user
|
||||||
* the requested address.
|
* space where /proc/kallsyms is consulted for the requested address.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
#define GET_KALLSYMS_ADDR_CMD \
|
|
||||||
"gawk '{ if ( $3 == \"kallsyms_lookup_name\") { print $1 } }' " \
|
#define GET_KALLSYMS_ADDR_CMD \
|
||||||
"/proc/kallsyms >/proc/sys/kernel/spl/kallsyms_lookup_name"
|
"exec 0</dev/null " \
|
||||||
|
" 1>/proc/sys/kernel/spl/kallsyms_lookup_name " \
|
||||||
|
" 2>/dev/null; " \
|
||||||
|
"awk '{ if ( $3 == \"kallsyms_lookup_name\" ) { print $1 } }' " \
|
||||||
|
" /proc/kallsyms "
|
||||||
|
|
||||||
static int
|
static int
|
||||||
set_kallsyms_lookup_name(void)
|
set_kallsyms_lookup_name(void)
|
||||||
{
|
{
|
||||||
char sh_path[] = "/bin/sh";
|
char *argv[] = { "/bin/sh",
|
||||||
char *argv[] = { sh_path,
|
|
||||||
"-c",
|
"-c",
|
||||||
GET_KALLSYMS_ADDR_CMD,
|
GET_KALLSYMS_ADDR_CMD,
|
||||||
NULL };
|
NULL };
|
||||||
@ -438,7 +442,7 @@ set_kallsyms_lookup_name(void)
|
|||||||
NULL };
|
NULL };
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
rc = call_usermodehelper(sh_path, argv, envp, 1);
|
rc = call_usermodehelper(argv[0], argv, envp, 1);
|
||||||
if (rc)
|
if (rc)
|
||||||
printk("SPL: Failed user helper '%s %s %s', rc = %d\n",
|
printk("SPL: Failed user helper '%s %s %s', rc = %d\n",
|
||||||
argv[0], argv[1], argv[2], rc);
|
argv[0], argv[1], argv[2], rc);
|
||||||
|
Loading…
Reference in New Issue
Block a user