Commit Graph

175 Commits

Author SHA1 Message Date
Lucas De Marchi
dbf90dc3a8 testsuite: test builtin state
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)
2015-02-28 14:18:54 -03:00
Lucas De Marchi
0bcdef9700 build: add helpers to upload coverity tarball 2015-02-25 12:57:31 -03:00
Lucas De Marchi
80f6ab5c9c build: add missing files to EXTRA_DIST
Fix make distcheck.
2015-02-24 01:50:32 -03:00
Lucas De Marchi
0e68c6258e build: let touch on directory as last step
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.
2015-02-03 05:19:38 -02:00
Lucas De Marchi
450c1f037b testsuite: port test-dependencies to module-playground 2015-02-03 01:12:13 -02:00
Lucas De Marchi
4002d77aff testsuite: beef up module-playground in the build system
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.
2015-02-03 01:09:17 -02:00
Caio Marcelo de Oliveira Filho
2200a448d4 testsuite: add tests for kmod_list
Some tests cover internal API that wasn't used
elsewhere. The choice here was to test and keep the
list implementation complete instead of removing it.
2015-01-26 19:20:51 -02:00
Lucas De Marchi
e9b0d1b40e build-sys: integrate coverage report
Just pass --enable-coverage to configure and then "make coverage" to
have the coverage report at coverage dir.
2015-01-07 23:02:34 -02:00
Lucas De Marchi
8ff7f008cd testsuite: do not overrid paths inside build
If we are accessing a file inside the build directory we should really
not trap the path. Right now this isn't important because we never do
such accesses. However it will be needed when gcov is integrated because
it dumps files to the same place where the binaries are located.
2015-01-07 19:14:20 -02:00
Lucas De Marchi
84aaaedfa6 build-sys: rename cflags/ldflags variable
Not all of them are for warnings or gc.
2015-01-02 16:32:03 -02:00
Lucas De Marchi
dd66ff3a14 build-sys: Don't define LIBEXECDIR
Like b2fd181 (Makefile.am: Don't define LIBEXECDIR) in libabc by Josh
Triplett.
2014-12-25 23:41:34 -02:00
Lucas De Marchi
1315123955 build-sys: Don't add libkmod subdirectory to include path
Like 05437b8 (Makefile.am: Don't add abc subdirectory to include path)
in libabc by Josh Triplett.
2014-12-25 23:41:34 -02:00
Mike Auty
fd56638aed build: Do not force diagnostics-color flag
The -fdiagnostics-color flag is only available on GCC >= 4.9, for
older versions this could raise an error in certain circumstances
(such as when using ccache).  Instead, since -fdiagnostic-color=auto
by default  in gcc-4.9, simply set the required environment variable
to the default one if it's undefined.

Based mostly on the systemd commit f44541bc by Michal Schmidt.
2014-12-17 00:41:01 -02:00
Lucas De Marchi
f9e2167b10 kmod 19 2014-11-16 10:24:50 -02:00
Lucas De Marchi
48e4d18191 testsuite: add tests for strbuf 2014-10-13 18:42:01 -03:00
Lucas De Marchi
b4d1f44af1 Move strbuf implementation to shared/
Just move the strbuf-like implementation to shared/. No renames were
made yet to avoid cluttering the diff. It will come in a separate patch.
2014-10-11 13:09:42 -03:00
Lucas De Marchi
2c5bc218be build-sys: rename libkmod-util convenience library
Now that all source code from libkmod-util has been moved to shared/
directory, rename also the convenience library to libshared.
2014-10-09 01:26:39 -03:00
Lucas De Marchi
f4e8c16291 Move remaining functions from libkmod-util to shared 2014-10-09 01:26:39 -03:00
Lucas De Marchi
fdafa6b655 testsuite: add tests for array implementation 2014-10-09 01:26:39 -03:00
Lucas De Marchi
1a07559af3 Clarify what licences apply where
This doesn't change any license, just clarifies what's licensed under
LGPL and what's under GPL.
2014-10-09 01:26:34 -03:00
Lucas De Marchi
0db718edcf Move hash implementation to shared directory 2014-10-03 00:40:11 -03:00
Lucas De Marchi
74d1df6682 Move array implementation to shared directory 2014-10-03 00:33:25 -03:00
Lucas De Marchi
8eded79c50 build-sys: normalize line breaks
Break lines earlier, as it's already done in some places and use only 1
tab to avoid reaching the column limit.
2014-10-03 00:33:25 -03:00
Lucas De Marchi
96573a0220 Move generic util functions to shared directory 2014-10-03 00:33:25 -03:00
Lucas De Marchi
8b7189bc25 Move missing.h to shared directory 2014-10-03 00:31:10 -03:00
Lucas De Marchi
576dd4393d Move macro.h to shared directory
It's not really related to libkmod, so move it to a directory in which
we keep common stuff.
2014-10-02 22:03:19 -03:00
Lucas De Marchi
ae58de0fcb kmod 18 2014-06-14 12:46:38 -03:00
Lucas De Marchi
5963c36da3 testsuite: Add basic tests for hash implementation
Far from complete, but already covers all internal APIs.
2014-06-06 02:24:39 -03:00
Lucas De Marchi
49d8e0b590 kmod 17 2014-04-06 17:52:44 -03:00
Michal Marek
9324bb52f3 testsuite: Warn if sysconfdir is not /etc 2014-04-04 13:06:05 +02:00
Lucas De Marchi
3a33a7a566 build-sys: add hooks to build python bindings
Add --enable-python configure switch so we build the python bindings. We
also pass version.py through SED_PROCESS macro, so the version is kept
in sync with kmod.

Acked-by: Andy Grover <agrover@redhat.com>
2014-03-26 22:30:56 -03:00
Lucas De Marchi
36c4bb928a kmod 16 2013-12-22 19:45:19 -02:00
Lucas De Marchi
807c601df2 testsuite: Move test-alias to test-util
Move file so we can use the same file to test other functions from
libkmod-util.c
2013-11-18 04:35:03 -02:00
Saul Wold
518daf4fd1 Makefile.am: add mkdir testsuite
If we are note building in the existing source tree and have disabled
dependency-tracking then the testsuite directory is not created during
the configure phase and will not exist when the cp of ROOTFS_PRISTINE
occurs, thus causing an error and fail.
2013-10-10 11:23:44 -03:00
Saul Wold
16535abe3a Makefile.am: Add target to all cross-compilation of testsuite
The buildtest-TESTS target allows for cross-compilation of the testsuites
without the actual running of the tests that check normally does.
2013-10-10 01:17:09 -03:00
Lucas De Marchi
18811d22e9 kmod 15 2013-08-22 10:44:08 -03:00
Lucas De Marchi
80cf2c8f05 build: Install bash completion data 2013-07-30 14:45:21 -03:00
Lucas De Marchi
85d02ebea3 util: Add mkdir_p implementation from testsuite 2013-07-15 12:44:33 -03:00
Lucas De Marchi
83b855a6ed Use "-internal" suffix instead of "-private" 2013-07-04 16:13:11 -03:00
Lucas De Marchi
b6adccd6ff tools: Do not link dynamically with libkmod
Instead of linking dynamically with libkmod, use libkmod-private.la. We
disallow creating a static libkmod because we can't hide symbols there
and it cause problems with external programs. However this should not
prevent users that are only interested in the tools we provide not being
able to ship only them keeping the library alone.

Other projects also do this to allow our tools to use certain functions
that should not be used outside of the project.
2013-07-04 16:08:10 -03:00
Lucas De Marchi
3b38c7fcb5 kmod 14 2013-07-03 12:42:04 -03:00
Lucas De Marchi
9de9e07da6 tools: Use test/kmod instead of kmod-nolib
The reason to have a kmod-nolib binary is that we need to call kmod on
test cases (or a symlink to it) and for testing things in tree. Since
we are using libtool if we are dinamically linking to libkmod what we
end up having is a shell script that (depending on the version *)
changes argv[0] to contain an "lt-" prefix. Since this screws with our
compat stuff, we had a kmod-nolib that links statically.

This all workaround works fine iff we are using one of the compat
commands, i.e. we are using the symlinks insmod, rmmod, modprobe, etc.
However if we are actually trying the kmod binary, this doesn't work
because we can't create a kmod symlink since there's already a kmod
binary.

So, completely give up on libtool fixing their mess. Now we create a
tool/test/ directory and the symlinks and kmod is put there.

* http://lists.gnu.org/archive/html/bug-libtool/2011-12/msg00023.html
2013-07-02 21:15:54 -03:00
Tom Gundersen
db6f2fc7e1 tools: add static-nodes tool
This tool reads modules.devname from the current kernel directory and outputs
the information. By default in a human-readable format, and optionally in
machine-readable formats.

For now only the tmpfiles.d(5) format is supported, but more could easily be
added in the future if there is a need.

This means nothing but kmod needs to reads the private files under
/lib/modules/. In particular systemd-udevd can stop reading modules.devname.

Tools that used to read /lib/modules/`uname -r`/modules.devname directly, can
now move to reading 'kmod static-nodes devname'.
2013-04-16 23:10:36 -03:00
Lucas De Marchi
abb910eb9d kmod 13 2013-04-09 19:35:32 -03:00
Lucas De Marchi
1407064e73 libkmod: Add missing definitions
Depending on kernel header and simply not passing the flags in
finit_module() if this header is not found is not good.

Add a missing.h header in which stuff like this should be added.
2013-04-09 04:05:09 -03:00
Michal Marek
8fe1681c52 libkmod: Return module signature information in kmod_module_get_info()
If the module is built with CONFIG_MODULE_SIG, add the the signer's
name, hexadecimal key id and hash algorithm to the list returned in
kmod_module_get_info(). The modinfo output then looks like this:

filename:       /home/mmarek/kmod/testsuite/rootfs-pristine/test-modinfo/ext4-x86_64-sha256.ko
license:        GPL
description:    Fourth Extended Filesystem
author:         Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others
alias:          ext3
alias:          ext2
depends:        mbcache,jbd2
intree:         Y
vermagic:       3.7.0 SMP mod_unload
signer:         Magrathea: Glacier signing key
sig_key:        E3:C8:FC:A7:3F:B3:1D:DE:84:81:EF:38:E3:4C:DE:4B:0C:FD:1B:F9
sig_hashalgo:   sha256

The signature algorithm (RSA) and key identifier type (X509) are not
displayed, because they are constant information for every signed
module. But it would be trivial to add this. Note: No attempt is made at
verifying the signature, I don't think that modinfo is the right tool
for this.
2013-01-17 23:48:43 -02:00
Lucas De Marchi
6feba02878 kmod 12 2012-12-05 01:39:17 -02:00
Lucas De Marchi
c599606f75 kmod 11 2012-11-08 02:30:21 -02:00
Lucas De Marchi
92aad74925 tools: use a single function for logging libkmod output 2012-11-06 18:35:17 -02:00
Lucas De Marchi
84341fbe01 tools: share function to convert prio to string
No change is expected in the final binary since right now only an inline
function is shared. Later we expect to share more code.
2012-11-06 17:10:57 -02:00