[arch-commits] Commit in kmod/repos (16 files)

Dave Reisner dreisner at archlinux.org
Sun Jan 8 22:05:14 UTC 2012


    Date: Sunday, January 8, 2012 @ 17:05:13
  Author: dreisner
Revision: 146297

archrelease: copy trunk to testing-i686, testing-x86_64

Added:
  kmod/repos/testing-i686/PKGBUILD
    (from rev 146296, kmod/trunk/PKGBUILD)
  kmod/repos/testing-i686/depmod-search.conf
    (from rev 146296, kmod/trunk/depmod-search.conf)
  kmod/repos/testing-i686/fix-error-path-when-loading-deps.patch
    (from rev 146296, kmod/trunk/fix-error-path-when-loading-deps.patch)
  kmod/repos/testing-i686/return-non-zero-on-fail.patch
    (from rev 146296, kmod/trunk/return-non-zero-on-fail.patch)
  kmod/repos/testing-i686/use-path-max-for-alias-names.patch
    (from rev 146296, kmod/trunk/use-path-max-for-alias-names.patch)
  kmod/repos/testing-x86_64/PKGBUILD
    (from rev 146296, kmod/trunk/PKGBUILD)
  kmod/repos/testing-x86_64/depmod-search.conf
    (from rev 146296, kmod/trunk/depmod-search.conf)
  kmod/repos/testing-x86_64/fix-error-path-when-loading-deps.patch
    (from rev 146296, kmod/trunk/fix-error-path-when-loading-deps.patch)
  kmod/repos/testing-x86_64/return-non-zero-on-fail.patch
    (from rev 146296, kmod/trunk/return-non-zero-on-fail.patch)
  kmod/repos/testing-x86_64/use-path-max-for-alias-names.patch
    (from rev 146296, kmod/trunk/use-path-max-for-alias-names.patch)
Deleted:
  kmod/repos/testing-i686/PKGBUILD
  kmod/repos/testing-i686/depmod-search.conf
  kmod/repos/testing-i686/return-non-zero-on-fail.patch
  kmod/repos/testing-x86_64/PKGBUILD
  kmod/repos/testing-x86_64/depmod-search.conf
  kmod/repos/testing-x86_64/return-non-zero-on-fail.patch

-------------------------------------------------------+
 testing-i686/PKGBUILD                                 |  126 +++++++------
 testing-i686/depmod-search.conf                       |   10 -
 testing-i686/fix-error-path-when-loading-deps.patch   |   35 +++
 testing-i686/return-non-zero-on-fail.patch            |   60 +++---
 testing-i686/use-path-max-for-alias-names.patch       |  147 ++++++++++++++++
 testing-x86_64/PKGBUILD                               |  126 +++++++------
 testing-x86_64/depmod-search.conf                     |   10 -
 testing-x86_64/fix-error-path-when-loading-deps.patch |   35 +++
 testing-x86_64/return-non-zero-on-fail.patch          |   60 +++---
 testing-x86_64/use-path-max-for-alias-names.patch     |  147 ++++++++++++++++
 10 files changed, 566 insertions(+), 190 deletions(-)

Deleted: testing-i686/PKGBUILD
===================================================================
--- testing-i686/PKGBUILD	2012-01-08 22:04:52 UTC (rev 146296)
+++ testing-i686/PKGBUILD	2012-01-08 22:05:13 UTC (rev 146297)
@@ -1,60 +0,0 @@
-# $Id$
-# Maintainer: Dave Reisner <dreisner at archlinux.org>
-
-pkgname=kmod
-pkgver=3
-pkgrel=4
-pkgdesc="Linux kernel module handling"
-arch=('i686' 'x86_64')
-url="http://git.profusion.mobi/cgit.cgi/kmod.git"
-license=('GPL2')
-depends=('glibc' 'zlib')
-options=('!libtool')
-provides=('module-init-tools=3.16')
-conflicts=('module-init-tools')
-replaces=('module-init-tools')
-source=("http://packages.profusion.mobi/$pkgname/$pkgname-$pkgver.tar.xz"
-        "depmod-search.conf"
-        "return-non-zero-on-fail.patch")
-md5sums=('bc0e69f75c2ac22c091f05e166e86c5d'
-         '4b8cbcbc54b9029c99fd730e257d4436'
-         '4be6f783a7fc2d1747ccaa2536d2e88f')
-
-build() {
-  cd "$pkgname-$pkgver"
-
-  patch -Np1 <"$srcdir/return-non-zero-on-fail.patch"
-
-  ./configure \
-    --sysconfdir=/etc \
-    --with-rootprefix= \
-    --with-rootlibdir=/lib \
-    --with-zlib
-
-  make
-}
-
-check() {
-  make -C "$pkgname-$pkgver" check
-}
-
-package() {
-  make -C "$pkgname-$pkgver" DESTDIR="$pkgdir" install
-
-  # binary directories
-  install -dm755 "$pkgdir"/{,s}bin
-
-  # configuration directories
-  install -dm755 "$pkgdir"/{etc,lib}/{depmod,modprobe}.d
-
-  # add symlinks to kmod
-  ln -s /usr/bin/kmod "$pkgdir/bin/lsmod"
-  for tool in {ins,rm,dep}mod mod{info,probe}; do
-    ln -s ../usr/bin/kmod "$pkgdir/sbin/$tool"
-  done
-
-  # install depmod.d file for search/ dir
-  install -Dm644 "$srcdir/depmod-search.conf" "$pkgdir/lib/depmod.d/search.conf"
-}
-
-# vim: ft=sh syn=sh et

Copied: kmod/repos/testing-i686/PKGBUILD (from rev 146296, kmod/trunk/PKGBUILD)
===================================================================
--- testing-i686/PKGBUILD	                        (rev 0)
+++ testing-i686/PKGBUILD	2012-01-08 22:05:13 UTC (rev 146297)
@@ -0,0 +1,66 @@
+# $Id$
+# Maintainer: Dave Reisner <dreisner at archlinux.org>
+
+pkgname=kmod
+pkgver=3
+pkgrel=5
+pkgdesc="Linux kernel module handling"
+arch=('i686' 'x86_64')
+url="http://git.profusion.mobi/cgit.cgi/kmod.git"
+license=('GPL2')
+depends=('glibc' 'zlib')
+options=('!libtool')
+provides=('module-init-tools=3.16')
+conflicts=('module-init-tools')
+replaces=('module-init-tools')
+source=("http://packages.profusion.mobi/$pkgname/$pkgname-$pkgver.tar.xz"
+        "depmod-search.conf"
+        "return-non-zero-on-fail.patch"
+        "use-path-max-for-alias-names.patch"
+        "fix-error-path-when-loading-deps.patch")
+md5sums=('bc0e69f75c2ac22c091f05e166e86c5d'
+         '4b8cbcbc54b9029c99fd730e257d4436'
+         '4be6f783a7fc2d1747ccaa2536d2e88f'
+         '4d801693a6788236b4ed578c24514d62'
+         'd0f01e506e825156760e6129f04eea28')
+
+build() {
+  cd "$pkgname-$pkgver"
+
+  patch -Np1 <"$srcdir/return-non-zero-on-fail.patch"
+  patch -Np1 <"$srcdir/use-path-max-for-alias-names.patch"
+  patch -Np1 <"$srcdir/fix-error-path-when-loading-deps.patch"
+
+  ./configure \
+    --sysconfdir=/etc \
+    --with-rootprefix= \
+    --with-rootlibdir=/lib \
+    --with-zlib
+
+  make
+}
+
+check() {
+  make -C "$pkgname-$pkgver" check
+}
+
+package() {
+  make -C "$pkgname-$pkgver" DESTDIR="$pkgdir" install
+
+  # binary directories
+  install -dm755 "$pkgdir"/{,s}bin
+
+  # configuration directories
+  install -dm755 "$pkgdir"/{etc,lib}/{depmod,modprobe}.d
+
+  # add symlinks to kmod
+  ln -s /usr/bin/kmod "$pkgdir/bin/lsmod"
+  for tool in {ins,rm,dep}mod mod{info,probe}; do
+    ln -s ../usr/bin/kmod "$pkgdir/sbin/$tool"
+  done
+
+  # install depmod.d file for search/ dir
+  install -Dm644 "$srcdir/depmod-search.conf" "$pkgdir/lib/depmod.d/search.conf"
+}
+
+# vim: ft=sh syn=sh et

Deleted: testing-i686/depmod-search.conf
===================================================================
--- testing-i686/depmod-search.conf	2012-01-08 22:04:52 UTC (rev 146296)
+++ testing-i686/depmod-search.conf	2012-01-08 22:05:13 UTC (rev 146297)
@@ -1,5 +0,0 @@
-#
-# /etc/depmod.d/depmod.conf
-#
-
-search updates extramodules built-in

Copied: kmod/repos/testing-i686/depmod-search.conf (from rev 146296, kmod/trunk/depmod-search.conf)
===================================================================
--- testing-i686/depmod-search.conf	                        (rev 0)
+++ testing-i686/depmod-search.conf	2012-01-08 22:05:13 UTC (rev 146297)
@@ -0,0 +1,5 @@
+#
+# /etc/depmod.d/depmod.conf
+#
+
+search updates extramodules built-in

Copied: kmod/repos/testing-i686/fix-error-path-when-loading-deps.patch (from rev 146296, kmod/trunk/fix-error-path-when-loading-deps.patch)
===================================================================
--- testing-i686/fix-error-path-when-loading-deps.patch	                        (rev 0)
+++ testing-i686/fix-error-path-when-loading-deps.patch	2012-01-08 22:05:13 UTC (rev 146297)
@@ -0,0 +1,35 @@
+From cb0d0b72128ac566aad9a72800c5a64af66f0b6e Mon Sep 17 00:00:00 2001
+From: Lucas De Marchi <lucas.demarchi at profusion.mobi>
+Date: Sun, 8 Jan 2012 18:08:05 -0200
+Subject: [PATCH] modprobe: fix error path when loading dependencies
+
+demarchi> scenario is the following:
+demarchi> modA depends on modB and modC
+demarchi> if there's a race when trying to insert a dependency of a module, say
+          modB, it will stop loading all the modules
+demarchi> it should check by "module already loaded error"
+demarchi> like it does for modA
+---
+ tools/kmod-modprobe.c |    4 +++-
+ 1 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/tools/kmod-modprobe.c b/tools/kmod-modprobe.c
+index eaf9346..2cda935 100644
+--- a/tools/kmod-modprobe.c
++++ b/tools/kmod-modprobe.c
+@@ -666,9 +666,11 @@ static int insmod_do_deps_list(struct kmod_module *parent, struct kmod_list *dep
+ 				flags |= KMOD_INSERT_FORCE_VERMAGIC;
+ 
+ 			r = kmod_module_insert_module(dm, flags, opts);
++			if (r == -EEXIST && !first_time)
++				r = 0;
+ 			if (r < 0) {
+ 				WRN("could not insert '%s': %s\n",
+-				    dmname, strerror(-r));
++						dmname, strerror(-r));
+ 				goto dep_error;
+ 			}
+ 		}
+-- 
+1.7.8.1
+

Deleted: testing-i686/return-non-zero-on-fail.patch
===================================================================
--- testing-i686/return-non-zero-on-fail.patch	2012-01-08 22:04:52 UTC (rev 146296)
+++ testing-i686/return-non-zero-on-fail.patch	2012-01-08 22:05:13 UTC (rev 146297)
@@ -1,30 +0,0 @@
-diff --git a/tools/kmod-modinfo.c b/tools/kmod-modinfo.c
-index b6af26f..8506193 100644
---- a/tools/kmod-modinfo.c
-+++ b/tools/kmod-modinfo.c
-@@ -279,6 +279,12 @@ static int modinfo_alias_do(struct kmod_ctx *ctx, const char *alias)
- 		LOG("Module alias %s not found.\n", alias);
- 		return err;
- 	}
-+
-+	if (list == NULL) {
-+		LOG("Module %s not found.\n", alias);
-+		return -ENOENT;
-+	}
-+
- 	kmod_list_foreach(l, list) {
- 		struct kmod_module *mod = kmod_module_get_module(l);
- 		int r = modinfo_do(mod);
-diff --git a/tools/kmod-modprobe.c b/tools/kmod-modprobe.c
-index 8286b9b..6ca94f2 100644
---- a/tools/kmod-modprobe.c
-+++ b/tools/kmod-modprobe.c
-@@ -856,7 +856,7 @@ static int insmod_alias(struct kmod_ctx *ctx, const char *alias, const char *ext
- 
- 	if (list == NULL) {
- 		LOG("Module %s not found.\n", alias);
--		return err;
-+		return -ENOENT;
- 	}
- 
- 	if (use_blacklist) {

Copied: kmod/repos/testing-i686/return-non-zero-on-fail.patch (from rev 146296, kmod/trunk/return-non-zero-on-fail.patch)
===================================================================
--- testing-i686/return-non-zero-on-fail.patch	                        (rev 0)
+++ testing-i686/return-non-zero-on-fail.patch	2012-01-08 22:05:13 UTC (rev 146297)
@@ -0,0 +1,30 @@
+diff --git a/tools/kmod-modinfo.c b/tools/kmod-modinfo.c
+index b6af26f..8506193 100644
+--- a/tools/kmod-modinfo.c
++++ b/tools/kmod-modinfo.c
+@@ -279,6 +279,12 @@ static int modinfo_alias_do(struct kmod_ctx *ctx, const char *alias)
+ 		LOG("Module alias %s not found.\n", alias);
+ 		return err;
+ 	}
++
++	if (list == NULL) {
++		LOG("Module %s not found.\n", alias);
++		return -ENOENT;
++	}
++
+ 	kmod_list_foreach(l, list) {
+ 		struct kmod_module *mod = kmod_module_get_module(l);
+ 		int r = modinfo_do(mod);
+diff --git a/tools/kmod-modprobe.c b/tools/kmod-modprobe.c
+index 8286b9b..6ca94f2 100644
+--- a/tools/kmod-modprobe.c
++++ b/tools/kmod-modprobe.c
+@@ -856,7 +856,7 @@ static int insmod_alias(struct kmod_ctx *ctx, const char *alias, const char *ext
+ 
+ 	if (list == NULL) {
+ 		LOG("Module %s not found.\n", alias);
+-		return err;
++		return -ENOENT;
+ 	}
+ 
+ 	if (use_blacklist) {

Copied: kmod/repos/testing-i686/use-path-max-for-alias-names.patch (from rev 146296, kmod/trunk/use-path-max-for-alias-names.patch)
===================================================================
--- testing-i686/use-path-max-for-alias-names.patch	                        (rev 0)
+++ testing-i686/use-path-max-for-alias-names.patch	2012-01-08 22:05:13 UTC (rev 146297)
@@ -0,0 +1,147 @@
+From 6daceb2f1f4d442ba04752aaa1cf43d554d5f646 Mon Sep 17 00:00:00 2001
+From: Lucas De Marchi <lucas.demarchi at profusion.mobi>
+Date: Sun, 8 Jan 2012 01:02:29 -0200
+Subject: [PATCH] Replace NAME_MAX with PATH_MAX for module aliases
+
+Module aliases can be bigger than NAME_MAX. So, replace with PATH_MAX
+that is bigger enough to hold them.
+
+Technically in some places NAME_MAX would be sufficient (those using
+module names only), but they use functions that can be called with
+alias. So increase the buffers in these cases to PATH_MAX too.
+---
+ libkmod/libkmod-module.c |   10 +++++-----
+ libkmod/libkmod-util.c   |   10 +++++-----
+ libkmod/libkmod-util.h   |    6 +++---
+ tools/kmod-depmod.c      |    4 ++--
+ 4 files changed, 15 insertions(+), 15 deletions(-)
+
+diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c
+index f2359a9..880bac5 100644
+--- a/libkmod/libkmod-module.c
++++ b/libkmod/libkmod-module.c
+@@ -185,7 +185,7 @@ KMOD_EXPORT int kmod_module_new_from_name(struct kmod_ctx *ctx,
+ {
+ 	struct kmod_module *m;
+ 	size_t namelen;
+-	char name_norm[NAME_MAX];
++	char name_norm[PATH_MAX];
+ 	char *namesep;
+ 
+ 	if (ctx == NULL || name == NULL || mod == NULL)
+@@ -237,11 +237,11 @@ int kmod_module_new_from_alias(struct kmod_ctx *ctx, const char *alias,
+ 				const char *name, struct kmod_module **mod)
+ {
+ 	int err;
+-	char key[NAME_MAX];
++	char key[PATH_MAX];
+ 	size_t namelen = strlen(name);
+ 	size_t aliaslen = strlen(alias);
+ 
+-	if (namelen + aliaslen + 2 > NAME_MAX)
++	if (namelen + aliaslen + 2 > PATH_MAX)
+ 		return -ENAMETOOLONG;
+ 
+ 	memcpy(key, name, namelen);
+@@ -283,7 +283,7 @@ KMOD_EXPORT int kmod_module_new_from_path(struct kmod_ctx *ctx,
+ 	struct kmod_module *m;
+ 	int err;
+ 	struct stat st;
+-	char name[NAME_MAX];
++	char name[PATH_MAX];
+ 	char *abspath;
+ 	size_t namelen;
+ 
+@@ -434,7 +434,7 @@ KMOD_EXPORT int kmod_module_new_from_lookup(struct kmod_ctx *ctx,
+ 						struct kmod_list **list)
+ {
+ 	int err;
+-	char alias[NAME_MAX];
++	char alias[PATH_MAX];
+ 
+ 	if (ctx == NULL || given_alias == NULL)
+ 		return -ENOENT;
+diff --git a/libkmod/libkmod-util.c b/libkmod/libkmod-util.c
+index 75e2fea..344d94a 100644
+--- a/libkmod/libkmod-util.c
++++ b/libkmod/libkmod-util.c
+@@ -121,11 +121,11 @@ char *underscores(struct kmod_ctx *ctx, char *s)
+ 	return s;
+ }
+ 
+-inline int alias_normalize(const char *alias, char buf[NAME_MAX], size_t *len)
++inline int alias_normalize(const char *alias, char buf[PATH_MAX], size_t *len)
+ {
+ 	size_t s;
+ 
+-	for (s = 0; s < NAME_MAX - 1; s++) {
++	for (s = 0; s < PATH_MAX - 1; s++) {
+ 		const char c = alias[s];
+ 		switch (c) {
+ 		case '-':
+@@ -160,12 +160,12 @@ finish:
+ 	return 0;
+ }
+ 
+-inline char *modname_normalize(const char *modname, char buf[NAME_MAX],
++inline char *modname_normalize(const char *modname, char buf[PATH_MAX],
+ 								size_t *len)
+ {
+ 	size_t s;
+ 
+-	for (s = 0; s < NAME_MAX - 1; s++) {
++	for (s = 0; s < PATH_MAX - 1; s++) {
+ 		const char c = modname[s];
+ 		if (c == '-')
+ 			buf[s] = '_';
+@@ -183,7 +183,7 @@ inline char *modname_normalize(const char *modname, char buf[NAME_MAX],
+ 	return buf;
+ }
+ 
+-char *path_to_modname(const char *path, char buf[NAME_MAX], size_t *len)
++char *path_to_modname(const char *path, char buf[PATH_MAX], size_t *len)
+ {
+ 	char *modname;
+ 
+diff --git a/libkmod/libkmod-util.h b/libkmod/libkmod-util.h
+index 3cd352c..e8ed5ad 100644
+--- a/libkmod/libkmod-util.h
++++ b/libkmod/libkmod-util.h
+@@ -20,9 +20,9 @@ int read_str_ulong(int fd, unsigned long *value, int base) __must_check __attrib
+ char *strchr_replace(char *s, int c, char r);
+ bool path_is_absolute(const char *p) __must_check __attribute__((nonnull(1)));
+ char *path_make_absolute_cwd(const char *p) __must_check __attribute__((nonnull(1)));
+-int alias_normalize(const char *alias, char buf[NAME_MAX], size_t *len) __must_check __attribute__((nonnull(1,2)));
+-char *modname_normalize(const char *modname, char buf[NAME_MAX], size_t *len) __attribute__((nonnull(1, 2)));
+-char *path_to_modname(const char *path, char buf[NAME_MAX], size_t *len) __attribute__((nonnull(2)));
++int alias_normalize(const char *alias, char buf[PATH_MAX], size_t *len) __must_check __attribute__((nonnull(1,2)));
++char *modname_normalize(const char *modname, char buf[PATH_MAX], size_t *len) __attribute__((nonnull(1, 2)));
++char *path_to_modname(const char *path, char buf[PATH_MAX], size_t *len) __attribute__((nonnull(2)));
+ unsigned long long ts_usec(const struct timespec *ts);
+ 
+ #endif
+diff --git a/tools/kmod-depmod.c b/tools/kmod-depmod.c
+index 70c397c..4726522 100644
+--- a/tools/kmod-depmod.c
++++ b/tools/kmod-depmod.c
+@@ -1249,7 +1249,7 @@ static int depmod_modules_search_file(struct depmod *depmod, size_t baselen, siz
+ 	struct kmod_module *kmod;
+ 	struct mod *mod;
+ 	const char *relpath;
+-	char modname[NAME_MAX];
++	char modname[PATH_MAX];
+ 	const struct kmod_ext *eitr;
+ 	size_t modnamelen;
+ 	uint8_t matches = 0;
+@@ -2101,7 +2101,7 @@ static int output_builtin_bin(struct depmod *depmod, FILE *out)
+ {
+ 	FILE *in;
+ 	struct index_node *idx;
+-	char infile[PATH_MAX], line[PATH_MAX], modname[NAME_MAX];
++	char infile[PATH_MAX], line[PATH_MAX], modname[PATH_MAX];
+ 
+ 	if (out == stdout)
+ 		return 0;
+-- 
+1.7.8.1
+

Deleted: testing-x86_64/PKGBUILD
===================================================================
--- testing-x86_64/PKGBUILD	2012-01-08 22:04:52 UTC (rev 146296)
+++ testing-x86_64/PKGBUILD	2012-01-08 22:05:13 UTC (rev 146297)
@@ -1,60 +0,0 @@
-# $Id$
-# Maintainer: Dave Reisner <dreisner at archlinux.org>
-
-pkgname=kmod
-pkgver=3
-pkgrel=4
-pkgdesc="Linux kernel module handling"
-arch=('i686' 'x86_64')
-url="http://git.profusion.mobi/cgit.cgi/kmod.git"
-license=('GPL2')
-depends=('glibc' 'zlib')
-options=('!libtool')
-provides=('module-init-tools=3.16')
-conflicts=('module-init-tools')
-replaces=('module-init-tools')
-source=("http://packages.profusion.mobi/$pkgname/$pkgname-$pkgver.tar.xz"
-        "depmod-search.conf"
-        "return-non-zero-on-fail.patch")
-md5sums=('bc0e69f75c2ac22c091f05e166e86c5d'
-         '4b8cbcbc54b9029c99fd730e257d4436'
-         '4be6f783a7fc2d1747ccaa2536d2e88f')
-
-build() {
-  cd "$pkgname-$pkgver"
-
-  patch -Np1 <"$srcdir/return-non-zero-on-fail.patch"
-
-  ./configure \
-    --sysconfdir=/etc \
-    --with-rootprefix= \
-    --with-rootlibdir=/lib \
-    --with-zlib
-
-  make
-}
-
-check() {
-  make -C "$pkgname-$pkgver" check
-}
-
-package() {
-  make -C "$pkgname-$pkgver" DESTDIR="$pkgdir" install
-
-  # binary directories
-  install -dm755 "$pkgdir"/{,s}bin
-
-  # configuration directories
-  install -dm755 "$pkgdir"/{etc,lib}/{depmod,modprobe}.d
-
-  # add symlinks to kmod
-  ln -s /usr/bin/kmod "$pkgdir/bin/lsmod"
-  for tool in {ins,rm,dep}mod mod{info,probe}; do
-    ln -s ../usr/bin/kmod "$pkgdir/sbin/$tool"
-  done
-
-  # install depmod.d file for search/ dir
-  install -Dm644 "$srcdir/depmod-search.conf" "$pkgdir/lib/depmod.d/search.conf"
-}
-
-# vim: ft=sh syn=sh et

Copied: kmod/repos/testing-x86_64/PKGBUILD (from rev 146296, kmod/trunk/PKGBUILD)
===================================================================
--- testing-x86_64/PKGBUILD	                        (rev 0)
+++ testing-x86_64/PKGBUILD	2012-01-08 22:05:13 UTC (rev 146297)
@@ -0,0 +1,66 @@
+# $Id$
+# Maintainer: Dave Reisner <dreisner at archlinux.org>
+
+pkgname=kmod
+pkgver=3
+pkgrel=5
+pkgdesc="Linux kernel module handling"
+arch=('i686' 'x86_64')
+url="http://git.profusion.mobi/cgit.cgi/kmod.git"
+license=('GPL2')
+depends=('glibc' 'zlib')
+options=('!libtool')
+provides=('module-init-tools=3.16')
+conflicts=('module-init-tools')
+replaces=('module-init-tools')
+source=("http://packages.profusion.mobi/$pkgname/$pkgname-$pkgver.tar.xz"
+        "depmod-search.conf"
+        "return-non-zero-on-fail.patch"
+        "use-path-max-for-alias-names.patch"
+        "fix-error-path-when-loading-deps.patch")
+md5sums=('bc0e69f75c2ac22c091f05e166e86c5d'
+         '4b8cbcbc54b9029c99fd730e257d4436'
+         '4be6f783a7fc2d1747ccaa2536d2e88f'
+         '4d801693a6788236b4ed578c24514d62'
+         'd0f01e506e825156760e6129f04eea28')
+
+build() {
+  cd "$pkgname-$pkgver"
+
+  patch -Np1 <"$srcdir/return-non-zero-on-fail.patch"
+  patch -Np1 <"$srcdir/use-path-max-for-alias-names.patch"
+  patch -Np1 <"$srcdir/fix-error-path-when-loading-deps.patch"
+
+  ./configure \
+    --sysconfdir=/etc \
+    --with-rootprefix= \
+    --with-rootlibdir=/lib \
+    --with-zlib
+
+  make
+}
+
+check() {
+  make -C "$pkgname-$pkgver" check
+}
+
+package() {
+  make -C "$pkgname-$pkgver" DESTDIR="$pkgdir" install
+
+  # binary directories
+  install -dm755 "$pkgdir"/{,s}bin
+
+  # configuration directories
+  install -dm755 "$pkgdir"/{etc,lib}/{depmod,modprobe}.d
+
+  # add symlinks to kmod
+  ln -s /usr/bin/kmod "$pkgdir/bin/lsmod"
+  for tool in {ins,rm,dep}mod mod{info,probe}; do
+    ln -s ../usr/bin/kmod "$pkgdir/sbin/$tool"
+  done
+
+  # install depmod.d file for search/ dir
+  install -Dm644 "$srcdir/depmod-search.conf" "$pkgdir/lib/depmod.d/search.conf"
+}
+
+# vim: ft=sh syn=sh et

Deleted: testing-x86_64/depmod-search.conf
===================================================================
--- testing-x86_64/depmod-search.conf	2012-01-08 22:04:52 UTC (rev 146296)
+++ testing-x86_64/depmod-search.conf	2012-01-08 22:05:13 UTC (rev 146297)
@@ -1,5 +0,0 @@
-#
-# /etc/depmod.d/depmod.conf
-#
-
-search updates extramodules built-in

Copied: kmod/repos/testing-x86_64/depmod-search.conf (from rev 146296, kmod/trunk/depmod-search.conf)
===================================================================
--- testing-x86_64/depmod-search.conf	                        (rev 0)
+++ testing-x86_64/depmod-search.conf	2012-01-08 22:05:13 UTC (rev 146297)
@@ -0,0 +1,5 @@
+#
+# /etc/depmod.d/depmod.conf
+#
+
+search updates extramodules built-in

Copied: kmod/repos/testing-x86_64/fix-error-path-when-loading-deps.patch (from rev 146296, kmod/trunk/fix-error-path-when-loading-deps.patch)
===================================================================
--- testing-x86_64/fix-error-path-when-loading-deps.patch	                        (rev 0)
+++ testing-x86_64/fix-error-path-when-loading-deps.patch	2012-01-08 22:05:13 UTC (rev 146297)
@@ -0,0 +1,35 @@
+From cb0d0b72128ac566aad9a72800c5a64af66f0b6e Mon Sep 17 00:00:00 2001
+From: Lucas De Marchi <lucas.demarchi at profusion.mobi>
+Date: Sun, 8 Jan 2012 18:08:05 -0200
+Subject: [PATCH] modprobe: fix error path when loading dependencies
+
+demarchi> scenario is the following:
+demarchi> modA depends on modB and modC
+demarchi> if there's a race when trying to insert a dependency of a module, say
+          modB, it will stop loading all the modules
+demarchi> it should check by "module already loaded error"
+demarchi> like it does for modA
+---
+ tools/kmod-modprobe.c |    4 +++-
+ 1 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/tools/kmod-modprobe.c b/tools/kmod-modprobe.c
+index eaf9346..2cda935 100644
+--- a/tools/kmod-modprobe.c
++++ b/tools/kmod-modprobe.c
+@@ -666,9 +666,11 @@ static int insmod_do_deps_list(struct kmod_module *parent, struct kmod_list *dep
+ 				flags |= KMOD_INSERT_FORCE_VERMAGIC;
+ 
+ 			r = kmod_module_insert_module(dm, flags, opts);
++			if (r == -EEXIST && !first_time)
++				r = 0;
+ 			if (r < 0) {
+ 				WRN("could not insert '%s': %s\n",
+-				    dmname, strerror(-r));
++						dmname, strerror(-r));
+ 				goto dep_error;
+ 			}
+ 		}
+-- 
+1.7.8.1
+

Deleted: testing-x86_64/return-non-zero-on-fail.patch
===================================================================
--- testing-x86_64/return-non-zero-on-fail.patch	2012-01-08 22:04:52 UTC (rev 146296)
+++ testing-x86_64/return-non-zero-on-fail.patch	2012-01-08 22:05:13 UTC (rev 146297)
@@ -1,30 +0,0 @@
-diff --git a/tools/kmod-modinfo.c b/tools/kmod-modinfo.c
-index b6af26f..8506193 100644
---- a/tools/kmod-modinfo.c
-+++ b/tools/kmod-modinfo.c
-@@ -279,6 +279,12 @@ static int modinfo_alias_do(struct kmod_ctx *ctx, const char *alias)
- 		LOG("Module alias %s not found.\n", alias);
- 		return err;
- 	}
-+
-+	if (list == NULL) {
-+		LOG("Module %s not found.\n", alias);
-+		return -ENOENT;
-+	}
-+
- 	kmod_list_foreach(l, list) {
- 		struct kmod_module *mod = kmod_module_get_module(l);
- 		int r = modinfo_do(mod);
-diff --git a/tools/kmod-modprobe.c b/tools/kmod-modprobe.c
-index 8286b9b..6ca94f2 100644
---- a/tools/kmod-modprobe.c
-+++ b/tools/kmod-modprobe.c
-@@ -856,7 +856,7 @@ static int insmod_alias(struct kmod_ctx *ctx, const char *alias, const char *ext
- 
- 	if (list == NULL) {
- 		LOG("Module %s not found.\n", alias);
--		return err;
-+		return -ENOENT;
- 	}
- 
- 	if (use_blacklist) {

Copied: kmod/repos/testing-x86_64/return-non-zero-on-fail.patch (from rev 146296, kmod/trunk/return-non-zero-on-fail.patch)
===================================================================
--- testing-x86_64/return-non-zero-on-fail.patch	                        (rev 0)
+++ testing-x86_64/return-non-zero-on-fail.patch	2012-01-08 22:05:13 UTC (rev 146297)
@@ -0,0 +1,30 @@
+diff --git a/tools/kmod-modinfo.c b/tools/kmod-modinfo.c
+index b6af26f..8506193 100644
+--- a/tools/kmod-modinfo.c
++++ b/tools/kmod-modinfo.c
+@@ -279,6 +279,12 @@ static int modinfo_alias_do(struct kmod_ctx *ctx, const char *alias)
+ 		LOG("Module alias %s not found.\n", alias);
+ 		return err;
+ 	}
++
++	if (list == NULL) {
++		LOG("Module %s not found.\n", alias);
++		return -ENOENT;
++	}
++
+ 	kmod_list_foreach(l, list) {
+ 		struct kmod_module *mod = kmod_module_get_module(l);
+ 		int r = modinfo_do(mod);
+diff --git a/tools/kmod-modprobe.c b/tools/kmod-modprobe.c
+index 8286b9b..6ca94f2 100644
+--- a/tools/kmod-modprobe.c
++++ b/tools/kmod-modprobe.c
+@@ -856,7 +856,7 @@ static int insmod_alias(struct kmod_ctx *ctx, const char *alias, const char *ext
+ 
+ 	if (list == NULL) {
+ 		LOG("Module %s not found.\n", alias);
+-		return err;
++		return -ENOENT;
+ 	}
+ 
+ 	if (use_blacklist) {

Copied: kmod/repos/testing-x86_64/use-path-max-for-alias-names.patch (from rev 146296, kmod/trunk/use-path-max-for-alias-names.patch)
===================================================================
--- testing-x86_64/use-path-max-for-alias-names.patch	                        (rev 0)
+++ testing-x86_64/use-path-max-for-alias-names.patch	2012-01-08 22:05:13 UTC (rev 146297)
@@ -0,0 +1,147 @@
+From 6daceb2f1f4d442ba04752aaa1cf43d554d5f646 Mon Sep 17 00:00:00 2001
+From: Lucas De Marchi <lucas.demarchi at profusion.mobi>
+Date: Sun, 8 Jan 2012 01:02:29 -0200
+Subject: [PATCH] Replace NAME_MAX with PATH_MAX for module aliases
+
+Module aliases can be bigger than NAME_MAX. So, replace with PATH_MAX
+that is bigger enough to hold them.
+
+Technically in some places NAME_MAX would be sufficient (those using
+module names only), but they use functions that can be called with
+alias. So increase the buffers in these cases to PATH_MAX too.
+---
+ libkmod/libkmod-module.c |   10 +++++-----
+ libkmod/libkmod-util.c   |   10 +++++-----
+ libkmod/libkmod-util.h   |    6 +++---
+ tools/kmod-depmod.c      |    4 ++--
+ 4 files changed, 15 insertions(+), 15 deletions(-)
+
+diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c
+index f2359a9..880bac5 100644
+--- a/libkmod/libkmod-module.c
++++ b/libkmod/libkmod-module.c
+@@ -185,7 +185,7 @@ KMOD_EXPORT int kmod_module_new_from_name(struct kmod_ctx *ctx,
+ {
+ 	struct kmod_module *m;
+ 	size_t namelen;
+-	char name_norm[NAME_MAX];
++	char name_norm[PATH_MAX];
+ 	char *namesep;
+ 
+ 	if (ctx == NULL || name == NULL || mod == NULL)
+@@ -237,11 +237,11 @@ int kmod_module_new_from_alias(struct kmod_ctx *ctx, const char *alias,
+ 				const char *name, struct kmod_module **mod)
+ {
+ 	int err;
+-	char key[NAME_MAX];
++	char key[PATH_MAX];
+ 	size_t namelen = strlen(name);
+ 	size_t aliaslen = strlen(alias);
+ 
+-	if (namelen + aliaslen + 2 > NAME_MAX)
++	if (namelen + aliaslen + 2 > PATH_MAX)
+ 		return -ENAMETOOLONG;
+ 
+ 	memcpy(key, name, namelen);
+@@ -283,7 +283,7 @@ KMOD_EXPORT int kmod_module_new_from_path(struct kmod_ctx *ctx,
+ 	struct kmod_module *m;
+ 	int err;
+ 	struct stat st;
+-	char name[NAME_MAX];
++	char name[PATH_MAX];
+ 	char *abspath;
+ 	size_t namelen;
+ 
+@@ -434,7 +434,7 @@ KMOD_EXPORT int kmod_module_new_from_lookup(struct kmod_ctx *ctx,
+ 						struct kmod_list **list)
+ {
+ 	int err;
+-	char alias[NAME_MAX];
++	char alias[PATH_MAX];
+ 
+ 	if (ctx == NULL || given_alias == NULL)
+ 		return -ENOENT;
+diff --git a/libkmod/libkmod-util.c b/libkmod/libkmod-util.c
+index 75e2fea..344d94a 100644
+--- a/libkmod/libkmod-util.c
++++ b/libkmod/libkmod-util.c
+@@ -121,11 +121,11 @@ char *underscores(struct kmod_ctx *ctx, char *s)
+ 	return s;
+ }
+ 
+-inline int alias_normalize(const char *alias, char buf[NAME_MAX], size_t *len)
++inline int alias_normalize(const char *alias, char buf[PATH_MAX], size_t *len)
+ {
+ 	size_t s;
+ 
+-	for (s = 0; s < NAME_MAX - 1; s++) {
++	for (s = 0; s < PATH_MAX - 1; s++) {
+ 		const char c = alias[s];
+ 		switch (c) {
+ 		case '-':
+@@ -160,12 +160,12 @@ finish:
+ 	return 0;
+ }
+ 
+-inline char *modname_normalize(const char *modname, char buf[NAME_MAX],
++inline char *modname_normalize(const char *modname, char buf[PATH_MAX],
+ 								size_t *len)
+ {
+ 	size_t s;
+ 
+-	for (s = 0; s < NAME_MAX - 1; s++) {
++	for (s = 0; s < PATH_MAX - 1; s++) {
+ 		const char c = modname[s];
+ 		if (c == '-')
+ 			buf[s] = '_';
+@@ -183,7 +183,7 @@ inline char *modname_normalize(const char *modname, char buf[NAME_MAX],
+ 	return buf;
+ }
+ 
+-char *path_to_modname(const char *path, char buf[NAME_MAX], size_t *len)
++char *path_to_modname(const char *path, char buf[PATH_MAX], size_t *len)
+ {
+ 	char *modname;
+ 
+diff --git a/libkmod/libkmod-util.h b/libkmod/libkmod-util.h
+index 3cd352c..e8ed5ad 100644
+--- a/libkmod/libkmod-util.h
++++ b/libkmod/libkmod-util.h
+@@ -20,9 +20,9 @@ int read_str_ulong(int fd, unsigned long *value, int base) __must_check __attrib
+ char *strchr_replace(char *s, int c, char r);
+ bool path_is_absolute(const char *p) __must_check __attribute__((nonnull(1)));
+ char *path_make_absolute_cwd(const char *p) __must_check __attribute__((nonnull(1)));
+-int alias_normalize(const char *alias, char buf[NAME_MAX], size_t *len) __must_check __attribute__((nonnull(1,2)));
+-char *modname_normalize(const char *modname, char buf[NAME_MAX], size_t *len) __attribute__((nonnull(1, 2)));
+-char *path_to_modname(const char *path, char buf[NAME_MAX], size_t *len) __attribute__((nonnull(2)));
++int alias_normalize(const char *alias, char buf[PATH_MAX], size_t *len) __must_check __attribute__((nonnull(1,2)));
++char *modname_normalize(const char *modname, char buf[PATH_MAX], size_t *len) __attribute__((nonnull(1, 2)));
++char *path_to_modname(const char *path, char buf[PATH_MAX], size_t *len) __attribute__((nonnull(2)));
+ unsigned long long ts_usec(const struct timespec *ts);
+ 
+ #endif
+diff --git a/tools/kmod-depmod.c b/tools/kmod-depmod.c
+index 70c397c..4726522 100644
+--- a/tools/kmod-depmod.c
++++ b/tools/kmod-depmod.c
+@@ -1249,7 +1249,7 @@ static int depmod_modules_search_file(struct depmod *depmod, size_t baselen, siz
+ 	struct kmod_module *kmod;
+ 	struct mod *mod;
+ 	const char *relpath;
+-	char modname[NAME_MAX];
++	char modname[PATH_MAX];
+ 	const struct kmod_ext *eitr;
+ 	size_t modnamelen;
+ 	uint8_t matches = 0;
+@@ -2101,7 +2101,7 @@ static int output_builtin_bin(struct depmod *depmod, FILE *out)
+ {
+ 	FILE *in;
+ 	struct index_node *idx;
+-	char infile[PATH_MAX], line[PATH_MAX], modname[NAME_MAX];
++	char infile[PATH_MAX], line[PATH_MAX], modname[PATH_MAX];
+ 
+ 	if (out == stdout)
+ 		return 0;
+-- 
+1.7.8.1
+




More information about the arch-commits mailing list