autofs/SOURCES/autofs-5.1.4-remove-autofs4-module-load-code.patch

223 lines
5.5 KiB
Diff
Raw Normal View History

2021-04-16 06:10:06 +00:00
autofs-5.1.4 - remove autofs4 module load code
From: Ian Kent <raven@themaw.net>
The autofs kernel module has finally been renamed from autofs4 to
autofs so autoloading works so there is no need for manual loading.
The module load function has been commented out in the source for
a long time so there should not be any adverse affects from removing
it.
Signed-off-by: Ian Kent <raven@themaw.net>
---
CHANGELOG | 1
configure | 61 ----------------------------------------------------
configure.in | 1
daemon/automount.c | 8 ------
daemon/module.c | 35 -----------------------------
include/automount.h | 7 -----
include/config.h.in | 6 -----
7 files changed, 1 insertion(+), 118 deletions(-)
--- autofs-5.1.4.orig/CHANGELOG
+++ autofs-5.1.4/CHANGELOG
@@ -38,6 +38,7 @@ xx/xx/2018 autofs-5.1.5
- fix amd parser opts option handling.
- better handle hesiod support not built in.
- fix hesiod string check in master_parse().
+- remove autofs4 module load code.
19/12/2017 autofs-5.1.4
- fix spec file url.
--- autofs-5.1.4.orig/configure
+++ autofs-5.1.4/configure
@@ -659,8 +659,6 @@ PATH_YACC
YACC
PATH_LEX
LEX
-HAVE_MODPROBE
-MODPROBE
HAVE_E4FSCK
E4FSCK
HAVE_E3FSCK
@@ -4155,65 +4153,6 @@ else
HAVE_E4FSCK=0
fi
-for ac_prog in modprobe
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_MODPROBE+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $MODPROBE in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_MODPROBE="$MODPROBE" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $searchpath
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_MODPROBE="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-MODPROBE=$ac_cv_path_MODPROBE
-if test -n "$MODPROBE"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MODPROBE" >&5
-$as_echo "$MODPROBE" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$MODPROBE" && break
-done
-
-if test -n "$MODPROBE"; then
-
-$as_echo "#define HAVE_MODPROBE 1" >>confdefs.h
-
-
-cat >>confdefs.h <<_ACEOF
-#define PATH_MODPROBE "$MODPROBE"
-_ACEOF
-
- HAVE_MODPROBE=1
-else
- HAVE_MODPROBE=0
-fi
-
for ac_prog in flex lex
do
--- autofs-5.1.4.orig/configure.in
+++ autofs-5.1.4/configure.in
@@ -161,7 +161,6 @@ AF_PATH_INCLUDE(UMOUNT, umount, /bin/umo
AF_PATH_INCLUDE(E2FSCK, fsck.ext2 e2fsck, , $searchpath)
AF_PATH_INCLUDE(E3FSCK, fsck.ext3 e3fsck, , $searchpath)
AF_PATH_INCLUDE(E4FSCK, fsck.ext4 e4fsck, , $searchpath)
-AF_PATH_INCLUDE(MODPROBE, modprobe, , $searchpath)
AF_CHECK_PROG(LEX, flex lex, , $searchpath)
AF_CHECK_PROG(YACC, bison, , $searchpath)
--- autofs-5.1.4.orig/daemon/automount.c
+++ autofs-5.1.4/daemon/automount.c
@@ -2336,14 +2336,6 @@ int main(int argc, char *argv[])
exit(exit_code);
}
-#if 0
- if (!load_autofs4_module()) {
- fprintf(stderr, "%s: can't load %s filesystem module.\n",
- program, FS_MODULE_NAME);
- exit(1);
- }
-#endif
-
/* Don't need the kernel module just to look at the configured maps */
if (!dumpmaps && (!query_kproto_ver() || get_kver_major() < 5)) {
fprintf(stderr,
--- autofs-5.1.4.orig/daemon/module.c
+++ autofs-5.1.4/daemon/module.c
@@ -19,41 +19,6 @@
#include "automount.h"
#include "nsswitch.h"
-int load_autofs4_module(void)
-{
- FILE *fp;
- char buf[PATH_MAX];
- int ret;
-
- /*
- * Check if module already loaded or compiled in.
- * If both autofs v3 and v4 are coplied in and
- * the v3 module registers first or the v4 module
- * is an older version we will catch it at mount
- * time.
- */
- fp = open_fopen_r("/proc/filesystems");
- if (!fp) {
- logerr("cannot open /proc/filesystems");
- return 0;
- }
-
- while (fgets(buf, sizeof(buf), fp)) {
- if (strstr(buf, "autofs")) {
- fclose(fp);
- return 1;
- }
- }
- fclose(fp);
-
- ret = spawnl(LOGOPT_NONE, PATH_MODPROBE, PATH_MODPROBE,
- "-q", FS_MODULE_NAME, NULL);
- if (ret)
- return 0;
-
- return 1;
-}
-
int open_lookup(const char *name, const char *err_prefix, const char *mapfmt,
int argc, const char *const *argv, struct lookup_mod **lookup)
{
--- autofs-5.1.4.orig/include/automount.h
+++ autofs-5.1.4/include/automount.h
@@ -52,17 +52,10 @@
#error Failed to locate umount(8)!
#endif
-#ifndef HAVE_MODPROBE
-#error Failed to locate modprobe(8)!
-#endif
-
#ifndef HAVE_LINUX_PROCFS
#error Failed to verify existence of procfs filesystem!
#endif
-#define FS_MODULE_NAME "autofs4"
-int load_autofs4_module(void);
-
/* The -s (sloppy) option to mount is good, if we have it... */
#ifdef HAVE_SLOPPY_MOUNT
--- autofs-5.1.4.orig/include/config.h.in
+++ autofs-5.1.4/include/config.h.in
@@ -48,9 +48,6 @@
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
-/* define if you have MODPROBE */
-#undef HAVE_MODPROBE
-
/* define if you have MOUNT */
#undef HAVE_MOUNT
@@ -129,9 +126,6 @@
/* define if you have LEX */
#undef PATH_LEX
-/* define if you have MODPROBE */
-#undef PATH_MODPROBE
-
/* define if you have MOUNT */
#undef PATH_MOUNT