]> git.ipfire.org Git - thirdparty/kmod.git/log
thirdparty/kmod.git
9 years agotestsuite: test kmod_module_remove_module for failure
Lucas De Marchi [Wed, 14 Jan 2015 16:08:56 +0000 (14:08 -0200)] 
testsuite: test kmod_module_remove_module for failure

9 years agoshared: add STRINGFY macro
Lucas De Marchi [Wed, 14 Jan 2015 16:31:34 +0000 (14:31 -0200)] 
shared: add STRINGFY macro

9 years agotestsuite: fix retcodes parsing
Lucas De Marchi [Wed, 14 Jan 2015 16:05:24 +0000 (14:05 -0200)] 
testsuite: fix retcodes parsing

It was not saving _modules in modules and thus all check were falling in
the fallback "consider a success if module is not in the list". Also the
name check wasn't right: replace with streq().

The parsing could be better implemented, but this is left for later.

9 years agotools: kmod: use streq
Lucas De Marchi [Wed, 14 Jan 2015 14:28:02 +0000 (12:28 -0200)] 
tools: kmod: use streq

9 years agoCODING-STYLE: add include order
Lucas De Marchi [Wed, 14 Jan 2015 14:33:10 +0000 (12:33 -0200)] 
CODING-STYLE: add include order

9 years agotools: kmod: break iteration once a command is executed
Caio Marcelo de Oliveira Filho [Wed, 14 Jan 2015 14:02:16 +0000 (12:02 -0200)] 
tools: kmod: break iteration once a command is executed

9 years agoUpdate TODO
Lucas De Marchi [Wed, 14 Jan 2015 13:10:53 +0000 (11:10 -0200)] 
Update TODO

9 years agotestsuite: add test for array_pop()
Lucas De Marchi [Thu, 8 Jan 2015 19:10:18 +0000 (17:10 -0200)] 
testsuite: add test for array_pop()

9 years agobuild-sys: integrate coverage report
Lucas De Marchi [Wed, 7 Jan 2015 21:17:15 +0000 (19:17 -0200)] 
build-sys: integrate coverage report

Just pass --enable-coverage to configure and then "make coverage" to
have the coverage report at coverage dir.

9 years agotestsuite: do not overrid paths inside build
Lucas De Marchi [Wed, 7 Jan 2015 21:14:20 +0000 (19:14 -0200)] 
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.

9 years agobuild-sys: rename cflags/ldflags variable
Lucas De Marchi [Fri, 2 Jan 2015 18:32:03 +0000 (16:32 -0200)] 
build-sys: rename cflags/ldflags variable

Not all of them are for warnings or gc.

9 years agoFix include in python bindings
Lucas De Marchi [Fri, 2 Jan 2015 15:10:52 +0000 (13:10 -0200)] 
Fix include in python bindings

Prefix the include of libkmod in python bindings.

9 years agolibkmod-elf: Remove unused variables
Lucas De Marchi [Fri, 2 Jan 2015 14:44:59 +0000 (12:44 -0200)] 
libkmod-elf: Remove unused variables

libkmod/libkmod-elf.c:52:34: warning: unused variable 'native_endianess'
      [-Wunused-const-variable]
static const enum kmod_elf_class native_endianess = KMOD_ELF_LSB;

9 years agoFix includes after change to build-sys
Lucas De Marchi [Fri, 2 Jan 2015 14:38:27 +0000 (12:38 -0200)] 
Fix includes after change to build-sys

Make the includes be libkmod/libkmod.h for code outside of library. This
fixes the broken build after 1315123 ('build-sys: Don't add libkmod
subdirectory to include path').

9 years agoRemove FSF mailing address
Lucas De Marchi [Fri, 26 Dec 2014 01:32:03 +0000 (23:32 -0200)] 
Remove FSF mailing address

It has changed in the past, and these days, anyone can get a copy of the
LGPL via the web rather than by post.

Like 657a122 (Remove FSF mailing address) in libabc by Josh Tripplet,
but let the FSF website in which the license can be found.

9 years agobuild-sys: set -e separately, rather than putting -e in the shebang line
Lucas De Marchi [Fri, 26 Dec 2014 01:12:22 +0000 (23:12 -0200)] 
build-sys: set -e separately, rather than putting -e in the shebang line

Like a008d76 (autogen.sh: set -e separately, rather than putting -e in
the shebang line) in libabc by Josh Triplett.

9 years agobuild-sys: Don't define LIBEXECDIR
Lucas De Marchi [Fri, 26 Dec 2014 01:11:04 +0000 (23:11 -0200)] 
build-sys: Don't define LIBEXECDIR

Like b2fd181 (Makefile.am: Don't define LIBEXECDIR) in libabc by Josh
Triplett.

9 years agobuild-sys: Don't add libkmod subdirectory to include path
Lucas De Marchi [Fri, 26 Dec 2014 01:07:48 +0000 (23:07 -0200)] 
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.

9 years agobuild: Do not force diagnostics-color flag
Mike Auty [Fri, 5 Dec 2014 00:49:13 +0000 (00:49 +0000)] 
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.

9 years agoREADME: move mailing list information to top
Lucas De Marchi [Sat, 13 Dec 2014 13:55:05 +0000 (11:55 -0200)] 
README: move mailing list information to top

It seems people are missing the information about the mailing list, so
let's move it to the top in hope it's more visible.

9 years agoutil: fix build on systems missing strndupa
Natanael Copa [Mon, 17 Nov 2014 08:36:29 +0000 (09:36 +0100)] 
util: fix build on systems missing strndupa

we need include shared/missing.h to be able to compile on sysmtes that
lacks strndupa.

9 years agoNEWS: Fix typos
Lucas De Marchi [Sun, 16 Nov 2014 12:37:45 +0000 (10:37 -0200)] 
NEWS: Fix typos

9 years agokmod 19 v19
Lucas De Marchi [Sun, 16 Nov 2014 12:24:50 +0000 (10:24 -0200)] 
kmod 19

9 years agolibkmod-index: move comment to include the includes
Lucas De Marchi [Tue, 28 Oct 2014 03:58:11 +0000 (01:58 -0200)] 
libkmod-index: move comment to include the includes

9 years agolibkmod-index: remove invalid comment
Lucas De Marchi [Tue, 28 Oct 2014 03:56:42 +0000 (01:56 -0200)] 
libkmod-index: remove invalid comment

9 years agodepmod: point to documentation in libkmod
Lucas De Marchi [Tue, 28 Oct 2014 03:52:49 +0000 (01:52 -0200)] 
depmod: point to documentation in libkmod

Instead of repeating all documentation, point to the documentation
available in libkmod-index.c

This also removes INDEX_PRIORITY_MIN that was not being used.

9 years agolibkmod-index: keep index and comments in .c
Lucas De Marchi [Tue, 28 Oct 2014 03:47:50 +0000 (01:47 -0200)] 
libkmod-index: keep index and comments in .c

Just like other source files, keep the index and comments in the source
file rather than the header.

This also removes INDEX_PRIORITY_MIN that was never being used.

9 years agostatic-nodes: indicate that creation of static nodes should only happen at boot
Tom Gundersen [Mon, 27 Oct 2014 16:55:03 +0000 (17:55 +0100)] 
static-nodes: indicate that creation of static nodes should only happen at boot

udev will only manage static nodes that exist at the time udev is started, so
creating static nodes later on will likely not behave as expected. In
particular, recreating the static nodes at run-time will reset any permissions
udev may have applied to the nodes at boot.

See <https://bugzilla.redhat.com/show_bug.cgi?id=1147248> and the discussion
following <http://permalink.gmane.org/gmane.comp.sysutils.systemd.devel/23795>.

Note that this requires (the yet to be released) systemd v217 or a backport
of systemd patch 8c94052ee543c3598a3c7b0c46688150aa2c6168.

9 years agostrbuf: make strbuf_pushchars() a little less dumb
Lucas De Marchi [Fri, 17 Oct 2014 00:39:33 +0000 (21:39 -0300)] 
strbuf: make strbuf_pushchars() a little less dumb

Do not push one char at a time. We have strlen() and memcpy() to rely
on.

9 years agostrbuf: do not calculate next step in size on all calls
Lucas De Marchi [Fri, 17 Oct 2014 00:22:32 +0000 (21:22 -0300)] 
strbuf: do not calculate next step in size on all calls

We only need to check if the new size is less or equal than the current
size. We don't really need to calculate the next step.

9 years agostrbuf: reduce default buffer size
Lucas De Marchi [Fri, 17 Oct 2014 00:02:13 +0000 (21:02 -0300)] 
strbuf: reduce default buffer size

Using 2048 as buffer sizer for strbuf is a bit exaggerated. strbuf is
used much more when we are not using mmapped indexes, but it's used for
mmapped when for example searching for an alias. A quick and dirty hack
to output the size of our strbufs is to print buf->used inside
strbuf_str(). Doing this and creating some statistics with:

while read xxx alias xxx; do
    tools/modprobe -R "$alias" > /dev/null;
done < /lib/modules/$(uname -r)/modules.alias 2>&1 | \
     Rscript -e 'summary (as.numeric (readLines ("stdin")))'

   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's
   1.00   29.00   31.00   31.55   38.00   92.00      26

So, reduce the step to 128, which is still greater than the maximum in
these cases. In the worst case this can only create a few calls to
realloc(), while keeping the memory footprint low for the common cases.

9 years agotestsuite: add tests for strbuf
Lucas De Marchi [Mon, 13 Oct 2014 21:42:01 +0000 (18:42 -0300)] 
testsuite: add tests for strbuf

9 years agoshared: rename prefixes of strbuf functions
Lucas De Marchi [Sat, 11 Oct 2014 16:25:51 +0000 (13:25 -0300)] 
shared: rename prefixes of strbuf functions

Use strbuf_ prefix instead of buf_.

9 years agoMove strbuf implementation to shared/
Lucas De Marchi [Sat, 11 Oct 2014 16:03:21 +0000 (13:03 -0300)] 
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.

9 years agotestsuite: remove now unused array of tests
Lucas De Marchi [Thu, 9 Oct 2014 17:29:04 +0000 (14:29 -0300)] 
testsuite: remove now unused array of tests

Remove the arrays and let each test with a guaranteed unique name.

9 years agotestsuite: use a section to put tests in instead of array
Lucas De Marchi [Thu, 9 Oct 2014 17:14:58 +0000 (14:14 -0300)] 
testsuite: use a section to put tests in instead of array

Intead of having to declare an array of tests, tweak the definition of
DEFINE_TEST and TESTSUITE_MAIN so they know the tests are put in a
particular section of the ELF file.

This avoids the mistake of adding a test and forgetting to add it to the
array. Now once a test is defined, it's ready to run, so one less step
to define new tests.

The removal of the arrays is left for another patch so not to clutter
the diff on this one.

9 years agoMove static keyword to DEFINE_TEST macro
Lucas De Marchi [Thu, 9 Oct 2014 16:00:30 +0000 (13:00 -0300)] 
Move static keyword to DEFINE_TEST macro

9 years agolibkmod: remove unused inline functions
Lucas De Marchi [Thu, 9 Oct 2014 14:07:33 +0000 (11:07 -0300)] 
libkmod: remove unused inline functions

libkmod/libkmod-list.c:39:33: warning: unused function 'list_node_next' [-Wunused-function]
static inline struct list_node *list_node_next(const struct list_node *node)
                                ^
libkmod/libkmod-list.c:47:33: warning: unused function 'list_node_prev' [-Wunused-function]
static inline struct list_node *list_node_prev(const struct list_node *node)
                                ^

It doesn't really matter in the end result since the compiler won't
generate any code for it. But let's keep it clean. It wasn't needed
until now, so probably it won't be anymore.

9 years agoChange parameter from int to char
Lucas De Marchi [Thu, 9 Oct 2014 14:03:29 +0000 (11:03 -0300)] 
Change parameter from int to char

It's a char not an int.

9 years agoLog error on failed underscores(), moving it to shared/
Lucas De Marchi [Thu, 9 Oct 2014 13:59:08 +0000 (10:59 -0300)] 
Log error on failed underscores(), moving it to shared/

Move underscores() to shared/. It's the same as alias_normalize(), but
it rather operates in place, with the same string being passed.

The difference now that it's in shared/ is that it's a non-logging
function.

This makes us a little bit more verbose: we don't accept partially
correct module and aliases names in kcmdline and in configuration files.
We log an error instead.

9 years agobuild-sys: rename libkmod-util convenience library
Lucas De Marchi [Thu, 9 Oct 2014 04:20:35 +0000 (01:20 -0300)] 
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.

9 years agoMove remaining functions from libkmod-util to shared
Lucas De Marchi [Thu, 9 Oct 2014 04:14:16 +0000 (01:14 -0300)] 
Move remaining functions from libkmod-util to shared

9 years agodepmod: use alias_normalize() from shared
Lucas De Marchi [Thu, 9 Oct 2014 03:54:29 +0000 (00:54 -0300)] 
depmod: use alias_normalize() from shared

Remove underscores2() function which is essentially the same as
alias_normalize() and the latter, which is now in shared/.

9 years agoMove alias_normalize() to shared
Lucas De Marchi [Thu, 9 Oct 2014 03:43:01 +0000 (00:43 -0300)] 
Move alias_normalize() to shared

9 years agoDo not rely on prio_to_str() being always inline
Lucas De Marchi [Thu, 9 Oct 2014 03:01:45 +0000 (00:01 -0300)] 
Do not rely on prio_to_str() being always inline

This function was declared as always-inline so there was not really a
problem in returning prioname, that could possibly point to the local
buf[] variable.

However static analysis tools are often confused about this and being
always-inline was just a workaround to make it work.

So, let's move the buffer to the caller. We have only 2 callers so it
doesn't matter much. This always reduce the size of log.o, since now the
function is not inlined anymore. Below is the size for "-g -O2" with
gcc:

before:
   text    data     bss     dec     hex filename
   1325       4       1    1330     532 tools/log.o

after:
   text    data     bss     dec     hex filename
   1171       4       1    1176     498 tools/log.o

9 years agoDo not export array of kmod extensions
Lucas De Marchi [Wed, 8 Oct 2014 17:33:42 +0000 (14:33 -0300)] 
Do not export array of kmod extensions

The only user outside of libkmod-util is depmod, which really only needs
to get the string for the extension of uncompressed modules. It doesn't
need to access the array itself.

9 years agotestsuite: add tests for array implementation
Lucas De Marchi [Wed, 8 Oct 2014 04:12:15 +0000 (01:12 -0300)] 
testsuite: add tests for array implementation

9 years agoClarify what licences apply where
Lucas De Marchi [Wed, 8 Oct 2014 02:23:11 +0000 (23:23 -0300)] 
Clarify what licences apply where

This doesn't change any license, just clarifies what's licensed under
LGPL and what's under GPL.

9 years agoRename getline_wrapped() to freadline_wrapped()
Lucas De Marchi [Fri, 3 Oct 2014 06:25:06 +0000 (03:25 -0300)] 
Rename getline_wrapped() to freadline_wrapped()

9 years agoPrefer inttypes.h over stdint.h
Lucas De Marchi [Fri, 3 Oct 2014 05:03:55 +0000 (02:03 -0300)] 
Prefer inttypes.h over stdint.h

9 years agoReorder and reorganize header files
Lucas De Marchi [Fri, 3 Oct 2014 04:41:42 +0000 (01:41 -0300)] 
Reorder and reorganize header files

Let the includes in the following order:

< system headers >
< libkmod >
< tool >
< local headers >

9 years agoMove hash implementation to shared directory
Lucas De Marchi [Fri, 3 Oct 2014 03:29:18 +0000 (00:29 -0300)] 
Move hash implementation to shared directory

9 years agoMove array implementation to shared directory
Lucas De Marchi [Fri, 3 Oct 2014 03:22:36 +0000 (00:22 -0300)] 
Move array implementation to shared directory

9 years agobuild-sys: normalize line breaks
Lucas De Marchi [Fri, 3 Oct 2014 03:13:49 +0000 (00:13 -0300)] 
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.

9 years agoMove generic util functions to shared directory
Lucas De Marchi [Fri, 3 Oct 2014 03:01:35 +0000 (00:01 -0300)] 
Move generic util functions to shared directory

9 years agoMove missing.h to shared directory
Lucas De Marchi [Fri, 3 Oct 2014 01:08:47 +0000 (22:08 -0300)] 
Move missing.h to shared directory

9 years agoMove macro.h to shared directory
Lucas De Marchi [Fri, 3 Oct 2014 01:03:19 +0000 (22:03 -0300)] 
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.

9 years agoAdd back-up implementation of be32toh()
Randy MacLeod [Mon, 29 Sep 2014 19:18:04 +0000 (21:18 +0200)] 
Add back-up implementation of be32toh()

Older systems may not have the be32toh function defined. Check for this
and fall back to checking the endianness and calling bswap_32 directly
if needed.  This works on both old and new systems.

[Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>:
address comments raised by Lucas De Marchi [1], update commit message]
[1] http://www.spinics.net/lists/linux-modules/msg01129.html

9 years agoUpdate TODO
Lucas De Marchi [Tue, 23 Sep 2014 03:21:53 +0000 (00:21 -0300)] 
Update TODO

9 years agoAdd the man page for kmod(8)
Marco d'Itri [Wed, 17 Sep 2014 03:12:27 +0000 (05:12 +0200)] 
Add the man page for kmod(8)

9 years agoDocument depmod --show in depmod(8)
Marco d'Itri [Wed, 17 Sep 2014 03:12:26 +0000 (05:12 +0200)] 
Document depmod --show in depmod(8)

9 years agolibkmod-index.c: Fix error message
Holger Obermaier [Thu, 4 Sep 2014 12:38:16 +0000 (14:38 +0200)] 
libkmod-index.c: Fix error message

9 years agoAdd missing O_CLOEXEC in kmod_module_get_size()
Cristian Rodríguez [Thu, 19 Jun 2014 00:51:00 +0000 (20:51 -0400)] 
Add missing O_CLOEXEC in kmod_module_get_size()

9 years agokmod 18 v18
Lucas De Marchi [Sat, 14 Jun 2014 15:46:38 +0000 (12:46 -0300)] 
kmod 18

9 years agotestsuite: Fix macro missing format string
Lucas De Marchi [Sat, 14 Jun 2014 14:14:58 +0000 (11:14 -0300)] 
testsuite: Fix macro missing format string

9 years agotestsuite: Add basic tests for hash implementation
Lucas De Marchi [Fri, 6 Jun 2014 05:22:43 +0000 (02:22 -0300)] 
testsuite: Add basic tests for hash implementation

Far from complete, but already covers all internal APIs.

9 years agotestsuite: Add assert_return
Lucas De Marchi [Fri, 6 Jun 2014 05:19:01 +0000 (02:19 -0300)] 
testsuite: Add assert_return

Add assert_return to use in testcases instead of assert. The issues
with assert are:
1) It's disabled when NDEBUG is defined
2) Even if it's well supported by testsuite (the parent will
   report the child died) it can't output any meaningful
   error message

9 years agotestsuite: separate testcases on log
Lucas De Marchi [Thu, 5 Jun 2014 20:54:00 +0000 (17:54 -0300)] 
testsuite: separate testcases on log

9 years agotestsuite: check for correct error message in detect-loop
Lucas De Marchi [Fri, 30 May 2014 13:26:17 +0000 (10:26 -0300)] 
testsuite: check for correct error message in detect-loop

9 years agotestsuite: Fix expected_fail parsing
Lucas De Marchi [Fri, 30 May 2014 13:23:05 +0000 (10:23 -0300)] 
testsuite: Fix expected_fail parsing

If a test has expected_fail=true, it means the return code must be
different from 0 *and* the outputs must match. This way it's possible to
check if the error messages are printed as they should.

9 years agotestsuite: Add braces
Lucas De Marchi [Fri, 30 May 2014 13:20:19 +0000 (10:20 -0300)] 
testsuite: Add braces

9 years agodepmod: Add better error messages when facing loops
Lucas De Marchi [Fri, 30 May 2014 12:38:26 +0000 (09:38 -0300)] 
depmod: Add better error messages when facing loops

Since now depmod fails when there are module loops, let's at least give
better error messages, printing the loops we found. Since we may have
more than 1 loop, just printing the modules that are in loop is not
very clear.

Assuming as an example 2 independent loops, this is how the new messages
compare to the old ones:

Before:
depmod: ERROR: Found 5 modules in dependency cycles!
depmod: ERROR: /tmp/test-kmod//lib/modules/3.14.4-1-ARCH/kernel/moduleE.ko in dependency cycle!
depmod: ERROR: /tmp/test-kmod//lib/modules/3.14.4-1-ARCH/kernel/moduleB.ko in dependency cycle!
depmod: ERROR: /tmp/test-kmod//lib/modules/3.14.4-1-ARCH/kernel/moduleC.ko in dependency cycle!
depmod: ERROR: /tmp/test-kmod//lib/modules/3.14.4-1-ARCH/kernel/moduleD.ko in dependency cycle!
depmod: ERROR: /tmp/test-kmod//lib/modules/3.14.4-1-ARCH/kernel/moduleA.ko in dependency cycle!

After:
depmod: ERROR: Found 5 modules in dependency cycles!
depmod: ERROR: Cycle detected: moduleE -> moduleD -> moduleE
depmod: ERROR: Cycle detected: moduleB -> moduleC -> moduleA -> moduleB

9 years agotestsuite: add test to fail depmod on module loops
Lucas De Marchi [Fri, 30 May 2014 12:36:21 +0000 (09:36 -0300)] 
testsuite: add test to fail depmod on module loops

