From 4fc59478d1180fd7984003f5b1645fe40954299f Mon Sep 17 00:00:00 2001 From: root Date: Fri, 17 Feb 2012 19:20:30 +0000 Subject: Fri Feb 17 19:20:30 UTC 2012 --- ...ule-probe-fix-infinite-loop-with-softdeps.patch | 39 ++++++++++++++++++++++ core/kmod/PKGBUILD | 15 ++++++--- 2 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 core/kmod/0001-libkmod-module-probe-fix-infinite-loop-with-softdeps.patch (limited to 'core/kmod') diff --git a/core/kmod/0001-libkmod-module-probe-fix-infinite-loop-with-softdeps.patch b/core/kmod/0001-libkmod-module-probe-fix-infinite-loop-with-softdeps.patch new file mode 100644 index 000000000..95e7f859a --- /dev/null +++ b/core/kmod/0001-libkmod-module-probe-fix-infinite-loop-with-softdeps.patch @@ -0,0 +1,39 @@ +From 8cd0f9e4f9f5c093136a7a2c0c2998b9dd203161 Mon Sep 17 00:00:00 2001 +From: Lucas De Marchi +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 + diff --git a/core/kmod/PKGBUILD b/core/kmod/PKGBUILD index a219e2d8f..d0b714fde 100644 --- a/core/kmod/PKGBUILD +++ b/core/kmod/PKGBUILD @@ -1,9 +1,9 @@ -# $Id: PKGBUILD 150108 2012-02-12 15:37:16Z dreisner $ +# $Id: PKGBUILD 150335 2012-02-16 23:20:12Z dreisner $ # Maintainer: Dave Reisner pkgname=kmod pkgver=5 -pkgrel=2 +pkgrel=4 pkgdesc="Linux kernel module handling" arch=('i686' 'x86_64') url="http://git.profusion.mobi/cgit.cgi/kmod.git" @@ -15,9 +15,11 @@ 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' "depmod-search.conf") md5sums=('b271c2ec54aba1c67bda63c8579d8c15' '81545a1509b43008f85c03fb980f0e86' + '662a85dbe420f04c1ef24f9cd4e4c990' '4b8cbcbc54b9029c99fd730e257d4436') build() { @@ -26,7 +28,10 @@ build() { # fix modprobe --show-depends failures on loaded modules patch -Np1 <"$srcdir/0001-libkmod-module-probe-Fix-ignore-loaded-flag-not-bein.patch" - CFLAGS+=' -g -O0' ./configure \ + # fix infinite loop with softdeps + patch -Np1 <"$srcdir/0001-libkmod-module-probe-fix-infinite-loop-with-softdeps.patch" + + ./configure \ --sysconfdir=/etc \ --with-rootprefix= \ --with-zlib @@ -46,7 +51,9 @@ package() { # add symlinks to kmod ln -s ../usr/bin/kmod "$pkgdir/sbin/modprobe" - for tool in {dep,ins,ls,rm}mod modinfo; do + ln -s ../usr/bin/kmod "$pkgdir/sbin/depmod" + + for tool in {ins,ls,rm}mod modinfo; do ln -s kmod "$pkgdir/usr/bin/$tool" done -- cgit v1.2.3-54-g00ecf