[arch-commits] Commit in kmod/trunk (2 files)

Dave Reisner dreisner at archlinux.org
Fri Aug 14 14:11:52 UTC 2015


    Date: Friday, August 14, 2015 @ 16:11:52
  Author: dreisner
Revision: 243691

upgpkg: kmod 21-2

- backport upstream-suggested fix for return code in error path

Added:
  kmod/trunk/0001-libkmod-module-fix-return-code-in-error-path.patch
Modified:
  kmod/trunk/PKGBUILD

---------------------------------------------------------+
 0001-libkmod-module-fix-return-code-in-error-path.patch |   34 ++++++++++++++
 PKGBUILD                                                |   10 +++-
 2 files changed, 43 insertions(+), 1 deletion(-)

Added: 0001-libkmod-module-fix-return-code-in-error-path.patch
===================================================================
--- 0001-libkmod-module-fix-return-code-in-error-path.patch	                        (rev 0)
+++ 0001-libkmod-module-fix-return-code-in-error-path.patch	2015-08-14 14:11:52 UTC (rev 243691)
@@ -0,0 +1,34 @@
+From 114ec87c85c35a2bd3682f9f891e494127be6fb5 Mon Sep 17 00:00:00 2001
+From: Lucas De Marchi <lucas.demarchi at intel.com>
+Date: Sat, 13 Jun 2015 18:29:47 -0300
+Subject: [PATCH] libkmod-module: fix return code in error path
+
+ENOSYS is the wrong errno to return when we don't find a module in
+kmod_module_insert_module(). Why is it there in the first place?  This
+goes back to kmod v1 when we couldn't load modules by names, but we
+should give a path instead.
+
+708624a ("ELF: initial support for modinfo and strip of modversions and
+vermagic.") changed that so we do a lazy-search by the module path in
+this function. Later  f304afe ("Change error message to reflect
+reality") fixed the log message but the return coded remained the same.
+---
+ libkmod/libkmod-module.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c
+index 366308f..50b2ff9 100644
+--- a/libkmod/libkmod-module.c
++++ b/libkmod/libkmod-module.c
+@@ -830,7 +830,7 @@ KMOD_EXPORT int kmod_module_insert_module(struct kmod_module *mod,
+ 	path = kmod_module_get_path(mod);
+ 	if (path == NULL) {
+ 		ERR(mod->ctx, "could not find module by name='%s'\n", mod->name);
+-		return -ENOSYS;
++		return -ENOENT;
+ 	}
+ 
+ 	mod->file = kmod_file_open(mod->ctx, path);
+-- 
+2.5.0
+

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2015-08-14 13:48:51 UTC (rev 243690)
+++ PKGBUILD	2015-08-14 14:11:52 UTC (rev 243691)
@@ -3,7 +3,7 @@
 
 pkgname=kmod
 pkgver=21
-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'
@@ -17,12 +17,20 @@
 replaces=('module-init-tools')
 validpgpkeys=('EAB33C9690013C733916AC839BA2A5A630CBEA53')  # Lucas DeMarchi
 source=("ftp://ftp.kernel.org/pub/linux/utils/kernel/$pkgname/$pkgname-$pkgver.tar."{xz,sign}
+        '0001-libkmod-module-fix-return-code-in-error-path.patch'
         "depmod-search.conf")
 md5sums=('ee246fab2e1cba9fbdcad6a86ec31531'
          'SKIP'
+         '1825c63bd993a9b8a6b2395a1e25cdc6'
          'dd62cbf62bd8f212f51ef8c43bec9a77')
 
 
+prepare() {
+  cd "$pkgname-$pkgver"
+
+  patch -Np1 <../0001-libkmod-module-fix-return-code-in-error-path.patch
+}
+
 build() {
   cd "$pkgname-$pkgver"
 



More information about the arch-commits mailing list