9 years agodepmod: Rename variable to clarify its meaning
Lucas De Marchi [Fri, 30 May 2014 12:01:24 +0000 (09:01 -0300)] 
depmod: Rename variable to clarify its meaning

In mod->modnamelen we were actually including the '\0', i.e.
strlen(modname) + 1. So rename it to modnamesz and add a comment in
depmod_module_is_higher_priority() to notice why it's correct since the
new one is really using strlen(modname).

9 years agoFix use-after-free in hash implementation.
Lukas Anzinger [Sun, 18 May 2014 16:40:19 +0000 (18:40 +0200)] 
Fix use-after-free in hash implementation.

If a value is added to the hash under a key that already exists the new value
replaces the old value for that key. Since key can be a pointer to data that
is part of value and freed by hash->free_value(), the key must be also
replaced and not only the value. Otherwise key potentially points to freed data.

9 years agoClose /sys/module/$NAME directory if opening /proc/module fails.
Leandro Pereira [Tue, 29 Apr 2014 00:04:48 +0000 (21:04 -0300)] 
Close /sys/module/$NAME directory if opening /proc/module fails.

9 years agoFree abspath if kmod_module_new_from_path() fails.
Leandro Pereira [Tue, 29 Apr 2014 00:02:45 +0000 (21:02 -0300)] 
Free abspath if kmod_module_new_from_path() fails.

9 years agoFree realnames if kmod_lookup_alias_from_alias_bin() fails
Leandro Pereira [Tue, 29 Apr 2014 00:01:48 +0000 (21:01 -0300)] 
Free realnames if kmod_lookup_alias_from_alias_bin() fails

9 years agoEnsure read_long() reads the correct number of bytes from the index
Leandro Pereira [Mon, 28 Apr 2014 23:47:49 +0000 (20:47 -0300)] 
Ensure read_long() reads the correct number of bytes from the index

9 years agoBail out of index_mm_open() if fstat() fails
Leandro Pereira [Mon, 28 Apr 2014 23:44:14 +0000 (20:44 -0300)] 
Bail out of index_mm_open() if fstat() fails

9 years agodepmod: Make dependency loops be fatal
Lucas De Marchi [Fri, 9 May 2014 11:22:02 +0000 (08:22 -0300)] 
depmod: Make dependency loops be fatal

Since the beginning depmod just warned about dependency loops and upon
creation of modules.dep{,.bin} it skipped the modules that were part of
a loop. However just skipping the modules may come as a surprise to
kernel module developers: they will need to try to load the module (or
to pay attention to the log messages) to notice thavt the module has not
been put in the index. Also, differently from module-init-tools we were
not skipping modules that depend on modules with dependency loops,
leading to a segfault in depmod.

