From c5b37dba8956dd8f82c54b9f97dc5dca07940db5 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Thu, 27 Sep 2012 11:00:42 -0400 Subject: [PATCH] build-sys: Remove --with-rootprefix option This is a broken option that only leads to misery and incompatabilities with other systems. Kbuild doesn't come close to supporting directories other than /lib/modules with several targets simply failing without hacky fixes. Simply remove the option and all traces of it, as it doesn't make sense in today's world. --- Makefile.am | 1 - configure.ac | 6 ------ libkmod/libkmod.c | 11 +++++------ tools/depmod.c | 4 ++-- tools/modinfo.c | 4 ++-- tools/modprobe.c | 4 ++-- 6 files changed, 11 insertions(+), 19 deletions(-) diff --git a/Makefile.am b/Makefile.am index 8e8bcc03..56f00c2f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,7 +13,6 @@ AM_MAKEFLAGS = --no-print-directory AM_CPPFLAGS = \ -include $(top_builddir)/config.h \ -I$(top_srcdir)/libkmod \ - -DROOTPREFIX=\""$(rootprefix)"\" \ -DSYSCONFDIR=\""$(sysconfdir)"\" \ -DLIBEXECDIR=\""$(libexecdir)"\" \ ${zlib_CFLAGS} diff --git a/configure.ac b/configure.ac index 901780b3..2e9124c0 100644 --- a/configure.ac +++ b/configure.ac @@ -49,11 +49,6 @@ AC_CHECK_MEMBERS([struct stat.st_mtim], [], [], [#include ]) # --with- ##################################################################### -AC_ARG_WITH([rootprefix], - AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]), - [], [with_rootprefix=""]) -AC_SUBST([rootprefix], [$with_rootprefix]) - AC_ARG_WITH([rootlibdir], AS_HELP_STRING([--with-rootlibdir=DIR], [rootfs directory to install shared libraries]), [], [with_rootlibdir=$libdir]) @@ -190,7 +185,6 @@ AC_MSG_RESULT([ ====== prefix: ${prefix} - rootprefix: ${rootprefix} sysconfdir: ${sysconfdir} libdir: ${libdir} rootlibdir: ${rootlibdir} diff --git a/libkmod/libkmod.c b/libkmod/libkmod.c index 14a8f1f0..f8984382 100644 --- a/libkmod/libkmod.c +++ b/libkmod/libkmod.c @@ -61,7 +61,7 @@ static struct _index_files { static const char *default_config_paths[] = { SYSCONFDIR "/modprobe.d", "/run/modprobe.d", - ROOTPREFIX "/lib/modprobe.d", + "/lib/modprobe.d", NULL }; @@ -195,7 +195,7 @@ static int log_priority(const char *priority) return 0; } -static const char *dirname_default_prefix = ROOTPREFIX "/lib/modules"; +static const char *dirname_default_prefix = "/lib/modules"; static char *get_kernel_release(const char *dirname) { @@ -217,16 +217,15 @@ static char *get_kernel_release(const char *dirname) /** * kmod_new: * @dirname: what to consider as linux module's directory, if NULL - * defaults to $rootprefix/lib/modules/`uname -r`. If it's relative, + * defaults to /lib/modules/`uname -r`. If it's relative, * it's treated as relative to current the current working * directory. Otherwise, give an absolute dirname. * @config_paths: ordered array of paths (directories or files) where * to load from user-defined configuration parameters such as * alias, blacklists, commands (install, remove). If * NULL defaults to /run/modprobe.d, /etc/modprobe.d and - * $rootprefix/lib/modprobe.d. Give an empty vector if - * configuration should not be read. This array must be null - * terminated. + * /lib/modprobe.d. Give an empty vector if configuration should + * not be read. This array must be null terminated. * * Create kmod library context. This reads the kmod configuration * and fills in the default values. diff --git a/tools/depmod.c b/tools/depmod.c index 834bb059..0bf2deaf 100644 --- a/tools/depmod.c +++ b/tools/depmod.c @@ -57,7 +57,7 @@ static const char CFG_BUILTIN_KEY[] = "built-in"; static const char *default_cfg_paths[] = { "/run/depmod.d", SYSCONFDIR "/depmod.d", - ROOTPREFIX "/lib/depmod.d", + "/lib/depmod.d", NULL }; @@ -2649,7 +2649,7 @@ static int do_depmod(int argc, char *argv[]) } cfg.dirnamelen = snprintf(cfg.dirname, PATH_MAX, - "%s" ROOTPREFIX "/lib/modules/%s", + "%s/lib/modules/%s", root == NULL ? "" : root, cfg.kversion); if (optind == argc) diff --git a/tools/modinfo.c b/tools/modinfo.c index b506f10e..dc419972 100644 --- a/tools/modinfo.c +++ b/tools/modinfo.c @@ -339,7 +339,7 @@ static void help(const char *progname) "\t-0, --null Use \\0 instead of \\n\n" "\t-F, --field=FIELD Print only provided FIELD\n" "\t-k, --set-version=VERSION Use VERSION instead of `uname -r`\n" - "\t-b, --basedir=DIR Use DIR as filesystem root for " ROOTPREFIX "/lib/modules\n" + "\t-b, --basedir=DIR Use DIR as filesystem root for /lib/modules\n" "\t-V, --version Show version\n" "\t-h, --help Show this help\n", progname); @@ -439,7 +439,7 @@ static int do_modinfo(int argc, char *argv[]) } kversion = u.release; } - snprintf(dirname_buf, sizeof(dirname_buf), "%s" ROOTPREFIX "/lib/modules/%s", + snprintf(dirname_buf, sizeof(dirname_buf), "%s/lib/modules/%s", root, kversion); dirname = dirname_buf; } diff --git a/tools/modprobe.c b/tools/modprobe.c index b108112f..b8a64153 100644 --- a/tools/modprobe.c +++ b/tools/modprobe.c @@ -128,7 +128,7 @@ static void help(const char *progname) "\t-n, --show Same as --dry-run\n" "\t-C, --config=FILE Use FILE instead of default search paths\n" - "\t-d, --dirname=DIR Use DIR as filesystem root for " ROOTPREFIX "/lib/modules\n" + "\t-d, --dirname=DIR Use DIR as filesystem root for /lib/modules\n" "\t-S, --set-version=VERSION Use VERSION instead of `uname -r`\n" "\t-s, --syslog print to syslog, not stderr\n" @@ -979,7 +979,7 @@ static int do_modprobe(int argc, char **orig_argv) kversion = u.release; } snprintf(dirname_buf, sizeof(dirname_buf), - "%s" ROOTPREFIX "/lib/modules/%s", root, + "%s/lib/modules/%s", root, kversion); dirname = dirname_buf; } -- 2.47.2