From c7cb603f86b4d4fb6567e3faa15b916a306f7004 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 3 Apr 2012 00:01:35 +0000 Subject: Tue Apr 3 00:01:35 UTC 2012 --- ...read-configs-from-lib-depmod.d-modprobe.d.patch | 50 ++++++++++++ ...code-the-path-to-modules-to-be-lib-module.patch | 93 ++++++++++++++++++++++ testing/kmod/PKGBUILD | 22 +++-- testing/kmod/depmod-search.conf | 2 +- 4 files changed, 159 insertions(+), 8 deletions(-) create mode 100644 testing/kmod/0001-split-usr-read-configs-from-lib-depmod.d-modprobe.d.patch create mode 100644 testing/kmod/0002-config-hardcode-the-path-to-modules-to-be-lib-module.patch (limited to 'testing/kmod') diff --git a/testing/kmod/0001-split-usr-read-configs-from-lib-depmod.d-modprobe.d.patch b/testing/kmod/0001-split-usr-read-configs-from-lib-depmod.d-modprobe.d.patch new file mode 100644 index 000000000..bf2c3501f --- /dev/null +++ b/testing/kmod/0001-split-usr-read-configs-from-lib-depmod.d-modprobe.d.patch @@ -0,0 +1,50 @@ +From 666ba68a0635048aea0db70cd9ec61aea9b61ed2 Mon Sep 17 00:00:00 2001 +From: Tom Gundersen +Date: Sat, 3 Mar 2012 12:37:06 +0100 +Subject: [PATCH 1/2] split usr: read configs from /lib/{depmod.d,modprobe.d} + +This allows rootprefix to be set to /usr, even if not all other packages +have been fixed to read from this dir. +--- + libkmod/libkmod.c | 5 +++-- + tools/kmod-depmod.c | 1 + + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/libkmod/libkmod.c b/libkmod/libkmod.c +index 36ca629..12c1112 100644 +--- a/libkmod/libkmod.c ++++ b/libkmod/libkmod.c +@@ -62,6 +62,7 @@ static const char *default_config_paths[] = { + SYSCONFDIR "/modprobe.d", + "/run/modprobe.d", + ROOTPREFIX "/lib/modprobe.d", ++ "/lib/modprobe.d", + NULL + }; + +@@ -223,8 +224,8 @@ static char *get_kernel_release(const char *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 ++ * NULL defaults to /run/modprobe.d, /etc/modprobe.d, ++ * $rootprefix/lib/modprobe.d and /lib/modprobe.d. Give an empty vector if + * configuration should not be read. This array must be null + * terminated. + * +diff --git a/tools/kmod-depmod.c b/tools/kmod-depmod.c +index 1871e18..7bb1c5d 100644 +--- a/tools/kmod-depmod.c ++++ b/tools/kmod-depmod.c +@@ -58,6 +58,7 @@ static const char *default_cfg_paths[] = { + "/run/depmod.d", + SYSCONFDIR "/depmod.d", + ROOTPREFIX "/lib/depmod.d", ++ "/lib/depmod.d", + NULL + }; + +-- +1.7.9.5 + diff --git a/testing/kmod/0002-config-hardcode-the-path-to-modules-to-be-lib-module.patch b/testing/kmod/0002-config-hardcode-the-path-to-modules-to-be-lib-module.patch new file mode 100644 index 000000000..f39f36ace --- /dev/null +++ b/testing/kmod/0002-config-hardcode-the-path-to-modules-to-be-lib-module.patch @@ -0,0 +1,93 @@ +From 53e7e0e42428770578ca0d54d0a9540f498f917f Mon Sep 17 00:00:00 2001 +From: Tom Gundersen +Date: Sat, 31 Mar 2012 12:17:39 +0200 +Subject: [PATCH 2/2] config: hardcode the path to modules to be /lib/modules + +This means that we can move the configuration paths from /lib +to /usr/lib without having to touch the kernel and related +packages. + +That can be dealt with separately at a later location, in which case +all we have to do is revert this patch. + +Signed-off-by: Tom Gundersen +--- + libkmod/libkmod.c | 2 +- + tools/kmod-depmod.c | 2 +- + tools/kmod-modinfo.c | 4 ++-- + tools/kmod-modprobe.c | 4 ++-- + 4 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/libkmod/libkmod.c b/libkmod/libkmod.c +index 12c1112..11edfa0 100644 +--- a/libkmod/libkmod.c ++++ b/libkmod/libkmod.c +@@ -196,7 +196,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) + { +diff --git a/tools/kmod-depmod.c b/tools/kmod-depmod.c +index 7bb1c5d..454d538 100644 +--- a/tools/kmod-depmod.c ++++ b/tools/kmod-depmod.c +@@ -2634,7 +2634,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/kmod-modinfo.c b/tools/kmod-modinfo.c +index aa5223f..b13cd4b 100644 +--- a/tools/kmod-modinfo.c ++++ b/tools/kmod-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/kmod-modprobe.c b/tools/kmod-modprobe.c +index 4760682..ccb41d8 100644 +--- a/tools/kmod-modprobe.c ++++ b/tools/kmod-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" +@@ -973,7 +973,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; + } +-- +1.7.9.5 + diff --git a/testing/kmod/PKGBUILD b/testing/kmod/PKGBUILD index 4752bd55e..a027ee19f 100644 --- a/testing/kmod/PKGBUILD +++ b/testing/kmod/PKGBUILD @@ -1,9 +1,9 @@ -# $Id: PKGBUILD 153751 2012-03-19 12:36:26Z dreisner $ +# $Id: PKGBUILD 155335 2012-04-01 20:12:30Z tomegun $ # Maintainer: Dave Reisner pkgname=kmod pkgver=7 -pkgrel=1 +pkgrel=2 pkgdesc="Linux kernel module handling" arch=('i686' 'x86_64') url='http://git.kernel.org/?p=utils/kernel/kmod/kmod.git;a=summary' @@ -14,16 +14,24 @@ provides=('module-init-tools=3.16') conflicts=('module-init-tools') replaces=('module-init-tools') source=("ftp://ftp.kernel.org/pub/linux/utils/kernel/$pkgname/$pkgname-$pkgver.tar.xz" - "depmod-search.conf") + "depmod-search.conf" + "0001-split-usr-read-configs-from-lib-depmod.d-modprobe.d.patch" + "0002-config-hardcode-the-path-to-modules-to-be-lib-module.patch") md5sums=('7bd916ae1c8a38e7697fdd8118bc98eb' - '09d8af2ba37c5902d904275cb27f1b09') + 'dd62cbf62bd8f212f51ef8c43bec9a77' + 'ba73b9e98db1abbf41274f922fcfbd55' + 'c9af56636c5667cf4ce3a31ea56e03d9') build() { cd "$pkgname-$pkgver" + patch -p1 -i ../0001-split-usr-read-configs-from-lib-depmod.d-modprobe.d.patch + patch -p1 -i ../0002-config-hardcode-the-path-to-modules-to-be-lib-module.patch + ./configure \ --sysconfdir=/etc \ - --with-zlib + --with-zlib \ + --with-rootprefix=/usr make } @@ -36,7 +44,7 @@ package() { make -C "$pkgname-$pkgver" DESTDIR="$pkgdir" install # extra directories - install -dm755 "$pkgdir"/{etc,lib}/{depmod,modprobe}.d "$pkgdir/sbin" + install -dm755 "$pkgdir"/{etc,usr/lib}/{depmod,modprobe}.d "$pkgdir/sbin" # add symlinks to kmod ln -s ../usr/bin/kmod "$pkgdir/sbin/modprobe" @@ -47,7 +55,7 @@ package() { done # install depmod.d file for search/ dir - install -Dm644 "$srcdir/depmod-search.conf" "$pkgdir/lib/depmod.d/search.conf" + install -Dm644 "$srcdir/depmod-search.conf" "$pkgdir/usr/lib/depmod.d/search.conf" } # vim: ft=sh syn=sh et diff --git a/testing/kmod/depmod-search.conf b/testing/kmod/depmod-search.conf index 240606a88..36f2cf7db 100644 --- a/testing/kmod/depmod-search.conf +++ b/testing/kmod/depmod-search.conf @@ -1,5 +1,5 @@ # -# /lib/depmod.d/search.conf +# /usr/lib/depmod.d/search.conf # search updates extramodules built-in -- cgit v1.2.3-54-g00ecf