So this is a summary of the change in behavior with this patch:

Loop 1)
    A -> B -> C -
    ^           |
    '------------

    Before:
        depmod: WARNING: found 3 modules in dependency cycles!
        depmod: WARNING: /tmp/test-kmod/lib/modules/3.14.2-1-ARCH/kernel/moduleB.ko in dependency cycle!
        depmod: WARNING: /tmp/test-kmod/lib/modules/3.14.2-1-ARCH/kernel/moduleC.ko in dependency cycle!
        depmod: WARNING: /tmp/test-kmod/lib/modules/3.14.2-1-ARCH/kernel/moduleA.ko in dependency cycle!

        return code: 0

    After:
        depmod: ERROR: Found 3 modules in dependency cycles!
        depmod: ERROR: /tmp/test-kmod/lib/modules/3.14.2-1-ARCH/kernel/moduleB.ko in dependency cycle!
        depmod: ERROR: /tmp/test-kmod/lib/modules/3.14.2-1-ARCH/kernel/moduleC.ko in dependency cycle!
        depmod: ERROR: /tmp/test-kmod/lib/modules/3.14.2-1-ARCH/kernel/moduleA.ko in dependency cycle!

        return code: 2

Loop 2)
    A -> B -> C -
         ^      |
         '-------

    Before:
        depmod: WARNING: found 2 modules in dependency cycles!
        depmod: WARNING: /tmp/test-kmod//lib/modules/3.14.2-1-ARCH/kernel/moduleB.ko in dependency cycle!
        depmod: WARNING: /tmp/test-kmod//lib/modules/3.14.2-1-ARCH/kernel/moduleC.ko in dependency cycle!
        Segmentation fault (core dumped)

    After:
        depmod: ERROR: Found 2 modules in dependency cycles!
        depmod: ERROR: /tmp/test-kmod/lib/modules/3.14.2-1-ARCH/kernel/moduleB.ko in dependency cycle!
        depmod: ERROR: /tmp/test-kmod/lib/modules/3.14.2-1-ARCH/kernel/moduleC.ko in dependency cycle!

        return code: 2

The segfault above could be fixed, but let's just fail everything
because dependency cycles should be fixed in the modules rather than
just be skipped in the index.

9 years agoman: fixup spacing/parens in modprobe.d(5)
Joe Lawrence [Tue, 13 May 2014 03:31:10 +0000 (23:31 -0400)] 
man: fixup spacing/parens in modprobe.d(5)

9 years agoAdd gitignore to module playground
Lucas De Marchi [Fri, 9 May 2014 11:43:05 +0000 (08:43 -0300)] 
Add gitignore to module playground

9 years agoRemove references to systemd from the bash completion file
Marco d'Itri [Sun, 4 May 2014 19:00:43 +0000 (21:00 +0200)] 
Remove references to systemd from the bash completion file

And restore the original LGPL disclaimer text.

9 years agotestsuite: Add module playground dir
Lucas De Marchi [Fri, 2 May 2014 15:56:46 +0000 (12:56 -0300)] 
testsuite: Add module playground dir

10 years agoMake sure there's NUL byte at the end of strndupa
Lucas De Marchi [Mon, 7 Apr 2014 15:27:11 +0000 (12:27 -0300)] 
Make sure there's NUL byte at the end of strndupa

Since strcpy() doesn't ensure we have a NUL byte in the resulting
string, use alloca() + memcpy(). Also make sure we don't evaluate "s"
twice.

10 years agoAdd strndupa to missing.h
Lucas De Marchi [Fri, 4 Apr 2014 11:19:00 +0000 (08:19 -0300)] 
Add strndupa to missing.h

10 years agoUpdate .travis.yml
Lucas De Marchi [Mon, 7 Apr 2014 13:55:47 +0000 (10:55 -0300)] 
Update .travis.yml

 - Add cython to the dependencies, so it can compile the python bindings
 - Remove unecessary -Wno-error since now we don't use -Werror anymore.

