version 6

This commit is contained in:
Kay Sievers 2012-03-04 16:25:29 +01:00
parent 8fd97a37d0
commit cf0a7a3b72
6 changed files with 10 additions and 133 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
/kmod-5.tar.xz
/kmod-6.tar.xz

View File

@ -1,37 +0,0 @@
From 7cd664fbaead46b5f5ea4812cf9a7cbe6264eb7d Mon Sep 17 00:00:00 2001
From: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Date: Thu, 23 Feb 2012 16:37:13 -0200
Subject: [PATCH] libkmod-module: don't treat "coming" as in-kernel
Running two instances of modprobe with the same module should both
succeed or both fail:
modprobe foo&; modprobe foo;
Previously if foo failed to be inserted by the first call, the second one
could return 0 because it may have occurred while the first one was being
processed by kernel (thus marked as "coming").
Now we simply don't check by "coming" in order to decide if we need to
call init_module(). module-init-tools used to spin calling
usleep(100000), but calls to init_module() are already synchronous.
Therefore let kernel synchronize the calls.
---
libkmod/libkmod-module.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c
index 69f1265..de25281 100644
--- a/libkmod/libkmod-module.c
+++ b/libkmod/libkmod-module.c
@@ -110,7 +110,6 @@ static inline bool module_is_inkernel(struct kmod_module *mod)
{
int state = kmod_module_get_initstate(mod);
if (state == KMOD_MODULE_LIVE ||
- state == KMOD_MODULE_COMING ||
state == KMOD_MODULE_BUILTIN)
return true;
else
--
1.7.9

View File

@ -1,42 +0,0 @@
From 269de2e0bf5011072da2f40f4f2d4023fad696b9 Mon Sep 17 00:00:00 2001
From: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Date: Tue, 7 Feb 2012 09:48:59 -0200
Subject: [PATCH 01/10] 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/TODO b/TODO
index 23d7c76..6ab11f1 100644
--- a/TODO
+++ b/TODO
@@ -38,6 +38,9 @@ Features:
* Stop using system() inside the library and use fork + exec instead
+* Add tests for --show-depends: we need to first trap calls to
+ kmod_module_get_path(), because it's printed to stdout/stderr.
+
Known Bugs:
===========
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

View File

@ -1,39 +0,0 @@
From 8cd0f9e4f9f5c093136a7a2c0c2998b9dd203161 Mon Sep 17 00:00:00 2001
From: Lucas De Marchi <lucas.demarchi@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

View File

@ -1,15 +1,12 @@
Name: kmod
Version: 5
Release: 8%{?dist}
Version: 6
Release: 1%{?dist}
Summary: Linux kernel module management utilities
Group: System Environment/Kernel
License: GPLv2+
#TODO: Change the following URLs once there is wiki write access
#URL: http://modules.wiki.kernel.org/
URL: http://git.profusion.mobi/cgit.cgi/kmod.git/
#TODO: The following URL will be moving to kernel.org eventually
Source0: http://packages.profusion.mobi/kmod/%{name}-%{version}.tar.xz
URL: http://git.kernel.org/?p=utils/kernel/kmod/kmod.git;a=summary
Source0: ftp://ftp.kernel.org/pub/linux/utils/kernel/kmod/%{name}-%{version}.tar.xz
Exclusiveos: Linux
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
@ -20,9 +17,6 @@ BuildRequires: xz-devel
Provides: module-init-tools = 4.0-1
Obsoletes: module-init-tools < 4.0-1
Provides: /sbin/modprobe
Patch1: 0001-libkmod-module-probe-Fix-ignore-loaded-flag-not-bein.patch
Patch2: 0001-libkmod-module-probe-fix-infinite-loop-with-softdeps.patch
Patch3: 0001-libkmod-module-don-t-treat-coming-as-in-kernel.patch
%description
The kmod package provides various programs needed for automatic
@ -50,9 +44,6 @@ applications that wish to load or unload Linux kernel modules.
%prep
%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
%build
export V=1
@ -106,6 +97,10 @@ mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/modprobe.d
%{_libdir}/libkmod.so
%changelog
* Sun Mar 04 2012 Kay Sievers <kay@redhat.com> - 6-1
- update to version 6
- remove all patches, they are included in the release
* Fri Feb 24 2012 Kay Sievers <kay@redhat.com> - 5-8
- try to address brc#771285

View File

@ -1 +1 @@
b271c2ec54aba1c67bda63c8579d8c15 kmod-5.tar.xz
bad08102fad212cd34405136d9a7eb94 kmod-6.tar.xz