# # spec file for package kmod # # Copyright (c) 2016 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: kmod %define lname libkmod2 Version: 23 Release: 120.70 Summary: Utilities to load modules into the kernel License: LGPL-2.1+ and GPL-2.0+ Group: System/Kernel Url: https://www.kernel.org/pub/linux/utils/kernel/kmod/ #Git-Web: http://git.kernel.org/?p=utils/kernel/kmod/kmod.git;a=summary #Git-Clone: git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/kmod/kmod-%version.tar.xz Source2: ftp://ftp.kernel.org/pub/linux/utils/kernel/kmod/kmod-%version.tar.sign Patch1: 0002-modprobe-Recognize-allow-unsupported-modules-on-comm.patch Patch2: 0003-libkmod-config-Recognize-allow_unsupported_modules-i.patch Patch3: 0009-libkmod-Implement-filtering-of-unsupported-modules-o.patch Patch4: 0010-modprobe-Implement-allow-unsupported-modules.patch Patch5: 0011-Do-not-filter-unsupported-modules-when-running-a-van.patch Patch7: 0001-use-correct-sort-method-in-test-array.patch Patch8: 0001-testsuite-depmod-add-module-dependency-outside-cycli.patch Patch9: 0002-depmod-ignore-related-modules-in-depmod_report_cycle.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool BuildRequires: pkgconfig >= 0.21 BuildRequires: suse-module-tools BuildRequires: xz %if 0%{?sles_version} == 11 BuildRequires: xz-devel >= 4.99 BuildRequires: zlib-devel %else BuildRequires: pkgconfig(liblzma) >= 4.99 BuildRequires: pkgconfig(zlib) %endif Requires: suse-module-tools %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 compat Summary: Compat symlinks for kernel module utilities License: GPL-2.0+ Group: System/Kernel Requires: kmod Obsoletes: module-init-tools < 3.16 Provides: module-init-tools = 3.16 Provides: modutils %description compat kmod is a set of tools to handle common tasks with Linux kernel modules like insert, remove, list, check properties, resolve dependencies and aliases. This package contains traditional name symlinks (lsmod, etc.) %package -n %lname Summary: Library to interact with Linux kernel modules License: LGPL-2.1+ Group: System/Libraries %description -n %lname libkmod was created to allow programs to easily insert, remove and list modules, also checking its properties, dependencies and aliases. %package -n libkmod-devel Summary: Development files for libkmod License: LGPL-2.1+ Group: Development/Libraries/C and C++ Requires: %lname = %{version} %description -n libkmod-devel libkmod was created to allow programs to easily insert, remove and list modules, also checking its properties, dependencies and aliases. This package contains the development headers for the library found in %lname. %prep %setup -q -n kmod-%version %patch -P 1 -P 2 -P 3 -P 4 -P 5 -P 7 -P 8 -P 9 -p1 %build autoreconf -fi export LDFLAGS="-Wl,-z,relro,-z,now" # The extra --includedir gives us the possibility to detect dependent # packages which fail to properly use pkgconfig. %configure \ %if 0%{?sles_version} == 11 zlib_CFLAGS=" " zlib_LIBS="-lz" \ %endif --with-xz \ --with-zlib \ --includedir="%_includedir/kmod" \ --with-rootlibdir="%_libdir" \ --bindir="%_bindir" make %{?_smp_mflags} V=1 %install b="%buildroot" %make_install rm -f "$b/%_libdir"/*.la mkdir -p "$b/%_libexecdir/kmod" "$b/%_sbindir" "$b/sbin" for i in depmod insmod lsmod modinfo modprobe rmmod; do # # kmod-compat and kmod-compat(usrmerge) # ln -s "%_bindir/kmod" "$b/%_sbindir/$i" ln -s "%_bindir/kmod" "$b/sbin/$i" # # Make symlinks also available in normal fashion, # so one can actually run it. # ln -s "%_bindir/kmod" "$b/%_libexecdir/kmod/$i" done mkdir -p "$b/%_bindir" "$b/bin" for i in lsmod; do ln -s "%_bindir/kmod" "$b/%_bindir/$i" ln -s "%_bindir/kmod" "$b/bin/$i" done # # make (all ancient versions of) mkinitrd happy which did not look in /usr # mkdir -p "$b"/{bin,sbin,%_lib} ln -s "%_bindir/kmod" "$b/bin/" ls -l "$b/%_libdir/" %if "%_libdir" != "/%_lib" ln -s "%_libdir/libkmod.so.2.3.1" "$b/%_lib/" ln -s libkmod.so.2.3.1 "$b/%_lib/libkmod.so.2" ls -l "$b/%_lib/" %endif %post %{?regenerate_initrd_post} %posttrans %{?regenerate_initrd_posttrans} %post -n %lname -p /sbin/ldconfig %postun -n %lname -p /sbin/ldconfig %files %defattr(-,root,root) %_bindir/kmod %_libexecdir/kmod /bin/kmod %_datadir/bash-completion/ %_mandir/man8/kmod.8* %files -n %lname %defattr(-,root,root) %_libdir/libkmod.so.2* /%_lib/libkmod.so.2* %files -n libkmod-devel %defattr(-,root,root) %_includedir/* %_libdir/pkgconfig/libkmod.pc %_libdir/libkmod.so %files compat %defattr(-,root,root) %_bindir/lsmod %_sbindir/depmod %_sbindir/insmod %_sbindir/lsmod %_sbindir/modinfo %_sbindir/modprobe %_sbindir/rmmod # UsrMerge /bin/lsmod /sbin/depmod /sbin/insmod /sbin/lsmod /sbin/modinfo /sbin/modprobe /sbin/rmmod # EndUsrMerge %_mandir/man5/depmod.d.5* %_mandir/man5/modprobe.d.5* %_mandir/man5/modules.dep.5* %_mandir/man5/modules.dep.bin.5* %_mandir/man8/depmod.8* %_mandir/man8/insmod.8* %_mandir/man8/lsmod.8* %_mandir/man8/modinfo.8* %_mandir/man8/modprobe.8* %_mandir/man8/rmmod.8* %changelog * Tue Nov 22 2016 yousaf.kaukab@suse.com - 0002-depmod-ignore-related-modules-in-depmod_report_cycle.patch: Fix buffer overflow when printing modules in cyclic dependency chain (boo#1008186) * Thu Jul 21 2016 jengelh@inai.de - Update to new upstream release 23 * Don't add comment to modules.devname if it would otherwise be empty. * Ignore .TOC. symbols in depmod parsing. * Fix crash on modinfo while checking for available signature of unknown type. * Teach modinfo about PKCS#7 module signatures. - Drop depmod-Ignore_PowerPC64_ABIv2_.TOC.symbol.patch (merged), 0001-libkmod-Handle-long-lines-in-proc-modules.patch (merged) * Fri Jun 17 2016 mmarek@suse.cz - libkmod: Handle long lines in /proc/modules (bsc#983754) 0001-libkmod-Handle-long-lines-in-proc-modules.patch * Tue Feb 9 2016 dvaleev@suse.com - Fix kernel master build for ppc64le depmod-Ignore_PowerPC64_ABIv2_.TOC.symbol.patch * Mon Dec 7 2015 jengelh@inai.de - Update to new upstream release 22 * support `insmod -f` * depmod: do not fall back to uname on bad version * Sat Nov 7 2015 jengelh@inai.de - Update to new upstream release 21 * The kmod tool now prints the relevant configuration options it was built with when the "--version" argument is passed. * Tue Apr 21 2015 mmarek@suse.cz - Update to kmod 20 * More robust ELF parsing * To fix a race, modprobe only looks at modules.builtin to determine a builtin module, so e.g. 'modprobe vt' will no longer work. * Other fixes * Testsuite moved to a separate package, since it is now building the test modules from sources, which requires the kernel package. * dropped kmod-blacklist-fixtest.patch (merged upstream) * Thu Apr 2 2015 crrodriguez@opensuse.org - If kmod packge changes, regenerate the initrd. * Fri Mar 6 2015 meissner@suse.com - 0001-use-correct-sort-method-in-test-array.patch: use correct test bsc#920930 * Sun Feb 22 2015 meissner@suse.com - kmod-blacklist-fixtest.patch: tag the test in test-blacklist correctly * Sun Nov 16 2014 jengelh@inai.de - Move include files out of pkg/ into a normal subdir of includedir. * Sun Nov 16 2014 crrodriguez@opensuse.org - Update to kmod 19 * Fix missing CLOEXEC in library * Fix error message while opening kmod's index * static-nodes: when writing in tmpfiles format, indicate that creation of static nodes should only happen at boot. This is used and required by systemd-217+. * Sat Nov 8 2014 crrodriguez@opensuse.org - Build with full RELRO. - Enable verbose build (build checks depend on that) * Thu Sep 4 2014 mmarek@suse.cz - Do not filter unsupported modules when running a vanilla kernel (bnc#871066). New patch: 0011-Do-not-filter-unsupported-modules-when-running-a-van.patch * Tue Jun 24 2014 jengelh@inai.de - Update to new upstream release 18 * Calling depmod with modules creating a dependency loop will now make depmod return an error and not update the indexes. This is to protect the current index not being overridden by another index that may cause a boot failure, depending on the buggy module. - Remove last vestiges of gpg-offline - Remove 0001-depmod-Make-dependency-loops-be-fatal.patch (applied upstream) * Fri May 16 2014 matwey.kornilov@gmail.com - Remove 0001-Fix-recursion-loop-in-mod_count_all_dependencies-whe.patch - Add 0001-depmod-Make-dependency-loops-be-fatal.patch (upstream fix for bnc#872715) * Sat Apr 12 2014 matwey.kornilov@gmail.com - Add 0001-Fix-recursion-loop-in-mod_count_all_dependencies-whe.patch * Fix segfault at cycled deps (bnc#872715) * Tue Apr 8 2014 mmarek@suse.cz - Remove the now obsolete test-files.tar.xz tarball * Mon Apr 7 2014 mmarek@suse.com - Updated to kmod 17 * Do not require xsltproc for build * Parse softdeps stored in kernel modules * Add experimental python bindings (not enabled in the package yet) * Misc bugfixes - Deleted patches that went upstream. Only the unsupported modules feature remains: 0002-modprobe-Recognize-allow-unsupported-modules-on-comm.patch 0003-libkmod-config-Recognize-allow_unsupported_modules-i.patch 0009-libkmod-Implement-filtering-of-unsupported-modules-o.patch 0010-modprobe-Implement-allow-unsupported-modules.patch * Tue Mar 11 2014 mmarek@suse.cz - Provide and obsolete module-init-tools (bnc#867442) * Fri Mar 7 2014 mmarek@suse.cz - testsuite: Fix uname() during glibc startup * Wed Mar 5 2014 mmarek@suse.cz - testsuite: Check the list of loaded modules after a test - testsuite: Add test for modprobe --force - testsuite: Do not provide finit_module(2) on older kernels - Add some tests for kernels without finit_module(2) - libkmod-module: Simplify kmod_module_insert_module() - libkmod: Implement filtering of unsupported modules (fate#316971) - modprobe: Implement --allow-unsupported-modules (fate#316971) - make the %%check section fatal * Wed Feb 26 2014 mmarek@suse.cz - Remove "rmmod -w" documentation and getopt entry - modprobe: Recognize --allow-unsupported-modules on commandline (fate#316971) - libkmod-config: Recognize allow_unsupported_modules in the configuration (fate#316971) * Wed Feb 26 2014 mmarek@suse.cz - Drop the non-upstream kmod-no-static.diff; the size difference is negligible. * Tue Jan 7 2014 jengelh@inai.de - Update to new upstream release 16 * The option to wait on module removal has been removed from the kernel, and now from rmmod. The constant KMOD_REMOVE_NOWAIT in libkmod is still there for backwards compatibility but it is always enforced, passing O_NONBLOCK to delete_module(2). * Mon Sep 2 2013 jengelh@inai.de - Update to new upstream release 15 * kmod static-nodes no longer fails if modules.devname does not exist * Fix getting boolean parameter from kernel cmdline in case the value is omitted * kmod static-nodes creates parent directories if given a -o option - Add kmod-no-static.diff * Wed Jul 3 2013 jengelh@inai.de - Update to new upstream release 14 * Some bug fixes and a new "static-nodes" command to parse modules.devname. * Mon Apr 15 2013 crrodriguez@opensuse.org - Update to new upstream release 13 * depmod: --symbol-prefix actually requires an argument * depmod: fix builtin symbols resolution when the prefix symbol is set * libkmod: Use secure_getenv if available * rmmod: Teach rmmod about builtin modules * libkmod: add finit_module logic * modprobe: Fix assertion on --show-depends with bogus config file * Many other bugfixes see https://lwn.net/Articles/546711 * Thu Dec 6 2012 jengelh@inai.de - Update to new upstream release 12 * Fix removing vermagic from module when told to force load a module * Fix removing __versions section when told to force load a module: we need to mangle the section header, not the section. * modinfo no longer fails while loading a module from file when path contains ".ko" substring * Fri Nov 23 2012 jengelh@inai.de - Require suse-module-tools now that it is present in Base:System - kmod-compat depends on kmod, add that missing Requires. * Sat Nov 10 2012 hrvoje.senjan@gmail.com - Update to kmod-11 * Fix testsuite defining symbols twice on 32 bit systems * Allow to check generated files against correct ones * libkmod now keeps a file opened after the first call to * kmod_module_get_{info,versions,symbols,dependency_symbols}. This reduces signficantly the amount of time depmod tool takes to execute. Particularly if compressed modules are used. * Remove --with-rootprefix from build system. It was not a great idea after all and should not be use since it causes more harm than benefits. * Hide --wait option on rmmod. This feature is being targeted for removal from kernel. rmmod still accepts this option, but it is hidden now: man page and usage() says nothing about it and if it is used, user will get a 10s sleep. This way we can check and help if anyone is using this feature. * Refactor message logging on all tools, giving proper prefix, routing everything to syslog when asked for, etc. * Fix parsing of modules.order when using compressed modules * Usage messages go to stdout instead of stderr * Fix memory leak in hash implementation * Thu Sep 13 2012 jengelh@inai.de - Provide the "modutils" virtual symbol - Update to new upstream release 10 * Read coresize from /sys if supported * Add flag to kmod_module_probe_insert() to apply blacklisting during probe only if mod is an alias. Now modprobe uses this flag by default. * Wed Jun 20 2012 rmilasan@suse.com - Update to new upstream release 9 * build-sys: allow compressed modules in testsuite * build-sys: Make dirs writable on rootfs creation * depmod: use ferror and fclose to check for error * depmod: return error when index is truncated due to ENOSPC * depmod: fix coding-style issue in array declaration * depmod: fail if any index could not be created * depmod: don't return error if modules.builtin don't exist * libkmod-util: split function for usec conversion * libkmod-util: add missing stdbool.h include - Fix broken testsuites on 32bit systems. add: fix-32bits.diff * Sat Apr 21 2012 jengelh@medozas.de - Restore patch descriptions (and use `quilt setup` for rediff in future) * Thu Apr 19 2012 rmilasan@suse.com - Update to new upstream release 8 * doc: remove links to NULL going nowhere. * modprobe: handle -ENOENT return from init_module. * doc: silent man page generation and fix gtk-doc warnings. * modprobe: fix typo in config dump: option->options. * Wed Apr 18 2012 rmilasan@suse.com - Update to new upstream release 7 * build-sys: don't set CFLAGS and LDFLAGS. * build-sys: re-organize configure.ac. * configure.ac: Move link only flags out of CFLAGS and into LDFLAGS. * Add CC_CHECK_LDFLAGS_APPEND m4 macro. * config: use order /etc, /run, /lib. * modprobe: set log prio to 0 if user passed -q arg. * modprobe: always try to remove all modules in command line. * modprobe: don't check if module builtin to decide if it's builtin. * modprobe: fix error path in removing modules. * Sat Mar 10 2012 rschweikert@suse.com - place binary in /usr tree (UsrMerge project) * Sat Mar 3 2012 jengelh@medozas.de - Update to new upstream release 6 * New API: kmod_module_apply_filter, a function to apply filters in a list of modules * Lookup modules.builtin.bin to decide if a module is built into the kernel * Resolve infinite loops with softdeps and user configs with install commands * Tue Feb 7 2012 jengelh@medozas.de - Update to new upstream release 5 * modprobe no longer works with paths: it only accepts module names and/or aliases now. More code is now shared by libkmod and modprobe. * Fri Jan 20 2012 jengelh@medozas.de - Update to new upstream release 4 * new APIs in libkmod: blacklists, install/remove commands, aliases, options, softdeps and dumping indexes * Fri Jan 6 2012 jengelh@medozas.de - Update to new upstream release 3 * new APIs in libkmod: get symbols from module, parsing the ELF section, dependency symbols, insert module like modprobe * support for Xz-compressed modules * the depmod tool * Sat Dec 24 2011 crrodriguez@opensuse.org - Use --enable-zlib and buildRequire zlib - run make check * Sun Dec 18 2011 jengelh@medozas.de - Initial package for build.opensuse.org