10 years agokmod 17 v17
Lucas De Marchi [Sun, 6 Apr 2014 20:52:44 +0000 (17:52 -0300)] 
kmod 17

10 years agotestsuite: Remove duplicate test
Lucas De Marchi [Sun, 6 Apr 2014 20:43:19 +0000 (17:43 -0300)] 
testsuite: Remove duplicate test

This partially reverts ad7f175 ("Add test for depmod using search dirs
with same prefix"). Testing it twice in the inverted order doesn't
ensure we get the bug with wrong ordering.

As put by Anssi Hannula <anssi@mageia.org>:

So the bug is triggered only if the shorter name is higher-prio _and_
shorter name is traversed first. If the long name is traversed first,
the bug don't trigger with either "search" directive order (and on my
"make check" runs this is the case).

10 years agobuild-sys: enable python in bootstrap-configure
Lucas De Marchi [Sun, 6 Apr 2014 20:14:23 +0000 (17:14 -0300)] 
build-sys: enable python in bootstrap-configure

10 years agotestsuite: Warn if sysconfdir is not /etc
Michal Marek [Fri, 4 Apr 2014 09:30:07 +0000 (11:30 +0200)] 
testsuite: Warn if sysconfdir is not /etc

10 years agotestsuite: Do not run tests with *.ko.gz if zlib is not enabled
Michal Marek [Fri, 4 Apr 2014 11:05:49 +0000 (13:05 +0200)] 
testsuite: Do not run tests with *.ko.gz if zlib is not enabled

10 years agotestsuite: Uncompress most modules
Michal Marek [Fri, 4 Apr 2014 10:32:16 +0000 (12:32 +0200)] 
testsuite: Uncompress most modules

Only keep test-depmod/modules-order-compressed to test compressed module
support.

10 years agoconfig: also parse softdeps from modules
Tom Gundersen [Mon, 31 Mar 2014 13:18:51 +0000 (15:18 +0200)] 
config: also parse softdeps from modules

This information can be found in /lib/modules/`uname -r`/modules.softdep, and
has only recently been exported by the kernel.

Also remove the advice about copying modules.softdep to /lib/modules as it is
not clear how to do this correctly with several kernels installed with
potentially conflicting soft dependencies.

10 years agolibkmod: Ignore errors from softdeps
Michal Marek [Mon, 31 Mar 2014 13:18:50 +0000 (15:18 +0200)] 
libkmod: Ignore errors from softdeps

Before we had softdeps, the usual idiom was

install foo /sbin/modprobe bar; /sbin/modprobe --ignore-install foo

ignoring errors from the first modprobe invocation. This also matches
the behavior of module-init-tools' implementation of softdep.

10 years agobuild-sys: add hooks to build python bindings
Lucas De Marchi [Mon, 24 Mar 2014 11:27:19 +0000 (08:27 -0300)] 
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>
10 years agopython: Remove unused files from import
Lucas De Marchi [Thu, 20 Mar 2014 10:33:40 +0000 (07:33 -0300)] 
python: Remove unused files from import

Acked-by: Andy Grover <agrover@redhat.com>
10 years agoMerge branch 'master' of python-kmod
Lucas De Marchi [Mon, 10 Mar 2014 07:23:19 +0000 (04:23 -0300)] 
Merge branch 'master' of python-kmod

This is python-kmod is found in git@github.com:agrover/kmod.git
d5b6f22639c077b86659828bcc78dcedc9daaa94

Its history has being rewritten to prepare for a merge:

- Every commit has been prefixed with "python: " in its commit
  message
- s-o-b's have been removed
- Every file has been moved to libkmod/python directory

Some files don't make much sense anymore and are being removed
in this merge.

Acked-by: Andy Grover <agrover@redhat.com>
10 years agopython: Issue #15: resovled by using setuptools_cython
Guy Rozendorn [Tue, 2 Apr 2013 14:46:45 +0000 (17:46 +0300)] 
python: Issue #15: resovled by using setuptools_cython