From 90ec2601467a77cd7471a840d5ae86e693f994f5 Mon Sep 17 00:00:00 2001 From: Automatic Build System Date: Sat, 6 Jan 2024 02:11:59 +0100 Subject: [PATCH] automatic version update by autodist [release 17-1mamba;Mon Apr 07 2014] --- README.md | 4 + ...13-arm-revert-add-finit_module-logic.patch | 38 ++++ kmod-13-arm-upstream-null-pointer-fix.patch | 23 ++ kmod.spec | 204 ++++++++++++++++++ 4 files changed, 269 insertions(+) create mode 100644 kmod-13-arm-revert-add-finit_module-logic.patch create mode 100644 kmod-13-arm-upstream-null-pointer-fix.patch create mode 100644 kmod.spec diff --git a/README.md b/README.md index 96f4ecf..237e7cb 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,6 @@ # kmod +kmod is a set of tools to handle common tasks with Linux kernel modules like insert, remove, list, check properties, resolve dependencies and aliases. +These tools are designed on top of libkmod, a library that is shipped with kmod. +The aim is to be compatible with tools, configurations and indexes from module-init-tools project. + diff --git a/kmod-13-arm-revert-add-finit_module-logic.patch b/kmod-13-arm-revert-add-finit_module-logic.patch new file mode 100644 index 0000000..a3082dc --- /dev/null +++ b/kmod-13-arm-revert-add-finit_module-logic.patch @@ -0,0 +1,38 @@ +diff -Nru kmod-13.orig/libkmod/libkmod-module.c kmod-13/libkmod/libkmod-module.c +--- kmod-13.orig/libkmod/libkmod-module.c 2013-04-26 18:23:58.080751735 +0200 ++++ kmod-13/libkmod/libkmod-module.c 2013-04-26 18:24:44.050393418 +0200 +@@ -808,19 +808,6 @@ + return err; + } + +- if (kmod_file_get_direct(file)) { +- unsigned int kernel_flags = 0; +- +- if (flags & KMOD_INSERT_FORCE_VERMAGIC) +- kernel_flags |= MODULE_INIT_IGNORE_VERMAGIC; +- if (flags & KMOD_INSERT_FORCE_MODVERSION) +- kernel_flags |= MODULE_INIT_IGNORE_MODVERSIONS; +- +- err = finit_module(kmod_file_get_fd(file), args, kernel_flags); +- if (err == 0 || errno != ENOSYS) +- goto init_finished; +- } +- + size = kmod_file_get_size(file); + mem = kmod_file_get_contents(file); + +@@ -847,14 +834,6 @@ + } + + err = init_module(mem, size, args); +-init_finished: +- if (err < 0) { +- err = -errno; +- INFO(mod->ctx, "Failed to insert module '%s': %m\n", path); +- } +- +- if (elf != NULL) +- kmod_elf_unref(elf); + elf_failed: + kmod_file_unref(file); + diff --git a/kmod-13-arm-upstream-null-pointer-fix.patch b/kmod-13-arm-upstream-null-pointer-fix.patch new file mode 100644 index 0000000..018a957 --- /dev/null +++ b/kmod-13-arm-upstream-null-pointer-fix.patch @@ -0,0 +1,23 @@ +From b9a7da391066768736a2f23a360a3995df4bc097 Mon Sep 17 00:00:00 2001 +From: Lucas De Marchi +Date: Tue, 23 Apr 2013 23:47:28 +0000 +Subject: libkmod-module: Don't pass NULL ctx to kmod_log + +--- +(limited to 'libkmod/libkmod-module.c') + +diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c +index 6b793cd..1f8ce3c 100644 +--- a/libkmod/libkmod-module.c ++++ b/libkmod/libkmod-module.c +@@ -1839,7 +1839,7 @@ KMOD_EXPORT struct kmod_list *kmod_module_get_holders(const struct kmod_module * + struct kmod_list *list = NULL; + DIR *d; + +- if (mod == NULL) ++ if (mod == NULL || mod->ctx == NULL) + return NULL; + + snprintf(dname, sizeof(dname), "/sys/module/%s/holders", mod->name); +-- +cgit v0.9.1 diff --git a/kmod.spec b/kmod.spec new file mode 100644 index 0000000..067e5f3 --- /dev/null +++ b/kmod.spec @@ -0,0 +1,204 @@ +Name: kmod +Version: 17 +Release: 1mamba +Summary: Utilities for Linux kernel module handling +Group: System/Kernel and Hardware +Vendor: openmamba +Distribution: openmamba +Packager: Davide Madrisan +URL: http://git.kernel.org/?p=utils/kernel/kmod/kmod.git +Source0: ftp://ftp.kernel.org/pub/linux/utils/kernel/kmod/kmod-%{version}.tar.xz +Patch0: kmod-13-arm-upstream-null-pointer-fix.patch +Patch1: kmod-13-arm-revert-add-finit_module-logic.patch +License: GPL +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +## AUTOBUILDREQ-END +Requires: libkmod = %{?epoch:%epoch:}%{version}-%{release} +Provides: module-init-tools +Obsoletes: module-init-tools +# Compatibility stuff +Provides: init_tools +Provides: modutils +Obsoletes: modutils +Provides: klibc-module-init-tools +Obsoletes: klibc-module-init-tools +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%description +kmod is a set of tools to handle common tasks with Linux kernel modules like insert, remove, list, check properties, resolve dependencies and aliases. +These tools are designed on top of libkmod, a library that is shipped with kmod. +The aim is to be compatible with tools, configurations and indexes from module-init-tools project. + +%package -n libkmod +Group: System/Libraries +Summary: Shared librarie for Linux kernel module handling + +%description -n libkmod +The goal of the library libkmod is to offer to other programs the needed flexibility and fine grained control over insertion, removal, configuration and listing of kernel modules. + +%package -n libkmod-devel +Group: Development/Libraries +Summary: Development files for libkmod +Requires: libkmod = %{?epoch:%epoch:}%{version}-%{release} + +%debug_package + +%description -n libkmod-devel +This package contains libraries and header files for developing applications that use libkmod. + +%prep +%setup -q +#%patch0 -p1 +#%ifarch arm +#%patch1 -p1 +#%endif +cp libkmod/README README.libkmod + +%build +%configure \ + --bindir=/sbin \ + --with-rootlibdir=/%{_lib} \ + --enable-debug + + # --with-zlib + # --with-xz +%make + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +%makeinstall + +# add symlinks to kmod +cd %{buildroot}/sbin +for tool in depmod insmod lsmod rmmod modinfo modprobe; do + ln -s kmod ${tool} +done +install -d %{buildroot}%{_bindir} +ln -s /sbin/kmod %{buildroot}%{_bindir}/lsmod + +install -d %{buildroot}%{_sysconfdir}/modprobe.d +install -d %{buildroot}%{_sysconfdir}/depmod.d +install -d %{buildroot}/lib/modprobe.d + +# we have a .pc file for people to use +rm -f %{buildroot}%{_libdir}/libkmod.la + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%post -n lib%{name} -p /sbin/ldconfig +%postun -n lib%{name} -p /sbin/ldconfig + +%files +%defattr(-,root,root) +%dir %{_sysconfdir}/depmod.d +%dir %{_sysconfdir}/modprobe.d +/sbin/kmod +/sbin/depmod +/sbin/insmod +/sbin/lsmod +/sbin/modinfo +/sbin/modprobe +/sbin/rmmod +%{_bindir}/lsmod +%dir /lib/modprobe.d +%{_datadir}/bash-completion/completions/kmod +%{_mandir}/man5/depmod.d.* +%{_mandir}/man5/modprobe.d.* +%{_mandir}/man5/modules.dep.* +%{_mandir}/man8/depmod.* +%{_mandir}/man8/insmod.* +%{_mandir}/man8/lsmod.* +%{_mandir}/man8/modinfo.* +%{_mandir}/man8/modprobe.* +%{_mandir}/man8/rmmod.* +%doc COPYING + +%files -n lib%{name} +%defattr(-,root,root) +/%{_lib}/libkmod.so.* + +%files -n lib%{name}-devel +%defattr(-,root,root) +%{_includedir}/libkmod.h +%{_libdir}/libkmod.so +%{_libdir}/pkgconfig/libkmod.pc +%doc NEWS README TODO README.libkmod + +%changelog +* Mon Apr 07 2014 Automatic Build System 17-1mamba +- automatic version update by autodist + +* Mon Dec 23 2013 Automatic Build System 16-1mamba +- automatic version update by autodist + +* Sat Aug 24 2013 Automatic Build System 15-1mamba +- automatic version update by autodist + +* Mon Jul 08 2013 Automatic Build System 14-1mamba +- automatic version update by autodist + +* Fri Apr 26 2013 Silvan Calarco 13-3mamba +- added upstream patch to fix null pointer error (and fix segmentation fault seen on rpi) +- arm: revert for now finit_module logic patch to support older kernels on this architecture + +* Sun Apr 14 2013 Silvan Calarco 13-2mamba +- provide and own /lib/modprobe.d directory + +* Wed Apr 10 2013 Automatic Build System 13-1mamba +- automatic version update by autodist + +* Wed Dec 05 2012 Automatic Build System 12-1mamba +- automatic version update by autodist + +* Thu Nov 08 2012 Automatic Build System 11-1mamba +- automatic version update by autodist + +* Fri Sep 07 2012 Automatic Build System 10-1mamba +- automatic version update by autodist + +* Sun Jul 22 2012 Davide Madrisan 9-1mamba +- update to 9 + +* Mon May 14 2012 Davide Madrisan 8-1mamba +- update to 8 + +* Sun May 13 2012 Silvan Calarco 7-2mamba +- fixed /usr/bin/lsmod symlink + +* Mon Mar 19 2012 Davide Madrisan 7-1mamba +- update to 7 + +* Sat Mar 17 2012 Davide Madrisan 6-1mamba +- update to 6 + +* Sun Feb 12 2012 Silvan Calarco 5-2mamba +- added upstream patch to fix infinite loop of vboxdrv due to /etc/modprobe.d file + +* Tue Feb 07 2012 Davide Madrisan 5-1mamba +- update to 5 + +* Fri Jan 20 2012 Silvan Calarco 4-3mamba +- added patch to prevent modprobe from failing when cwd contains a directory with module name + +* Wed Jan 18 2012 Davide Madrisan 4-2mamba +- opsolete module-init-tools + +* Mon Jan 16 2012 Davide Madrisan 4-1mamba +- update to 4 + +* Sun Jan 08 2012 Davide Madrisan 3-3mamba +- mv libraries to %%{_lib} +- add a debug package +- add provides and conflicts tags required for backward compatibility + +* Sat Jan 07 2012 Davide Madrisan 3-2mamba +- own %{_sysconfdir}/modprobe.d + +* Fri Jan 06 2012 Davide Madrisan 3-1mamba +- update to version 3 +- conflicts module-init-tools + +* Wed Dec 28 2011 Davide Madrisan 2-1mamba +- package created by autospec