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 86a2759..e88f8cc 100644 --- a/kmod.spec +++ b/kmod.spec @@ -1,6 +1,6 @@ Name: kmod Version: 12 -Release: 2%{?dist} +Release: 3%{?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 +- Add patch to make rmmod understand built-in modules (rhbz 922187) + * Thu Feb 14 2013 Fedora Release Engineering - 12-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild