[arch-commits] Commit in kmod/trunk (3 files)
Date: Tuesday, December 4, 2012 @ 22:56:13 Author: dreisner Revision: 172761 upgpkg: kmod 12-1 Modified: kmod/trunk/PKGBUILD Deleted: kmod/trunk/0001-depmod-fix-hash-lookup-by-relpath-instead-of-uncrelp.patch kmod/trunk/0002-depmod-fix-asserting-mod-kmod-NULL.patch -+ 0001-depmod-fix-hash-lookup-by-relpath-instead-of-uncrelp.patch | 43 -- 0002-depmod-fix-asserting-mod-kmod-NULL.patch | 31 --- PKGBUILD| 16 --- 3 files changed, 3 insertions(+), 87 deletions(-) Deleted: 0001-depmod-fix-hash-lookup-by-relpath-instead-of-uncrelp.patch === --- 0001-depmod-fix-hash-lookup-by-relpath-instead-of-uncrelp.patch 2012-12-04 22:55:41 UTC (rev 172760) +++ 0001-depmod-fix-hash-lookup-by-relpath-instead-of-uncrelp.patch 2012-12-05 03:56:13 UTC (rev 172761) @@ -1,43 +0,0 @@ -From 06294621a944e4611e15ce8201df80870e052e7d Mon Sep 17 00:00:00 2001 -From: Lucas De Marchi lucas.demar...@profusion.mobi -Date: Fri, 16 Nov 2012 11:35:30 -0200 -Subject: [PATCH 1/2] depmod: fix hash lookup by relpath instead of uncrelpath - -We index modules in depmod by it's uncompressed relative path, not -relative path. We didn't notice this bug before since this function is -only triggered if we release a module to be replaced by one of higher -priority. - -Also fix a leftover log message referring to relpath instead of -uncrelpath. - tools/depmod.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/tools/depmod.c b/tools/depmod.c -index cc9346f..aafe66b 100644 a/tools/depmod.c -+++ b/tools/depmod.c -@@ -1114,7 +1114,7 @@ static int depmod_module_add(struct depmod *depmod, struct kmod_module *kmod) - mod-uncrelpath, mod); - if (err 0) { - ERR(hash_add_unique %s: %s\n, -- mod-relpath, strerror(-err)); -+ mod-uncrelpath, strerror(-err)); - hash_del(depmod-modules_by_name, mod-modname); - goto fail; - } -@@ -1134,8 +1134,8 @@ static int depmod_module_del(struct depmod *depmod, struct mod *mod) - { - DBG(del %p kmod=%p, path=%s\n, mod, mod-kmod, mod-path); - -- if (mod-relpath != NULL) -- hash_del(depmod-modules_by_uncrelpath, mod-relpath); -+ if (mod-uncrelpath != NULL) -+ hash_del(depmod-modules_by_uncrelpath, mod-uncrelpath); - - hash_del(depmod-modules_by_name, mod-modname); - --- -1.8.0 - Deleted: 0002-depmod-fix-asserting-mod-kmod-NULL.patch === --- 0002-depmod-fix-asserting-mod-kmod-NULL.patch 2012-12-04 22:55:41 UTC (rev 172760) +++ 0002-depmod-fix-asserting-mod-kmod-NULL.patch 2012-12-05 03:56:13 UTC (rev 172761) @@ -1,31 +0,0 @@ -From 02c64df3c2b33880b18d3f4aba9fa8e48e5ca904 Mon Sep 17 00:00:00 2001 -From: Lucas De Marchi lucas.demar...@profusion.mobi -Date: Fri, 16 Nov 2012 12:05:42 -0200 -Subject: [PATCH 2/2] depmod: fix asserting mod-kmod == NULL - -If we are replacing a lower priority module (due to its location), we -already created a kmod_module, but didn't open the file for reading its -symbols. This means mod-kmod won't be NULL, and this is just ok. Since -all the functions freeing stuff below the previous assert already takes -NULL into consideration, it's safe to just unref mod-kmod and let the -right thing happens. - tools/depmod.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tools/depmod.c b/tools/depmod.c -index aafe66b..7bbdcd3 100644 a/tools/depmod.c -+++ b/tools/depmod.c -@@ -977,7 +977,7 @@ static void mod_free(struct mod *mod) - { - DBG(free %p kmod=%p, path=%s\n, mod, mod-kmod, mod-path); - array_free_array(mod-deps); -- assert(mod-kmod == NULL); -+ kmod_module_unref(mod-kmod); - kmod_module_info_free_list(mod-info_list); - kmod_module_dependency_symbols_free_list(mod-dep_sym_list); - free(mod-uncrelpath); --- -1.8.0 - Modified: PKGBUILD === --- PKGBUILD2012-12-04 22:55:41 UTC (rev 172760) +++ PKGBUILD2012-12-05 03:56:13 UTC (rev 172761) @@ -2,8 +2,8 @@ # Maintainer: Dave Reisner dreis...@archlinux.org pkgname=kmod -pkgver=11 -pkgrel=2 +pkgver=12 +pkgrel=1 pkgdesc=Linux kernel module handling arch=('i686' 'x86_64') url='http://git.kernel.org/?p=utils/kernel/kmod/kmod.git;a=summary' @@ -15,23 +15,13 @@ conflicts=('module-init-tools') replaces=('module-init-tools') source=(ftp://ftp.kernel.org/pub/linux/utils/kernel/$pkgname/$pkgname-$pkgver.tar.xz; -0001-depmod-fix-hash-lookup-by-relpath-instead-of-uncrelp.patch -0002-depmod-fix-asserting-mod-kmod-NULL.patch
[arch-commits] Commit in kmod/trunk (3 files)
Date: Friday, November 16, 2012 @ 21:23:30 Author: dreisner Revision: 171299 upgpkg: kmod 11-2 - backport fixes for depmod assertion failure (FS#32671) Added: kmod/trunk/0001-depmod-fix-hash-lookup-by-relpath-instead-of-uncrelp.patch kmod/trunk/0002-depmod-fix-asserting-mod-kmod-NULL.patch Modified: kmod/trunk/PKGBUILD -+ 0001-depmod-fix-hash-lookup-by-relpath-instead-of-uncrelp.patch | 43 ++ 0002-depmod-fix-asserting-mod-kmod-NULL.patch | 31 +++ PKGBUILD| 12 ++ 3 files changed, 85 insertions(+), 1 deletion(-) Added: 0001-depmod-fix-hash-lookup-by-relpath-instead-of-uncrelp.patch === --- 0001-depmod-fix-hash-lookup-by-relpath-instead-of-uncrelp.patch (rev 0) +++ 0001-depmod-fix-hash-lookup-by-relpath-instead-of-uncrelp.patch 2012-11-17 02:23:30 UTC (rev 171299) @@ -0,0 +1,43 @@ +From 06294621a944e4611e15ce8201df80870e052e7d Mon Sep 17 00:00:00 2001 +From: Lucas De Marchi lucas.demar...@profusion.mobi +Date: Fri, 16 Nov 2012 11:35:30 -0200 +Subject: [PATCH 1/2] depmod: fix hash lookup by relpath instead of uncrelpath + +We index modules in depmod by it's uncompressed relative path, not +relative path. We didn't notice this bug before since this function is +only triggered if we release a module to be replaced by one of higher +priority. + +Also fix a leftover log message referring to relpath instead of +uncrelpath. +--- + tools/depmod.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tools/depmod.c b/tools/depmod.c +index cc9346f..aafe66b 100644 +--- a/tools/depmod.c b/tools/depmod.c +@@ -1114,7 +1114,7 @@ static int depmod_module_add(struct depmod *depmod, struct kmod_module *kmod) + mod-uncrelpath, mod); + if (err 0) { + ERR(hash_add_unique %s: %s\n, +- mod-relpath, strerror(-err)); ++ mod-uncrelpath, strerror(-err)); + hash_del(depmod-modules_by_name, mod-modname); + goto fail; + } +@@ -1134,8 +1134,8 @@ static int depmod_module_del(struct depmod *depmod, struct mod *mod) + { + DBG(del %p kmod=%p, path=%s\n, mod, mod-kmod, mod-path); + +- if (mod-relpath != NULL) +- hash_del(depmod-modules_by_uncrelpath, mod-relpath); ++ if (mod-uncrelpath != NULL) ++ hash_del(depmod-modules_by_uncrelpath, mod-uncrelpath); + + hash_del(depmod-modules_by_name, mod-modname); + +-- +1.8.0 + Added: 0002-depmod-fix-asserting-mod-kmod-NULL.patch === --- 0002-depmod-fix-asserting-mod-kmod-NULL.patch (rev 0) +++ 0002-depmod-fix-asserting-mod-kmod-NULL.patch 2012-11-17 02:23:30 UTC (rev 171299) @@ -0,0 +1,31 @@ +From 02c64df3c2b33880b18d3f4aba9fa8e48e5ca904 Mon Sep 17 00:00:00 2001 +From: Lucas De Marchi lucas.demar...@profusion.mobi +Date: Fri, 16 Nov 2012 12:05:42 -0200 +Subject: [PATCH 2/2] depmod: fix asserting mod-kmod == NULL + +If we are replacing a lower priority module (due to its location), we +already created a kmod_module, but didn't open the file for reading its +symbols. This means mod-kmod won't be NULL, and this is just ok. Since +all the functions freeing stuff below the previous assert already takes +NULL into consideration, it's safe to just unref mod-kmod and let the +right thing happens. +--- + tools/depmod.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/depmod.c b/tools/depmod.c +index aafe66b..7bbdcd3 100644 +--- a/tools/depmod.c b/tools/depmod.c +@@ -977,7 +977,7 @@ static void mod_free(struct mod *mod) + { + DBG(free %p kmod=%p, path=%s\n, mod, mod-kmod, mod-path); + array_free_array(mod-deps); +- assert(mod-kmod == NULL); ++ kmod_module_unref(mod-kmod); + kmod_module_info_free_list(mod-info_list); + kmod_module_dependency_symbols_free_list(mod-dep_sym_list); + free(mod-uncrelpath); +-- +1.8.0 + Modified: PKGBUILD === --- PKGBUILD2012-11-17 02:17:21 UTC (rev 171298) +++ PKGBUILD2012-11-17 02:23:30 UTC (rev 171299) @@ -3,7 +3,7 @@ pkgname=kmod pkgver=11 -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' @@ -15,13 +15,23 @@ conflicts=('module-init-tools') replaces=('module-init-tools') source=(ftp://ftp.kernel.org/pub/linux/utils/kernel/$pkgname/$pkgname-$pkgver.tar.xz; +0001-depmod-fix-hash-lookup-by-relpath-instead-of-uncrelp.patch +0002-depmod-fix-asserting-mod-kmod-NULL.patch
[arch-commits] Commit in kmod/trunk (3 files)
Date: Thursday, November 8, 2012 @ 08:48:58 Author: dreisner Revision: 170542 upgpkg: kmod 11-1 - drop backports - upstream update Modified: kmod/trunk/PKGBUILD Deleted: kmod/trunk/0001-depmod-fix-parsing-of-modules.order-with-compressed-.patch kmod/trunk/0001-libkmod-Add-support-for-.-in-module-parameter-on-kcm.patch -+ 0001-depmod-fix-parsing-of-modules.order-with-compressed-.patch | 165 -- 0001-libkmod-Add-support-for-.-in-module-parameter-on-kcm.patch | 33 -- PKGBUILD| 16 3 files changed, 3 insertions(+), 211 deletions(-) Deleted: 0001-depmod-fix-parsing-of-modules.order-with-compressed-.patch === --- 0001-depmod-fix-parsing-of-modules.order-with-compressed-.patch 2012-11-08 12:12:44 UTC (rev 170541) +++ 0001-depmod-fix-parsing-of-modules.order-with-compressed-.patch 2012-11-08 13:48:58 UTC (rev 170542) @@ -1,165 +0,0 @@ -From 88c247f7f18ac25181ddcaff97fbbecbd3a29f57 Mon Sep 17 00:00:00 2001 -From: Lucas De Marchi lucas.de.mar...@gmail.com -Date: Wed, 3 Oct 2012 16:28:24 -0300 -Subject: [PATCH] depmod: fix parsing of modules.order with compressed modules - -We now index the modules by uncompressed-relative-path instead of -relative-path. This is because the file modules.order, coming from -kernel, always comes with uncompressed paths. This fixes the issue of -not sorting the aliases correctly due to paths not matching when using -compressed modules. - tools/depmod.c | 46 +- - 1 file changed, 29 insertions(+), 17 deletions(-) - -diff --git a/tools/depmod.c b/tools/depmod.c -index 0bf2dea..ff19d6e 100644 a/tools/depmod.c -+++ b/tools/depmod.c -@@ -39,6 +39,8 @@ - #define DEFAULT_VERBOSE LOG_WARNING - static int verbose = DEFAULT_VERBOSE; - -+#define KMOD_EXT_UNC 0 -+ - static const struct kmod_ext { - const char *ext; - size_t len; -@@ -1001,6 +1003,7 @@ struct mod { - uint16_t idx; /* index in depmod-modules.array */ - uint16_t users; /* how many modules depend on this one */ - uint8_t dep_loop : 1; -+ char *uncrelpath; /* same as relpath but ending in .ko */ - char modname[]; - }; - -@@ -1014,7 +1017,7 @@ struct depmod { - const struct cfg *cfg; - struct kmod_ctx *ctx; - struct array modules; -- struct hash *modules_by_relpath; -+ struct hash *modules_by_uncrelpath; - struct hash *modules_by_name; - struct hash *symbols; - unsigned int dep_loops; -@@ -1025,6 +1028,7 @@ static void mod_free(struct mod *mod) - DBG(free %p kmod=%p, path=%s\n, mod, mod-kmod, mod-path); - array_free_array(mod-deps); - kmod_module_unref(mod-kmod); -+ free(mod-uncrelpath); - free(mod); - } - -@@ -1066,10 +1070,10 @@ static int depmod_init(struct depmod *depmod, struct cfg *cfg, - - array_init(depmod-modules, 128); - -- depmod-modules_by_relpath = hash_new(512, NULL); -- if (depmod-modules_by_relpath == NULL) { -+ depmod-modules_by_uncrelpath = hash_new(512, NULL); -+ if (depmod-modules_by_uncrelpath == NULL) { - err = -errno; -- goto modules_by_relpath_failed; -+ goto modules_by_uncrelpath_failed; - } - - depmod-modules_by_name = hash_new(512, NULL); -@@ -1089,8 +1093,8 @@ static int depmod_init(struct depmod *depmod, struct cfg *cfg, - symbols_failed: - hash_free(depmod-modules_by_name); - modules_by_name_failed: -- hash_free(depmod-modules_by_relpath); --modules_by_relpath_failed: -+ hash_free(depmod-modules_by_uncrelpath); -+modules_by_uncrelpath_failed: - return err; - } - -@@ -1100,7 +1104,7 @@ static void depmod_shutdown(struct depmod *depmod) - - hash_free(depmod-symbols); - -- hash_free(depmod-modules_by_relpath); -+ hash_free(depmod-modules_by_uncrelpath); - - hash_free(depmod-modules_by_name); - -@@ -1114,7 +1118,7 @@ static void depmod_shutdown(struct depmod *depmod) - static int depmod_module_add(struct depmod *depmod, struct kmod_module *kmod) - { - const struct cfg *cfg = depmod-cfg; -- const char *modname; -+ const char *modname, *lastslash; - size_t modnamelen; - struct mod *mod; - int err; -@@ -1134,7 +1138,8 @@ static int depmod_module_add(struct depmod *depmod, struct kmod_module *kmod) - array_init(mod-deps, 4); - - mod-path = kmod_module_get_path(kmod); -- mod-baselen = strrchr(mod-path, '/') - mod-path; -+ lastslash = strrchr(mod-path, '/'); -+ mod-baselen = lastslash - mod-path; - if (strncmp(mod-path, cfg-dirname, cfg-dirnamelen) == 0 - mod-path[cfg-dirnamelen] == '/') - mod-relpath = mod-path + cfg-dirnamelen + 1; -@@ -1144,25 +1149,32 @@ static int
[arch-commits] Commit in kmod/trunk (3 files)
Date: Saturday, October 20, 2012 @ 15:15:38 Author: dreisner Revision: 169419 upgpkg: kmod 10-2 - backport fix for module ordering with compressed modules - backport fix for module params with '.' on kernel cmdline Added: kmod/trunk/0001-depmod-fix-parsing-of-modules.order-with-compressed-.patch kmod/trunk/0001-libkmod-Add-support-for-.-in-module-parameter-on-kcm.patch Modified: kmod/trunk/PKGBUILD -+ 0001-depmod-fix-parsing-of-modules.order-with-compressed-.patch | 165 ++ 0001-libkmod-Add-support-for-.-in-module-parameter-on-kcm.patch | 33 ++ PKGBUILD| 12 3 files changed, 209 insertions(+), 1 deletion(-) Added: 0001-depmod-fix-parsing-of-modules.order-with-compressed-.patch === --- 0001-depmod-fix-parsing-of-modules.order-with-compressed-.patch (rev 0) +++ 0001-depmod-fix-parsing-of-modules.order-with-compressed-.patch 2012-10-20 19:15:38 UTC (rev 169419) @@ -0,0 +1,165 @@ +From 88c247f7f18ac25181ddcaff97fbbecbd3a29f57 Mon Sep 17 00:00:00 2001 +From: Lucas De Marchi lucas.de.mar...@gmail.com +Date: Wed, 3 Oct 2012 16:28:24 -0300 +Subject: [PATCH] depmod: fix parsing of modules.order with compressed modules + +We now index the modules by uncompressed-relative-path instead of +relative-path. This is because the file modules.order, coming from +kernel, always comes with uncompressed paths. This fixes the issue of +not sorting the aliases correctly due to paths not matching when using +compressed modules. +--- + tools/depmod.c | 46 +- + 1 file changed, 29 insertions(+), 17 deletions(-) + +diff --git a/tools/depmod.c b/tools/depmod.c +index 0bf2dea..ff19d6e 100644 +--- a/tools/depmod.c b/tools/depmod.c +@@ -39,6 +39,8 @@ + #define DEFAULT_VERBOSE LOG_WARNING + static int verbose = DEFAULT_VERBOSE; + ++#define KMOD_EXT_UNC 0 ++ + static const struct kmod_ext { + const char *ext; + size_t len; +@@ -1001,6 +1003,7 @@ struct mod { + uint16_t idx; /* index in depmod-modules.array */ + uint16_t users; /* how many modules depend on this one */ + uint8_t dep_loop : 1; ++ char *uncrelpath; /* same as relpath but ending in .ko */ + char modname[]; + }; + +@@ -1014,7 +1017,7 @@ struct depmod { + const struct cfg *cfg; + struct kmod_ctx *ctx; + struct array modules; +- struct hash *modules_by_relpath; ++ struct hash *modules_by_uncrelpath; + struct hash *modules_by_name; + struct hash *symbols; + unsigned int dep_loops; +@@ -1025,6 +1028,7 @@ static void mod_free(struct mod *mod) + DBG(free %p kmod=%p, path=%s\n, mod, mod-kmod, mod-path); + array_free_array(mod-deps); + kmod_module_unref(mod-kmod); ++ free(mod-uncrelpath); + free(mod); + } + +@@ -1066,10 +1070,10 @@ static int depmod_init(struct depmod *depmod, struct cfg *cfg, + + array_init(depmod-modules, 128); + +- depmod-modules_by_relpath = hash_new(512, NULL); +- if (depmod-modules_by_relpath == NULL) { ++ depmod-modules_by_uncrelpath = hash_new(512, NULL); ++ if (depmod-modules_by_uncrelpath == NULL) { + err = -errno; +- goto modules_by_relpath_failed; ++ goto modules_by_uncrelpath_failed; + } + + depmod-modules_by_name = hash_new(512, NULL); +@@ -1089,8 +1093,8 @@ static int depmod_init(struct depmod *depmod, struct cfg *cfg, + symbols_failed: + hash_free(depmod-modules_by_name); + modules_by_name_failed: +- hash_free(depmod-modules_by_relpath); +-modules_by_relpath_failed: ++ hash_free(depmod-modules_by_uncrelpath); ++modules_by_uncrelpath_failed: + return err; + } + +@@ -1100,7 +1104,7 @@ static void depmod_shutdown(struct depmod *depmod) + + hash_free(depmod-symbols); + +- hash_free(depmod-modules_by_relpath); ++ hash_free(depmod-modules_by_uncrelpath); + + hash_free(depmod-modules_by_name); + +@@ -1114,7 +1118,7 @@ static void depmod_shutdown(struct depmod *depmod) + static int depmod_module_add(struct depmod *depmod, struct kmod_module *kmod) + { + const struct cfg *cfg = depmod-cfg; +- const char *modname; ++ const char *modname, *lastslash; + size_t modnamelen; + struct mod *mod; + int err; +@@ -1134,7 +1138,8 @@ static int depmod_module_add(struct depmod *depmod, struct kmod_module *kmod) + array_init(mod-deps, 4); + + mod-path = kmod_module_get_path(kmod); +- mod-baselen = strrchr(mod-path, '/') - mod-path; ++ lastslash = strrchr(mod-path, '/'); ++ mod-baselen = lastslash - mod-path; + if (strncmp(mod-path, cfg-dirname, cfg-dirnamelen) == 0 + mod-path[cfg-dirnamelen] == '/') + mod-relpath = mod-path +
[arch-commits] Commit in kmod/trunk (3 files)
Date: Tuesday, July 3, 2012 @ 20:18:48 Author: dreisner Revision: 162917 upgpkg: kmod 9-2 - remove local patch -- we now look for kmods in /usr/lib/modules - add post_upgrade warning about the above Added: kmod/trunk/kmod.install Modified: kmod/trunk/PKGBUILD Deleted: kmod/trunk/0002-config-hardcode-the-path-to-modules-to-be-lib-module.patch -+ 0002-config-hardcode-the-path-to-modules-to-be-lib-module.patch | 93 -- PKGBUILD| 11 - kmod.install|9 3 files changed, 13 insertions(+), 100 deletions(-) Deleted: 0002-config-hardcode-the-path-to-modules-to-be-lib-module.patch === --- 0002-config-hardcode-the-path-to-modules-to-be-lib-module.patch 2012-07-03 23:39:56 UTC (rev 162916) +++ 0002-config-hardcode-the-path-to-modules-to-be-lib-module.patch 2012-07-04 00:18:48 UTC (rev 162917) @@ -1,93 +0,0 @@ -From 53e7e0e42428770578ca0d54d0a9540f498f917f Mon Sep 17 00:00:00 2001 -From: Tom Gundersen t...@jklm.no -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 t...@jklm.no - libkmod/libkmod.c |2 +- - tools/depmod.c|2 +- - tools/modinfo.c |4 ++-- - tools/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/depmod.c -+++ b/tools/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/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/kmod-modprobe.c b/tools/kmod-modprobe.c -index 4760682..ccb41d8 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, --syslogprint 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); -
[arch-commits] Commit in kmod/trunk (3 files)
Date: Thursday, May 10, 2012 @ 21:49:01 Author: dreisner Revision: 158816 upgpkg: kmod 8-2 - backport upstream patches to fix crash Added: kmod/trunk/0001-libkmod-file-gracefully-handle-errors-from-zlib.patch kmod/trunk/0002-depmod-report-failures-in-loading-symbols.patch Modified: kmod/trunk/PKGBUILD + 0001-libkmod-file-gracefully-handle-errors-from-zlib.patch | 35 +++ 0002-depmod-report-failures-in-loading-symbols.patch | 34 ++ PKGBUILD | 18 - 3 files changed, 82 insertions(+), 5 deletions(-) Added: 0001-libkmod-file-gracefully-handle-errors-from-zlib.patch === --- 0001-libkmod-file-gracefully-handle-errors-from-zlib.patch (rev 0) +++ 0001-libkmod-file-gracefully-handle-errors-from-zlib.patch 2012-05-11 01:49:01 UTC (rev 158816) @@ -0,0 +1,35 @@ +From c7d5a60d3df735a3816bbc1ff1b416a803a4f7a6 Mon Sep 17 00:00:00 2001 +From: Dave Reisner dreis...@archlinux.org +Date: Mon, 7 May 2012 19:41:41 -0400 +Subject: [PATCH 1/2] libkmod-file: gracefully handle errors from zlib + +zlib won't necessarily set the system errno, and this is particularly +evident on corrupted data (which results in a double free). Use zlib's +gzerror to detect the failure, returning a generic EINVAL when zlib +doesn't provide us with an errno. +--- + libkmod/libkmod-file.c |8 +++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/libkmod/libkmod-file.c b/libkmod/libkmod-file.c +index 46ad8d9..8beb7e3 100644 +--- a/libkmod/libkmod-file.c b/libkmod/libkmod-file.c +@@ -199,7 +199,13 @@ static int load_zlib(struct kmod_file *file) + if (r == 0) + break; + else if (r 0) { +- err = -errno; ++ int gzerr; ++ const char *gz_errmsg = gzerror(file-gzf, gzerr); ++ ++ ERR(file-ctx, gzip: %s\n, gz_errmsg); ++ ++ /* gzip might not set errno here */ ++ err = gzerr == Z_ERRNO ? -errno : -EINVAL; + goto error; + } + did += r; +-- +1.7.10.1 + Added: 0002-depmod-report-failures-in-loading-symbols.patch === --- 0002-depmod-report-failures-in-loading-symbols.patch (rev 0) +++ 0002-depmod-report-failures-in-loading-symbols.patch2012-05-11 01:49:01 UTC (rev 158816) @@ -0,0 +1,34 @@ +From 819f79a24d58e3c8429f1631df2f8f85a2f95d4a Mon Sep 17 00:00:00 2001 +From: Dave Reisner dreis...@archlinux.org +Date: Mon, 7 May 2012 19:41:42 -0400 +Subject: [PATCH 2/2] depmod: report failures in loading symbols + +Previously, depmod would relegate failures of kmod_module_get_symbols() +to debug output, assuming the error was simply a lack of symbols. +Leave the ENOENT return to debug output, but report anything else as a +real error. +--- + tools/kmod-depmod.c |7 +-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/tools/kmod-depmod.c b/tools/kmod-depmod.c +index e89dff6..bceb407 100644 +--- a/tools/kmod-depmod.c b/tools/kmod-depmod.c +@@ -1542,8 +1542,11 @@ static int depmod_load_symbols(struct depmod *depmod) + struct kmod_list *l, *list = NULL; + int err = kmod_module_get_symbols(mod-kmod, list); + if (err 0) { +- DBG(ignoring %s: no symbols: %s\n, +- mod-path, strerror(-err)); ++ if (err == -ENOENT) ++ DBG(ignoring %s: no symbols\n, mod-path); ++ else ++ ERR(failed to load symbols from %s: %s\n, ++ mod-path, strerror(-err)); + continue; + } + kmod_list_foreach(l, list) { +-- +1.7.10.1 + Modified: PKGBUILD === --- PKGBUILD2012-05-11 00:55:49 UTC (rev 158815) +++ PKGBUILD2012-05-11 01:49:01 UTC (rev 158816) @@ -3,7 +3,7 @@ pkgname=kmod pkgver=8 -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' @@ -16,18 +16,26 @@ source=(ftp://ftp.kernel.org/pub/linux/utils/kernel/$pkgname/$pkgname-$pkgver.tar.xz; 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) +0002-config-hardcode-the-path-to-modules-to-be-lib-module.patch +0001-libkmod-file-gracefully-handle-errors-from-zlib.patch +0002-depmod-report-failures-in-loading-symbols.patch)
[arch-commits] Commit in kmod/trunk (3 files)
Date: Saturday, March 3, 2012 @ 00:10:06 Author: dreisner Revision: 151796 upgpkg: kmod 6-1 Modified: kmod/trunk/PKGBUILD Deleted: kmod/trunk/0001-libkmod-module-probe-Fix-ignore-loaded-flag-not-bein.patch kmod/trunk/0001-libkmod-module-probe-fix-infinite-loop-with-softdeps.patch -+ 0001-libkmod-module-probe-Fix-ignore-loaded-flag-not-bein.patch | 28 --- 0001-libkmod-module-probe-fix-infinite-loop-with-softdeps.patch | 39 -- PKGBUILD| 21 + 3 files changed, 5 insertions(+), 83 deletions(-) Deleted: 0001-libkmod-module-probe-Fix-ignore-loaded-flag-not-bein.patch === --- 0001-libkmod-module-probe-Fix-ignore-loaded-flag-not-bein.patch 2012-03-03 02:45:49 UTC (rev 151795) +++ 0001-libkmod-module-probe-Fix-ignore-loaded-flag-not-bein.patch 2012-03-03 05:10:06 UTC (rev 151796) @@ -1,28 +0,0 @@ -From 269de2e0bf5011072da2f40f4f2d4023fad696b9 Mon Sep 17 00:00:00 2001 -From: Lucas De Marchi lucas.demar...@profusion.mobi -Date: Tue, 7 Feb 2012 09:48:59 -0200 -Subject: [PATCH] libkmod-module: probe: Fix ignore-loaded flag not being - applied - - TODO |3 +++ - libkmod/libkmod-module.c |3 ++- - 2 files changed, 5 insertions(+), 1 deletions(-) - -diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c -index 0af3e2e..b5eb7c9 100644 a/libkmod/libkmod-module.c -+++ b/libkmod/libkmod-module.c -@@ -1132,7 +1132,8 @@ KMOD_EXPORT int kmod_module_probe_insert_module(struct kmod_module *mod, - if (mod == NULL) - return -ENOENT; - -- if (module_is_inkernel(mod)) { -+ if (!(flags KMOD_PROBE_IGNORE_LOADED) -+ module_is_inkernel(mod)) { - if (flags KMOD_PROBE_FAIL_ON_LOADED) - return -EEXIST; - else --- -1.7.9 - Deleted: 0001-libkmod-module-probe-fix-infinite-loop-with-softdeps.patch === --- 0001-libkmod-module-probe-fix-infinite-loop-with-softdeps.patch 2012-03-03 02:45:49 UTC (rev 151795) +++ 0001-libkmod-module-probe-fix-infinite-loop-with-softdeps.patch 2012-03-03 05:10:06 UTC (rev 151796) @@ -1,39 +0,0 @@ -From 8cd0f9e4f9f5c093136a7a2c0c2998b9dd203161 Mon Sep 17 00:00:00 2001 -From: Lucas De Marchi lucas.demar...@profusion.mobi -Date: Sat, 11 Feb 2012 19:45:29 -0200 -Subject: [PATCH] libkmod-module: probe: fix infinite loop with softdeps - -If a softdep depends on a module in the dependency list of the module -being inserted, we would enter and infinite loop. - -Move the mod-visited = true assignment to the proper place, hoping it -didn't break other use cases. This is a bug that comes and goes every -now and then. Since we have a testsuite now, a test for this should be -written. - libkmod/libkmod-module.c |2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c -index b5eb7c9..835896f 100644 a/libkmod/libkmod-module.c -+++ b/libkmod/libkmod-module.c -@@ -1013,7 +1013,6 @@ static int __kmod_module_fill_softdep(struct kmod_module *mod, - goto fail; - } - *list = l; -- mod-visited = true; - mod-ignorecmd = (pre != NULL || post != NULL); - - kmod_list_foreach(l, post) { -@@ -1043,6 +1042,7 @@ static int __kmod_module_get_probe_list(struct kmod_module *mod, - mod-name); - return 0; - } -+ mod-visited = true; - - dep = kmod_module_get_dependencies(mod); - kmod_list_foreach(l, dep) { --- -1.7.9 - Modified: PKGBUILD === --- PKGBUILD2012-03-03 02:45:49 UTC (rev 151795) +++ PKGBUILD2012-03-03 05:10:06 UTC (rev 151796) @@ -2,38 +2,27 @@ # Maintainer: Dave Reisner dreis...@archlinux.org pkgname=kmod -pkgver=5 -pkgrel=4 +pkgver=6 +pkgrel=1 pkgdesc=Linux kernel module handling arch=('i686' 'x86_64') -url=http://git.profusion.mobi/cgit.cgi/kmod.git; +url='http://git.kernel.org/?p=utils/kernel/kmod/kmod.git;a=summary' 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; -'0001-libkmod-module-probe-Fix-ignore-loaded-flag-not-bein.patch' -'0001-libkmod-module-probe-fix-infinite-loop-with-softdeps.patch' +source=(ftp://ftp.kernel.org/pub/linux/utils/kernel/$pkgname/$pkgname-$pkgver.tar.xz; depmod-search.conf) -md5sums=('b271c2ec54aba1c67bda63c8579d8c15' - '81545a1509b43008f85c03fb980f0e86' - '662a85dbe420f04c1ef24f9cd4e4c990'
[arch-commits] Commit in kmod/trunk (3 files)
Date: Sunday, January 8, 2012 @ 17:04:52 Author: dreisner Revision: 146296 upgpkg: kmod 3-5 - backport patches to address FS#27862 Added: kmod/trunk/fix-error-path-when-loading-deps.patch kmod/trunk/use-path-max-for-alias-names.patch Modified: kmod/trunk/PKGBUILD + PKGBUILD | 12 +- fix-error-path-when-loading-deps.patch | 35 +++ use-path-max-for-alias-names.patch | 147 +++ 3 files changed, 191 insertions(+), 3 deletions(-) Modified: PKGBUILD === --- PKGBUILD2012-01-08 17:45:05 UTC (rev 146295) +++ PKGBUILD2012-01-08 22:04:52 UTC (rev 146296) @@ -3,7 +3,7 @@ pkgname=kmod pkgver=3 -pkgrel=4 +pkgrel=5 pkgdesc=Linux kernel module handling arch=('i686' 'x86_64') url=http://git.profusion.mobi/cgit.cgi/kmod.git; @@ -15,15 +15,21 @@ replaces=('module-init-tools') source=(http://packages.profusion.mobi/$pkgname/$pkgname-$pkgver.tar.xz; depmod-search.conf -return-non-zero-on-fail.patch) +return-non-zero-on-fail.patch +use-path-max-for-alias-names.patch +fix-error-path-when-loading-deps.patch) md5sums=('bc0e69f75c2ac22c091f05e166e86c5d' '4b8cbcbc54b9029c99fd730e257d4436' - '4be6f783a7fc2d1747ccaa2536d2e88f') + '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 \ Added: fix-error-path-when-loading-deps.patch === --- fix-error-path-when-loading-deps.patch (rev 0) +++ fix-error-path-when-loading-deps.patch 2012-01-08 22:04:52 UTC (rev 146296) @@ -0,0 +1,35 @@ +From cb0d0b72128ac566aad9a72800c5a64af66f0b6e Mon Sep 17 00:00:00 2001 +From: Lucas De Marchi lucas.demar...@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 + Added: use-path-max-for-alias-names.patch === --- use-path-max-for-alias-names.patch (rev 0) +++ use-path-max-for-alias-names.patch 2012-01-08 22:04:52 UTC (rev 146296) @@ -0,0 +1,147 @@ +From 6daceb2f1f4d442ba04752aaa1cf43d554d5f646 Mon Sep 17 00:00:00 2001 +From: Lucas De Marchi lucas.demar...@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