commit 7e02116ebbab983239a14afcfd6727cf93cdee41 Author: Josh Boyer jwboyer@redhat.com Date: Mon Mar 18 10:31:19 2013 -0400
Add patch to make rmmod understand built-in modules (rhbz 922187)
fix-rmmod-builtin.patch | 20 ++++++++++++++++++++ kmod.spec | 8 +++++++- 2 files changed, 27 insertions(+), 1 deletions(-) --- diff --git a/fix-rmmod-builtin.patch b/fix-rmmod-builtin.patch new file mode 100644 index 0000000..25c1adb --- /dev/null +++ b/fix-rmmod-builtin.patch @@ -0,0 +1,20 @@ +diff --git a/tools/rmmod.c b/tools/rmmod.c +index 7f2c2f6..7f4431c 100644 +--- a/tools/rmmod.c ++++ b/tools/rmmod.c +@@ -62,8 +62,14 @@ static void help(void) + + static int check_module_inuse(struct kmod_module *mod) { + struct kmod_list *holders; ++ int state; + +- if (kmod_module_get_initstate(mod) == -ENOENT) { ++ state = kmod_module_get_initstate(mod); ++ ++ if (state == KMOD_MODULE_BUILTIN) { ++ ERR("Module %s is builtin.\n", kmod_module_get_name(mod)); ++ return -ENOENT; ++ } else if (state < 0) { + ERR("Module %s is not currently loaded\n", + kmod_module_get_name(mod)); + return -ENOENT; diff --git a/kmod.spec b/kmod.spec index c234961..cff2c18 100644 --- a/kmod.spec +++ b/kmod.spec @@ -1,6 +1,6 @@ Name: kmod Version: 12 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Linux kernel module management utilities
Group: System Environment/Kernel @@ -15,6 +15,8 @@ BuildRequires: zlib-devel BuildRequires: xz-devel BuildRequires: libxslt
+Patch0: fix-rmmod-builtin.patch + Provides: module-init-tools = 4.0-1 Obsoletes: module-init-tools < 4.0-1 Provides: /sbin/modprobe @@ -45,6 +47,7 @@ applications that wish to load or unload Linux kernel modules.
%prep %setup -q +%patch0 -p1
%build export V=1 @@ -101,6 +104,9 @@ mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/modprobe.d %{_libdir}/libkmod.so
%changelog +* Mon Mar 18 2013 Josh Boyer jwboyer@redhat.com +- Add patch to make rmmod understand built-in modules (rhbz 922187) + * Thu Dec 06 2012 Josh Boyer jwboyer@redhat.com - Update to version 12
kmod-maint@lists.fedoraproject.org