summaryrefslogtreecommitdiff
path: root/Makefile.am
Commit message (Collapse)AuthorAgeFilesLines
* configure: manage libkmod.pc.in and version.py.in via AC_CONFIG_FILESEmil Velikov2023-02-211-25/+0
| | | | | | | | | | | | | Replace the manual sed command, build rules and dist/clean for using AC_CONFIG_FILES. It does the exact same thing, with an added bonus... Currently we're missing version.py.in in the EXTRA_DIST. Thus a simple "touch Makefile" should retrigger the regeneration of version.py. Which would presumably fail, since the input file isn't in the distribution tarball. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
* testsuite: Handle different sysconfdirLucas De Marchi2023-02-101-5/+1
| | | | | | | | Instead of skipping tests if sysconfdir isn't /etc, just handle it during the rootfs setup logic. Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* testsuite: Move setup-rootfs logic from Makefile to scriptLucas De Marchi2023-02-101-8/+2
| | | | | | | | | It's easier to implement the logic outside of the Makefile, so rename the populate-modules.sh script to setup-rootfs.sh and move the additional logic from the makefile to the script. Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* build: enable building & running tests from a subdirDimitri John Ledkov2022-06-301-0/+1
| | | | | | | | | During dpkg build, in a subdir, it is currently not possible to run tests. Building testsuite/modules due to non-existance of the testsuite directory under the build dir. Thus create it, when it is not there. Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
* kmod 30v30Lucas De Marchi2022-06-301-3/+3
|
* kmod 29v29Lucas De Marchi2021-05-201-1/+1
|
* testsuite: compress modules if feature is enabledLucas De Marchi2021-02-051-1/+1
| | | | | | | | | | | | | | Since the output needs to be the same, regardless if the module is compressed, change populate-modules.sh to conditionally compress the module if that feature is enabled. This way we can execute the tests with any build-time configuration and it should still pass. Suggested-by: Michal Suchánek <msuchanek@suse.de> Reviewed-by: Michal Suchánek <msuchanek@suse.de> Tested-by: Michal Suchánek <msuchanek@suse.de> Reviewed-by: Petr Vorel <pvorel@suse.cz>
* testsuite: Automatically skip tests that fail when sysconfdir != /etc.Marius Bakke2021-01-071-7/+5
|
* kmod 28v28Lucas De Marchi2021-01-071-1/+1
|
* build: add comment with rules for libtool version updateLucas De Marchi2021-01-071-0/+13
|
* build: fix distcheck due to missing zstdLucas De Marchi2020-12-271-1/+1
| | | | Enable zstd since it's used in the testsuite.
* add Zstandard compression supportTorge Matthies2020-09-101-1/+3
| | | | | | | | | | | | | I changed the style of the hackargs variable in autogen.sh to multiline because said line was becoming a bit long with the new --with-zstd arg added. A previous version of this patch has been running on my two Arch Linux installations (with an accompanying mkinitcpio patch) for several months over many kernel updates without any issues. Any additional testing and/or patch review would of course be appreciated. Signed-off-by: Torge Matthies <openglfreak@googlemail.com>
* kmod 27v27Lucas De Marchi2020-02-181-1/+1
|
* libkmod: Add parser for modules.builtin.modinfoAlexey Gladkov2019-12-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The kernel since version v5.2-rc1 exports information about built-in modules in the modules.builtin.modinfo. Information is stored in the same format as in the separate modules (null-terminated string array). The module name is a prefix for each line. $ tr '\0' '\n' < modules.builtin.modinfo ext4.softdep=pre: crc32c ext4.license=GPL ext4.description=Fourth Extended Filesystem ext4.author=Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others ext4.alias=fs-ext4 ext4.alias=ext3 ext4.alias=fs-ext3 ext4.alias=ext2 ext4.alias=fs-ext2 md_mod.alias=block-major-9-* md_mod.alias=md md_mod.description=MD RAID framework md_mod.license=GPL md_mod.parmtype=create_on_open:bool md_mod.parmtype=start_dirty_degraded:int ... Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
* Makefile.am: filter -Wl,--no-undefinedFabrice Fontaine2019-11-181-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | Commit 1d14ef82f4a3be741bcdf6b1c6d51ce9dce43567 does not completely fix the build with python 3.8 as we still get link failure due to '-z undefs' being ignored by some versions of ld. Indeed, -z undefs was added by commit 97a232d7335f3bd0231fd9cd39455bde1d563922 in upstream binutils, and this commit was first present in binutils 2.30. So any toolchain using binutils version older than that won't have -z undefs and will build fail on: /home/buildroot/autobuild/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/mips-linux-gnu/5.3.0/../../../../mips-linux-gnu/bin/ld: warning: -z undefs ignored. /home/naourr/work/instance-1/output-1/host/opt/ext-toolchain/bin/../lib/gcc/aarch64_be-linux-gnu/7.3.1/../../../../aarch64_be-linux-gnu/bin/ld: warning: -z undefs ignored. So filter -Wl,--no-undefined to fix the issue Fixes: - http://autobuild.buildroot.org/results/e9645d9969481b09f507f6e0d0b35faaa283eb60 - http://autobuild.buildroot.org/results/06a6d865b6b7d8ebd793bde214f4a4c40e0962e1 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
* Do not check for undefined symbols when building the Python modulesThomas Petazzoni2019-10-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | kmod's configure.ac uses the -Wl,--no-undefined linker flag to verify at link time that all symbols of shared libraries are available, and that there are no undefined symbols. This make perfect sense for regular shared libraries. However, for Python extensions, which will be dlopen()ed inside the Python interpreter, it makes less sense. Since Python 3.8, there is a change in python-config script and Python's pkg-config file: it no longer links Python extensions with the libpython library. See https://docs.python.org/dev/whatsnew/3.8.html#debug-build-uses-the-same-abi-as-release-build which states: On the other hand, pkg-config python3.8 --libs no longer contains -lpython3.8. C extensions must not be linked to libpython (except on Android and Cygwin, whose cases are handled by the script); this change is backward incompatible on purpose. (Contributed by Victor Stinner in bpo-36721.) So, when linking the kmod Python extensions, it currently fails with numerous unresolved symbols, that were previously provided by libpython: /home/test/autobuild/run/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/powerpc64-buildroot-linux-gnu/7.4.0/../../../../powerpc64-buildroot-linux-gnu/bin/ld: libkmod/python/kmod/.libs/list_la-list.o: in function `__Pyx_PyObject_GetAttrStr': list.c:(.text.__Pyx_PyObject_GetAttrStr+0x48): undefined reference to `PyObject_GetAttr' /home/test/autobuild/run/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/powerpc64-buildroot-linux-gnu/7.4.0/../../../../powerpc64-buildroot-linux-gnu/bin/ld: libkmod/python/kmod/.libs/list_la-list.o: in function `__pyx_tp_dealloc_4kmod_4list_ModListItem': list.c:(.text.__pyx_tp_dealloc_4kmod_4list_ModListItem+0x78): undefined reference to `PyObject_CallFinalizerFromDealloc' /home/test/autobuild/run/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/powerpc64-buildroot-linux-gnu/7.4.0/../../../../powerpc64-buildroot-linux-gnu/bin/ld: libkmod/python/kmod/.libs/list_la-list.o: in function `__pyx_tp_dealloc_4kmod_4list_ModList': list.c:(.text.__pyx_tp_dealloc_4kmod_4list_ModList+0x30): undefined reference to `PyErr_Fetch' [Complete log at http://autobuild.buildroot.net/results/79a/79a5a0398723e8cfea0d0aa3dec5f7649aee4c63/build-end.log] Linking with libpython is no longer recommended: those symbols should remain unresolved in the Python extensions, as they wil be properly resolved when the Python extension gets loaded into the Python interpreter. Since we want to keep -Wl,--no-undefined globally in kmod, we leave the configure.ac file unchanged, and instead, specifically in the LDFLAGS used to build the Python extensions, we override -Wl,--no-undefined with -Wl,-z,undefs. Ideally, -Wl,--no-undefined is the same as -Wl,-z,defs, and the effect of these options can be canceled on the linker command line by a following -Wl,-z,undefs (see the ld man page for details). Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Victor Stinner <victor.stinner@gmail.com>
* build: Stop using doltAdrian Bunk2019-02-201-2/+0
| | | | | | | | | | | | | This does regress "make -12" from 0.7s to 0.9s on my Coffee Lake machine, but even on slower hardware this will not amount to a noticable slowdown. On the other hand using dolt can create problems for people doing cross-compilation, e.g. Yocto has two hacks just for dolt in kmod: https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-kernel/kmod/kmod.inc?id=a17abae00785c76cfffe5381a22fb2c86b982e82 (Lucas: remove leftover entry in Makefile and reformat commit message)
* Link against libcrypto, not all of opensslDave Reisner2019-02-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | In the previous build setup, libkmod.so would link to not just libcrypto.so, but also libssl.so: $ readelf -d /lib/libkmod.so | grep NEEDED 0x0000000000000001 (NEEDED) Shared library: [liblzma.so.5] 0x0000000000000001 (NEEDED) Shared library: [libz.so.1] 0x0000000000000001 (NEEDED) Shared library: [libssl.so.1.1] 0x0000000000000001 (NEEDED) Shared library: [libcrypto.so.1.1] 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] We don't need any symbols from libssl, though. This patch ensures that we pass 'libcrypto' to pkgconfig rather than 'openssl', getting only the library that we need: $ readelf -d ./libkmod/.libs/libkmod.so.2.3.4 | grep NEEDED 0x0000000000000001 (NEEDED) Shared library: [liblzma.so.5] 0x0000000000000001 (NEEDED) Shared library: [libz.so.1] 0x0000000000000001 (NEEDED) Shared library: [libcrypto.so.1.1] 0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
* kmod 26v26Lucas De Marchi2019-02-071-1/+1
|
* build: fix make distcheckLucas De Marchi2019-02-071-1/+2
| | | | | | Make sure to add the dummy.pkcs7 file to the dist files. While at it, also change the distcheck flags to include --with-openssl.
* libkmod-signature: implement pkcs7 parsing with opensslYauheni Kaliuta2019-02-041-1/+3
| | | | | | | | | | | | | | | The patch adds data fetching from the PKCS#7 certificate using openssl library (which is used by scripts/sign-file.c in the linux kernel to sign modules). In general the certificate can contain many signatures, but since kmod (modinfo) supports only one signature at the moment, only first one is taken. With the current sign-file.c certificate doesn't contain signer key's fingerprint, so "serial number" is used for the key id. Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
* Remove bootstrap* scriptsLucas De Marchi2018-12-171-1/+1
| | | | | | Let's just use autogen.sh, no need for wrapper scripts. Now `autogen.sh c` uses the same recommended options for developing kmod and also accepts extra arguments.
* kmod 25v25Lucas De Marchi2018-01-081-1/+1
|
* testsuite: generalize mkosi support for other distrosLucas De Marchi2018-01-031-1/+3
| | | | | | | | | | | | | Instead of using the mkosi.default symlink, use an env var passed from the build system. We would need to pass the --default switch nonetheless or change the symlink, making the git tree dirty. Also, search for installed kernel headers in a way that's compatible with more distros. On Fedora, for example, the /usr/lib/modules/<kver>/build symlink is only available if there's a kernel installed. We don't care about a kernel installed since we don't need to boot it on a real machine: the only thing we need is the kernel-devel package.
* build: use tool from configureLucas De Marchi2018-01-021-2/+2
| | | | | This way we make sure the tool will be the one we actually configured before going through sudo.
* build: add mkosi hooksLucas De Marchi2018-01-021-0/+8
| | | | Right now there's support for building on Archlinux only.
* kmod 24v24Lucas De Marchi2017-02-231-1/+1
|
* build: add missing headerLucas De Marchi2017-02-231-0/+1
| | | | Fix failing distcheck
* testsuite: depmod: check netsted loops reportingYauheni Kaliuta2017-02-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | The patch adds nested loops configuration for the loop test: mod-loop-h -> mod-loop-i -> mod-loop-j -> mod-loop-k ^ | | --------------------------- | | | ------------------------------------------- making 2 loops with common edges: mod-loop-h -> mod-loop-i -> mod-loop-j -> mod-loop-h mod-loop-h -> mod-loop-i -> mod-loop-j -> mod-loop-k -> mod-loop-h The actual output for the loops is: depmod: ERROR: Cycle detected: mod_loop_h -> mod_loop_h depmod: ERROR: Cycle detected: mod_loop_i -> mod_loop_j -> mod_loop_k -> mod_loop_h -> mod_loop_i (the order in the second doesn't matter, but the first one is incorrect) Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
* build: fix build with disabled test modulesLucas De Marchi2016-11-101-0/+2
| | | | | | | | | | | | | | install: cannot stat 'testsuite/module-playground/mod-loop-f.ko': No such file or directory Makefile:2881: recipe for target 'rootfs' failed make[1]: *** [rootfs] Error 1 make[1]: *** Waiting for unfinished jobs.... Makefile:2101: recipe for target 'check-recursive' failed We need to ship pre-compiled binaries so it's possible to run "make check" on servers without kernel headers. Also add them to EXTRA_DIST as other sources.
* Add scratchbuf implementationLucas De Marchi2016-08-151-0/+5
| | | | | | | This should fill the requirements for "we need to loop over a lot of strings that usually are small enough to remain on stack, but we want to protect ourselves against huge strings not fitting in the static buffer we estimated as sufficient"
* kmod 23v23Lucas De Marchi2016-07-201-1/+1
|
* kmod: compiling with old sed version (!ERE support)Héctor Orón Martínez2016-05-211-1/+1
| | | | | | | | | Makefile.am uses `sed -E', which it is found on BSD sed; however a replacement on GNU sed would be `sed -r'. Both intend to use extended regular expressions (ERE). However I have a system that does not support those, in benefit for portability could you consider replacing ERE by BRE. Signed-off-by: Héctor Orón Martínez <hector.oron@gmail.com>
* kmod 22v22Lucas De Marchi2015-11-171-3/+3
|
* build: let sed use posix ERE instead of GNU extensionNatanael Copa2015-06-221-1/+1
| | | | | | | | | Use POSIX Extended Regular Expression (ERE) instead of the GNU extension \| in the install-exec-hook. This makes it create the symlink properly with busybox sed built with musl libc. It will silently create a broken symlink otherwise. Lucas De Marchi: fix up added newline.
* kmod 21v21Lucas De Marchi2015-06-091-1/+1
|
* build: add cache to distributed filesLucas De Marchi2015-06-091-0/+1
| | | | We were missing the cache directory on the distributed files.
* build: silence stderr on coverity rulesLucas De Marchi2015-06-091-2/+2
| | | | | | | | We try to execute git in order to get the dependencies for the coverity rules. And it gets executed even when we are not calling that specific rule. Later we may want to improve it, but for now let's just silence the errors of not being a git repository when executing this on a packaged version.
* tools: Hide new commands behind experimental flagLucas De Marchi2015-06-061-3/+15
| | | | | Hide the commands behind a flag so we can continue doing releases while the commands aren't ready.
* build: cache modules from playgroundcached-modulesLucas De Marchi2015-05-311-0/+5
| | | | | | | | | | Now that we are able to build our own test modules, also allow to use cached modules so a) kernel headers are not required and b) distro maintainers are happy. It's still need a "--disable-test-modules" in the configure since the default is enabled. There's no license problems anymore since all modules come from our own repository, we ship the sources and the modules can be easily rebuilt.
* build: sync dolt with upstreamLucas De Marchi2015-03-101-0/+3
|
* tools: add basic versions of insert and removeCaio Marcelo de Oliveira Filho2015-03-071-1/+6
|
* testsuite: remove .gitignore files when populating rootfsCaio Marcelo de Oliveira Filho2015-03-051-0/+1
| | | | | | | | | | | | Usually this file is added to keep a directory existing in the repository but without any real content. In rootfs this can be problematic if a directory will have all its files inspected. This happens for kmod_module_get_holders(). Side-note: the 'test-loaded.c' is hit by this problem but doesn't "notice" because the invalid module returned by get_holders() is not checked. The modules in its loop are only used to get the name and generate an output, and NULL was a valid value to generate the name.
* kmod 20v20Lucas De Marchi2015-03-011-1/+1
|
* testsuite: test builtin stateLucas De Marchi2015-02-281-1/+5
| | | | | | | | The second test, that creates the module by name and then retrieves the initstate was broken before b95fa91 ('Fix race while loading modules'). We would check /sys and return either builtin (if the module has parameters) or give an error because we don't find the module (even if it's in the modules.builtin index)
* build: add helpers to upload coverity tarballLucas De Marchi2015-02-251-0/+25
|
* build: add missing files to EXTRA_DISTLucas De Marchi2015-02-241-7/+23
| | | | Fix make distcheck.
* build: let touch on directory as last stepLucas De Marchi2015-02-031-2/+2
| | | | | | We need to let these instructions in kmod to be the last executed ones. Otherwise the subdirectory containing the modules could propagate up the time access.
* testsuite: port test-dependencies to module-playgroundLucas De Marchi2015-02-031-0/+4
|
* testsuite: beef up module-playground in the build systemLucas De Marchi2015-02-031-4/+26
| | | | | | | | Instead of shipping pre-compiled module, this prepares the build system to be able to compile the necessary modules from module-playground. This preparations starts by replacing md5.ko with our own dummy mod-simple.ko, built from source. It works by copying the modules to their final location while preparing the rootfs.