]> git.ipfire.org Git - thirdparty/kmod.git/log
thirdparty/kmod.git
12 years agolibkmod-config: refactor functions to get config
Lucas De Marchi [Tue, 12 Jun 2012 04:43:46 +0000 (01:43 -0300)] 
libkmod-config: refactor functions to get config

It makes more sense to have libkmod-config.c deal with the configuration
directly and the others get the config from ctx. As a bonus point we get
a smaller binary. Following numbers are for x86-64, libkmod + kmod:

Before:
   text    data     bss     dec     hex filename
 128840    1496     104  130440   1fd88 tools/modprobe

After:
   text    data     bss     dec     hex filename
 128392    1496     104  129992   1fbc8 tools/modprobe

12 years agoTODO: update tasks
Lucas De Marchi [Mon, 11 Jun 2012 15:00:19 +0000 (12:00 -0300)] 
TODO: update tasks

 - Remove dependency loop with install commands, since it's done
 - Add reasoning behind API refactor

12 years agotestsuite: Fix test description
Lucas De Marchi [Wed, 6 Jun 2012 13:49:04 +0000 (10:49 -0300)] 
testsuite: Fix test description

12 years agolibkmod-index: protect ourselves from corrupted indexes
Lucas De Marchi [Wed, 6 Jun 2012 12:36:29 +0000 (09:36 -0300)] 
libkmod-index: protect ourselves from corrupted indexes

If index is shorter than 12 bytes, we couldn't even read its header. Go
to error handling in this case.

12 years agotestsuite: add test for install-commands loop
Lucas De Marchi [Wed, 6 Jun 2012 04:44:23 +0000 (01:44 -0300)] 
testsuite: add test for install-commands loop

This loop is similar to the one that comes with install rules of
alsa-utils package. It can be easily verified by reverting commit
abd5557 and running the testsuite.

12 years agotestsuite: allow to export custom env vars
Lucas De Marchi [Wed, 6 Jun 2012 04:42:30 +0000 (01:42 -0300)] 
testsuite: allow to export custom env vars

12 years agotestsuite: add timeout for each test
Lucas De Marchi [Wed, 6 Jun 2012 04:03:15 +0000 (01:03 -0300)] 
testsuite: add timeout for each test

Each test must run under 2 seconds. Ideally they should run in much less
than this; just give an arbitrary number so we don't wait forever in
case we reached an infinite loop somewhere.

12 years agotestsuite: create additional pipe to monitor child
Lucas De Marchi [Wed, 6 Jun 2012 03:39:43 +0000 (00:39 -0300)] 
testsuite: create additional pipe to monitor child

12 years agolibkmod-util: split function for usec conversion
Lucas De Marchi [Wed, 6 Jun 2012 00:02:11 +0000 (21:02 -0300)] 
libkmod-util: split function for usec conversion

12 years agotestsuite: add test for softdep loops
Lucas De Marchi [Mon, 4 Jun 2012 23:45:24 +0000 (20:45 -0300)] 
testsuite: add test for softdep loops

12 years agotestsuite: check if module is in kernel for return code
Lucas De Marchi [Tue, 5 Jun 2012 03:53:15 +0000 (00:53 -0300)] 
testsuite: check if module is in kernel for return code

12 years agotestsuite: set default init_module behavior to mimic kernel's
Lucas De Marchi [Tue, 5 Jun 2012 03:20:42 +0000 (00:20 -0300)] 
testsuite: set default init_module behavior to mimic kernel's

12 years agotestsuite: create initstate file upon fake init_module()
Lucas De Marchi [Fri, 25 May 2012 03:30:37 +0000 (00:30 -0300)] 
testsuite: create initstate file upon fake init_module()

12 years agotestsuite: add mkdir_p implementation
Lucas De Marchi [Thu, 24 May 2012 06:29:05 +0000 (03:29 -0300)] 
testsuite: add mkdir_p implementation

12 years agotestsuite: trap calls to mkdir
Lucas De Marchi [Thu, 24 May 2012 04:58:54 +0000 (01:58 -0300)] 
testsuite: trap calls to mkdir

12 years agotestsuite: check if rootfs dir is dirty before running
Lucas De Marchi [Thu, 24 May 2012 04:31:36 +0000 (01:31 -0300)] 
testsuite: check if rootfs dir is dirty before running

Keep around a stamp-rootfs file that is generated together with the
rootfs. testsuite checks each test directory if its mtime is greater
than stamp's mtime, deciding if rootfs should be re-generated.

12 years agotestsuite: separate insert and delete rootfs from modinfo
Lucas De Marchi [Fri, 25 May 2012 03:24:58 +0000 (00:24 -0300)] 
testsuite: separate insert and delete rootfs from modinfo

12 years agolibkmod-util: add missing stdbool.h include
Lucas De Marchi [Thu, 24 May 2012 04:19:20 +0000 (01:19 -0300)] 
libkmod-util: add missing stdbool.h include

12 years agotestsuite: rename rootfs dir
Lucas De Marchi [Thu, 24 May 2012 02:04:44 +0000 (23:04 -0300)] 
testsuite: rename rootfs dir

12 years agobuild-sys: provide --sysconfdir to make distcheck flags
Lucas De Marchi [Thu, 24 May 2012 02:05:04 +0000 (23:05 -0300)] 
build-sys: provide --sysconfdir to make distcheck flags

test-blacklist is accessing the wrong location in make distcheck, making
the test to fail. Fix is by providing --sysconfdir=/etc in configure
flags.

12 years agotestsuite: fix find_module() finding wrong module
Lucas De Marchi [Tue, 5 Jun 2012 03:07:38 +0000 (00:07 -0300)] 
testsuite: fix find_module() finding wrong module

12 years agoSilence clang warnings with __unused__ attribute
Lucas De Marchi [Wed, 23 May 2012 23:28:53 +0000 (20:28 -0300)] 
Silence clang warnings with __unused__ attribute

I hate this kind of READV and WRITEV macros that Gustavo seems to love.
clang-analyzer hates them as well.

I'm not motivated enough to refactor this, but I want a clean clang
report, so just shut it up.

12 years agoDon't use __ for attribute defines
Lucas De Marchi [Wed, 23 May 2012 23:27:23 +0000 (20:27 -0300)] 
Don't use __ for attribute defines

System headers use __, don't mess with them.

12 years agolibkmod-index: use generic function for unaligned access
Lucas De Marchi [Wed, 23 May 2012 22:32:58 +0000 (19:32 -0300)] 
libkmod-index: use generic function for unaligned access

12 years agodoc: Don't reference /etc/modprobe.conf
Josh Boyer [Wed, 23 May 2012 18:31:07 +0000 (14:31 -0400)] 
doc: Don't reference /etc/modprobe.conf

kmod doesn't read /etc/modprobe.conf at all, so don't mention it in the
modprobe man page.  Point users to modprobe.d(5) instead.

12 years agolibkmod-hash: use generic function for unaligned access
Lucas De Marchi [Mon, 21 May 2012 23:43:39 +0000 (20:43 -0300)] 
libkmod-hash: use generic function for unaligned access

12 years agolibkmod-util: copy macros for unaligned access from BlueZ
Lucas De Marchi [Mon, 21 May 2012 23:22:12 +0000 (20:22 -0300)] 
libkmod-util: copy macros for unaligned access from BlueZ

12 years agolibkmod: move function to the only file using it
Mike Frysinger [Tue, 15 May 2012 22:29:44 +0000 (19:29 -0300)] 
libkmod: move function to the only file using it

If we don't have --gc-sections support, linking kmod fails:
libkmod/.libs/libkmod-util.a(libkmod-util.o): In function 'underscores':
libkmod/libkmod-util.c:117: undefined reference to 'kmod_log'

This is because libkmod-util.la uses kmod_log(), that is in libkmod.la.
Move the function so we don't have a dependency loop while building the
libraries and it works with compilers with no support for --gc-sections.

12 years agotest-conversion: convert test-get-dependencies to new infrastructure
Dan McGee [Thu, 23 Feb 2012 05:56:59 +0000 (23:56 -0600)] 
test-conversion: convert test-get-dependencies to new infrastructure

The test uses the ext4 module dependencies as the testcase, checking
both the number and the names of the returned modules.

12 years agotest-conversion: convert test-blacklist to new infrastructure
Dan McGee [Thu, 23 Feb 2012 05:56:58 +0000 (23:56 -0600)] 
test-conversion: convert test-blacklist to new infrastructure

Add a modprobe.conf with some blacklist entries in a test rootfs, and
then ensure our blacklist function actually cuts out the two listed
entries (and doesn't cut out the others).

12 years agobuild-sys: copy rootfs to another directory
Lucas De Marchi [Fri, 11 May 2012 03:04:59 +0000 (00:04 -0300)] 
build-sys: copy rootfs to another directory

We can't use the rootfs directory because it breaks out-of-tree build
and in future we want to make modifications to the fake filesystem such
as adding and removing files.

We need to call "chmod -R +w" in the resulting directory because when we
distribute the source with make dist all files will be readonly.

Fix 'make distcheck'

12 years agobuild-sys: distribute testsuite
Lucas De Marchi [Fri, 11 May 2012 02:42:41 +0000 (23:42 -0300)] 
build-sys: distribute testsuite

Fix 'make dist'

12 years agotestsuite: ship testsuite/rootfs unzipped
Dan McGee [Fri, 3 Feb 2012 19:24:18 +0000 (13:24 -0600)] 
testsuite: ship testsuite/rootfs unzipped

The current configuration is dumb in any number of ways:
1) If the rationale was for space savings, it works the opposite- the
   git repo gets more bloated because we are adding binary compressed
   blobs that share little in common with their parent, and anyone that
   wants to run the test suite has to unzip it anyway.
2) It is a pain in the butt to add new tests, and not accidentally lose
   any new rootfs you built in the directory.
3) `git status` won't help you if you are tweaking files in the rootfs
   and don't know they have been changed, or if some test did that and
   you couldn't detect it.
4) `git log` won't help you find out what is changing in the rootfs test
   directory itself when changes are made to the binary blob, such as
   new files being added or even existing files being tweaked.
5) The files just aren't that big anyway- 2.7MB unzipped.

12 years agobuild: remove private symbol from linker script
Lucas De Marchi [Fri, 11 May 2012 00:11:27 +0000 (21:11 -0300)] 
build: remove private symbol from linker script

There's no reason kmod_log should be exported, remove it from linker
script. This doesn't break the API/ABI because we are luck: since the
function had visibility=hidden it was not getting exported as a global
symbol.

12 years agoRevert "libkmod: make sure to export kmod_log"
Lucas De Marchi [Thu, 10 May 2012 23:58:46 +0000 (20:58 -0300)] 
Revert "libkmod: make sure to export kmod_log"

This reverts commit 88a170dbd63965b8403b6b40b12ded4f82d89ccd.

There's no reason for users of the API to call this method, it's just
wrong to export it.

The bug that this patch fixed needs to be fixed another way, not
exporting this function.

12 years agodepmod: report failures in loading symbols
Dave Reisner [Mon, 7 May 2012 23:41:42 +0000 (19:41 -0400)] 
depmod: report failures in loading symbols

Previously, depmod would relegate failures of kmod_module_get_symbols()
to debug output, assuming the "error" was simply a lack of symbols.
Leave the ENOENT return to debug output, but report anything else as a
real error.

12 years agolibkmod-file: gracefully handle errors from zlib
Dave Reisner [Mon, 7 May 2012 23:41:41 +0000 (19:41 -0400)] 
libkmod-file: gracefully handle errors from zlib

zlib won't necessarily set the system errno, and this is particularly
evident on corrupted data (which results in a double free). Use zlib's
gzerror to detect the failure, returning a generic EINVAL when zlib
doesn't provide us with an errno.

12 years agoRemove dead increment
Lucas De Marchi [Thu, 26 Apr 2012 14:42:27 +0000 (11:42 -0300)] 
Remove dead increment

12 years agoReturn error instead of always 0
Lucas De Marchi [Thu, 26 Apr 2012 14:40:26 +0000 (11:40 -0300)] 
Return error instead of always 0

12 years agoRemove dead assignment
Lucas De Marchi [Thu, 26 Apr 2012 14:39:54 +0000 (11:39 -0300)] 
Remove dead assignment

12 years agolibkmod: make sure to export kmod_log
Mike Frysinger [Sat, 21 Apr 2012 06:53:23 +0000 (02:53 -0400)] 
libkmod: make sure to export kmod_log

If we don't have --gc-sections support, linking kmod fails:
libkmod/.libs/libkmod-util.a(libkmod-util.o): In function 'underscores':
libkmod/libkmod-util.c:117: undefined reference to 'kmod_log'

This is because kmod_log is missing the export define, even though it's
already listed in the exported symbol list.

12 years agokmod 8 v8
Lucas De Marchi [Thu, 19 Apr 2012 14:21:00 +0000 (11:21 -0300)] 
kmod 8

12 years agodoc: remove links to NULL going nowhere
Lucas De Marchi [Thu, 19 Apr 2012 14:08:24 +0000 (11:08 -0300)] 
doc: remove links to NULL going nowhere

12 years agoTODO: add item to implement actions in kmod
Lucas De Marchi [Mon, 16 Apr 2012 23:20:48 +0000 (20:20 -0300)] 
TODO: add item to implement actions in kmod

12 years agomodprobe: handle -ENOENT return from init_module
Dave Reisner [Mon, 16 Apr 2012 14:37:32 +0000 (10:37 -0400)] 
modprobe: handle -ENOENT return from init_module

init_module returns -ENOENT when the module failed to load because of a
bad parameter or unknown symbol. Throw a more descriptive error message
than the generic "No such file or directory" to alert the user.

Fixes Debian bug 668216.

12 years agodoc: silent man page generation and fix gtk-doc warnings
Kay Sievers [Sat, 14 Apr 2012 18:47:47 +0000 (20:47 +0200)] 
doc: silent man page generation and fix gtk-doc warnings

12 years agomodprobe: fix typo in config dump: option->options
Elan Ruusamäe [Thu, 22 Mar 2012 15:00:16 +0000 (12:00 -0300)] 
modprobe: fix typo in config dump: option->options

kmod uses "option MODNAME", not "options MODNAME"

--- modprobe-sorted.kmod 2012-03-21 22:31:03.751754042 +0200
+++ modprobe-sorted.module-init-tools 2012-03-21 22:30:49.561753089 +0200
@@ -1,6 +1,23 @@
[...]
-option uvesafb mode_option=1024x786-32 mtrr=4 scroll=ywrap
+options uvesafb mode_option=1024x786-32 mtrr=4 scroll=ywrap

This breaks scripts that depend in modprobe -c output grepping

12 years agoREADME: note that there are more files to read
Lucas De Marchi [Thu, 22 Mar 2012 01:26:03 +0000 (22:26 -0300)] 
README: note that there are more files to read

12 years agokmod 7 v7
Lucas De Marchi [Mon, 19 Mar 2012 11:23:14 +0000 (08:23 -0300)] 
kmod 7

12 years agobuild-sys: don't set CFLAGS and LDFLAGS
Lucas De Marchi [Sat, 17 Mar 2012 18:12:44 +0000 (15:12 -0300)] 
build-sys: don't set CFLAGS and LDFLAGS

These variables are supposed to be set by user. What we can do in
configure is to set another variable and AC_SUBST() it. Then in
Makefile.am we assign it to AM_{CFLAGS,LDFLAGS}. This way user can
always override their values, in configure or make phase.

Reference: http://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html

12 years agobuild-sys: re-organize configure.ac
Lucas De Marchi [Sat, 17 Mar 2012 13:26:32 +0000 (10:26 -0300)] 
build-sys: re-organize configure.ac

12 years agoconfigure.ac: Move link only flags out of CFLAGS and into LDFLAGS.
Randy Witt [Fri, 16 Mar 2012 05:01:18 +0000 (01:01 -0400)] 
configure.ac: Move link only flags out of CFLAGS and into LDFLAGS.

On the ARM gcc 4.2.2 I'm using I get many
"--as-needed: linker input file unused because linking not done"
style errors when libtool is using compile mode.

In order to silence these warnings and be "correct", the flags that
only make sense for linking were moved into LDFLAGS.

12 years agoAdd CC_CHECK_LDFLAGS_APPEND m4 macro.
Randy Witt [Fri, 16 Mar 2012 05:01:17 +0000 (01:01 -0400)] 
Add CC_CHECK_LDFLAGS_APPEND m4 macro.

This is mostly just preparation for the next patch. But this macro is
used for flags that are only needed during linking but that don't
make sense for normal compilation.

I saw this exact type of patch online for systemd, but it never seems to
have actually been incorporated into their attributes.m4.

12 years agoconfig: use order /etc, /run, /lib
Lucas De Marchi [Thu, 15 Mar 2012 12:19:34 +0000 (09:19 -0300)] 
config: use order /etc, /run, /lib

This matches the change in systemd and udev. Log message on udev's
change by Kay Sievers:

After long consideration we came to the conclusion that user
configuration in /etc should always override the (generally
computer generated) configuration in /run. User configuration
should always be what matters over anything else. Hence rearrange
the search orders accordingly. In general this should change
very little as overriding like this is seldomn done so far,
and the order between /etc and /usr stays the same.

12 years agomodprobe: set log prio to 0 if user passed -q arg
Lucas De Marchi [Thu, 15 Mar 2012 04:11:10 +0000 (01:11 -0300)] 
modprobe: set log prio to 0 if user passed -q arg

12 years agoMerge branch 'master' of git://code.falconindy.com/kmod
Lucas De Marchi [Thu, 15 Mar 2012 03:31:22 +0000 (00:31 -0300)] 
Merge branch 'master' of git://code.falconindy.com/kmod

12 years agomodprobe: always try to remove all modules in command line
Lucas De Marchi [Thu, 15 Mar 2012 03:27:18 +0000 (00:27 -0300)] 
modprobe: always try to remove all modules in command line

12 years agomodprobe: don't check if module builtin to decide if it's builtin
Lucas De Marchi [Thu, 15 Mar 2012 03:14:35 +0000 (00:14 -0300)] 
modprobe: don't check if module builtin to decide if it's builtin

More or less confusing message, but if module is builtin in the live
system, it doesn't mean it's builtin in the target kernel.

Instead we now check if module has a path. It don't have a path only if
it's builtin in the target or if it doesn't exist at all. The latter
should not be a problem since this code is being called from inside the
library. Anyway, put an assert to make sure we get bug reports if any
case slipped in here.

12 years agomodprobe: fix error path in removing modules
Dave Reisner [Thu, 15 Mar 2012 02:15:21 +0000 (22:15 -0400)] 
modprobe: fix error path in removing modules

We really haven't paid this code much attention, and it's somewhat
evident in our divergence in behavior from module-init-tools. This patch
asserts the following behavior on exit:

* modprobe -r realmod_notloaded => exit zero
* modprobe -r --first-time realmod_notloaded => exit non-zero
* modprobe -r bogusmod => exit non-zero

12 years agokmod 6 v6
Lucas De Marchi [Sat, 3 Mar 2012 01:34:36 +0000 (22:34 -0300)] 
kmod 6

12 years agoUse upper case after Deprecated in doc
Lucas De Marchi [Sat, 3 Mar 2012 01:28:38 +0000 (22:28 -0300)] 
Use upper case after Deprecated in doc

12 years agoAdd kmod_module_apply_filter() to doc-sections file
Lucas De Marchi [Sat, 3 Mar 2012 01:18:33 +0000 (22:18 -0300)] 
Add kmod_module_apply_filter() to doc-sections file

12 years agoFix wrong printf format string
Lucas De Marchi [Sat, 3 Mar 2012 00:28:11 +0000 (21:28 -0300)] 
Fix wrong printf format string

This fixes build in 32 bits machines.

12 years agolibkmod-index: do not pre-populate mmap
Lucas De Marchi [Fri, 2 Mar 2012 23:33:26 +0000 (20:33 -0300)] 
libkmod-index: do not pre-populate mmap

If we tell mmap to populate all the indexes and they are big, this will
impact load time. Let them be mapped as they are used.

12 years agoDowngrade log message: refcnt file may not exist
Lucas De Marchi [Thu, 1 Mar 2012 17:04:29 +0000 (14:04 -0300)] 
Downgrade log message: refcnt file may not exist

If kernel doesn't have support to unload modules,
/sys/module/<modname>/refcnt will not exist and that's ok.

Reported by: Sven Anders <anders@anduras.de>

12 years agoman: detail modprobe.blacklist in kcmdline
Lucas De Marchi [Mon, 27 Feb 2012 23:35:12 +0000 (20:35 -0300)] 
man: detail modprobe.blacklist in kcmdline

12 years agolibkmod-index: free node when we have only partial match
Lucas De Marchi [Mon, 27 Feb 2012 22:54:33 +0000 (19:54 -0300)] 
libkmod-index: free node when we have only partial match

12 years agomodprobe: show builtin label on --show-depends
Dave Reisner [Mon, 27 Feb 2012 20:59:09 +0000 (15:59 -0500)] 
modprobe: show builtin label on --show-depends

Previously, we didn't handle builtins very well, displaying things like:

$ modprobe -D btrfs
insmod /lib/modules/3.2.6-foo/kernel/crypto/crc32c.ko.gz
insmod (null)
insmod /lib/modules/3.2.6-foo/kernel/lib/libcrc32c.ko.gz
insmod /lib/modules/3.2.6-foo/kernel/lib/zlib_deflate/zlib_deflate.ko.gz
insmod /lib/modules/3.2.6-foo/kernel/fs/btrfs/btrfs.ko.gz

Follow module-init-tools and show builtins with the label 'builtin' and
their name:

$ modprobe -D btrfs
insmod /lib/modules/3.2.6-foo/kernel/crypto/crc32c.ko.gz
builtin intel_crc32c
insmod /lib/modules/3.2.6-foo/kernel/lib/libcrc32c.ko.gz
insmod /lib/modules/3.2.6-foo/kernel/lib/zlib_deflate/zlib_deflate.ko.gz
insmod /lib/modules/3.2.6-foo/kernel/fs/btrfs/btrfs.ko.gz

12 years agolibkmod-module: fill builtin's name
Lucas De Marchi [Mon, 27 Feb 2012 21:48:02 +0000 (18:48 -0300)] 
libkmod-module: fill builtin's name

modules.builtin don't have any realname->value -- it follows the same
format of modules.dep, not the aliases ones.

12 years agofind builtins by property, not initstate
Dave Reisner [Sat, 25 Feb 2012 04:02:06 +0000 (23:02 -0500)] 
find builtins by property, not initstate

12 years agomodinfo: use new apply_filter method to avoid builtins
Dave Reisner [Fri, 24 Feb 2012 15:13:16 +0000 (10:13 -0500)] 
modinfo: use new apply_filter method to avoid builtins

12 years agolibkmod/module: add kmod_module_apply_filter method
Dave Reisner [Fri, 24 Feb 2012 15:05:11 +0000 (10:05 -0500)] 
libkmod/module: add kmod_module_apply_filter method

This is a more generic method of applying filters to module lists. This
deprecates kmod_module_get_filtered_blacklist() which now simply returns
a call to _apply_filter with the extra filter enum arg.

12 years agoMove repository to kernel.org
Lucas De Marchi [Fri, 24 Feb 2012 03:58:20 +0000 (01:58 -0200)] 
Move repository to kernel.org

12 years agolibkmod-module: don't treat "coming" as in-kernel
Lucas De Marchi [Thu, 23 Feb 2012 18:37:13 +0000 (16:37 -0200)] 
libkmod-module: don't treat "coming" as in-kernel

Running two instances of modprobe with the same module should both
succeed or both fail:

modprobe foo&; modprobe foo;

Previously if foo failed to be inserted by the first call, the second one
could return 0 because it may have occurred while the first one was being
processed by kernel (thus marked as "coming").

Now we simply don't check by "coming" in order to decide if we need to
call init_module(). module-init-tools used to spin calling
usleep(100000), but calls to init_module() are already synchronous.
Therefore let kernel synchronize the calls.

12 years agoTODO: update and organize items
Lucas De Marchi [Wed, 22 Feb 2012 15:07:13 +0000 (13:07 -0200)] 
TODO: update and organize items

12 years agolibkmod-module: probe: check if module exists for install cmds
Lucas De Marchi [Sun, 19 Feb 2012 06:20:30 +0000 (04:20 -0200)] 
libkmod-module: probe: check if module exists for install cmds

Mimic what module-init-tools was doing before running install commands:
check if a module with the same name is already loaded in kerne, and if
it is, bail out.

This fixes the issue with some install commands used in Debian with
alsa-base package:

install snd /sbin/modprobe --ignore-install snd && { /sbin/modprobe --quiet snd-ioctl32 ; /sbin/modprobe --quiet snd-seq ; }
install snd_rawmidi /sbin/modprobe --ignore-install snd-rawmidi && { /sbin/modprobe --quiet snd-seq-midi ; : ; }
install snd_emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 && { /sbin/modprobe --quiet snd-emu10k1-synth ; : ; }
install snd_pcm modprobe --ignore-install snd-pcm $CMDLINE_OPTS && { modprobe --quiet snd-pcm-oss ; : ; }
install snd_mixer modprobe --ignore-install snd-mixer $CMDLINE_OPTS && { modprobe --quiet snd-mixer-oss ; : ; }
install snd_seq modprobe --ignore-install snd-seq $CMDLINE_OPTS && { modprobe --quiet snd-seq-midi ; modprobe --quiet snd-seq-oss ; : ; }

12 years agoAdd missing newlines
Lucas De Marchi [Sat, 18 Feb 2012 05:56:21 +0000 (03:56 -0200)] 
Add missing newlines

Checked with following semantic patch for the library:

// smpl
@a@
identifier virtual.func;
expression E1;
expression fmt;
position p1;
@@

func(E1, fmt@p1, ...)

@script:python b@
fmt << a.fmt;
p1 << a.p1;
@@

s = str(fmt)
if s.find("\\n") < 0:
print p1[0].file + ":" + p1[0].line

// smpl

For tools, just remove E1

12 years agoDowngrade log level when modules.dep{,.bin} don't exist
Lucas De Marchi [Fri, 17 Feb 2012 07:00:09 +0000 (05:00 -0200)] 
Downgrade log level when modules.dep{,.bin} don't exist

12 years agotestsuite: fix color of unexpected failure
Lucas De Marchi [Thu, 16 Feb 2012 23:11:13 +0000 (21:11 -0200)] 
testsuite: fix color of unexpected failure

12 years agokmod-module: lookup: search modules.builtin file too
Lucas De Marchi [Thu, 16 Feb 2012 22:43:16 +0000 (20:43 -0200)] 
kmod-module: lookup: search modules.builtin file too

Search modules.builtin file before saying the module was not found.
Note: these "modules" should not appear as dependencies of other modules
(in modules.dep) even if they appear in modinfo. This fixes the return
code of modprobe with builtin modules.

Also fixes a small coding style issue in module_is_inkernel().

12 years agotestsuite: add test for builtins with modprobe
Lucas De Marchi [Thu, 16 Feb 2012 23:04:24 +0000 (21:04 -0200)] 
testsuite: add test for builtins with modprobe

When user tries to load a module that is builtin in kernel, modprobe
should just return 0. This is not happening right now, so mark test as
expected_fail until it gets fixed.

12 years agotestsuite: add .path member to test struct
Dave Reisner [Wed, 15 Feb 2012 02:49:26 +0000 (21:49 -0500)] 
testsuite: add .path member to test struct

This allows us to prepend an arbitrary item to the PATH environment
variable, meaning we can favor the binaries we just built, rather than
relying on those in the filesystem.

12 years agoFix path.c's function pointer defenitions.
Wouter van Kesteren [Thu, 16 Feb 2012 17:16:54 +0000 (18:16 +0100)] 
Fix path.c's function pointer defenitions.

int isn't big enough to hold a FILE* / DIR* on some systems, this causes
segfaults in calls that try to use the resulting FILE* / DIR*:

  TESTSUITE: ERR: 'testsuite_rootfs_fopen' [1176160] terminated by signal 11 (Segmentation fault)
  TESTSUITE: ERR: FAILED: testsuite_rootfs_fopen
  FAIL: testsuite/test-testsuite
  ...
  TESTSUITE: ERR: 'loaded_1' [1176166] terminated by signal 11 (Segmentation fault)
  TESTSUITE: ERR: FAILED: loaded_1
  FAIL: testsuite/test-loaded
  ...
  TESTSUITE: ERR: 'from_alias' [1176181] terminated by signal 11 (Segmentation fault)
  TESTSUITE: ERR: FAILED: from_alias
  FAIL: testsuite/test-new-module

For reference on my system:

  sizeof(int) = 4
  sizeof(long) = 8
  sizeof(FILE*) = 8
  sizeof(DIR*) = 8

12 years agoTODO: add tasks and bug fixes
Lucas De Marchi [Tue, 14 Feb 2012 23:57:35 +0000 (21:57 -0200)] 
TODO: add tasks and bug fixes

12 years agolibkmod-index: don't print an error if index doesn't exist
Lucas De Marchi [Mon, 13 Feb 2012 23:58:36 +0000 (21:58 -0200)] 
libkmod-index: don't print an error if index doesn't exist

It's ok not to have the index files, so just print a DBG message instead
of an ERR.

12 years agolibkmod-module: probe: fix infinite loop with softdeps
Lucas De Marchi [Sat, 11 Feb 2012 21:45:29 +0000 (19:45 -0200)] 
libkmod-module: probe: fix infinite loop with softdeps

If a softdep depends on a module in the dependency list of the module
being inserted, we would enter and infinite loop.

Move the "mod->visited = true" assignment to the proper place, hoping it
didn't break other use cases. This is a bug that comes and goes every
now and then. Since we have a testsuite now, a test for this should be
written.

12 years agotest: remove test-state
Lucas De Marchi [Thu, 9 Feb 2012 03:44:09 +0000 (01:44 -0200)] 
test: remove test-state

This test is already covered by testsuite/test-loaded.

12 years agoMark functions with attribute noreturn
Lucas De Marchi [Wed, 8 Feb 2012 22:32:31 +0000 (20:32 -0200)] 
Mark functions with attribute noreturn

Functions that always call exit() should be marked with attribute
noreturn. With glibc this is not necessary, but it fails to compile with
uClibc otherwise.

12 years agoCheck if libc has __xstat
Lucas De Marchi [Wed, 8 Feb 2012 22:29:52 +0000 (20:29 -0200)] 
Check if libc has __xstat

uClibc doesn't use __xstat. Check if it exists, otherwise don't export
the override function.

12 years agobuild-sys: add rule to pack rootfs
Lucas De Marchi [Wed, 8 Feb 2012 03:51:17 +0000 (01:51 -0200)] 
build-sys: add rule to pack rootfs

12 years agotestsuite: add tests to modprobe --show-depends
Lucas De Marchi [Wed, 8 Feb 2012 03:40:00 +0000 (01:40 -0200)] 
testsuite: add tests to modprobe --show-depends

test 1 - check whether modprobe outputs the right thing when
using --show-depends is used with already loaded modules.

test 2 - check whether modprobe outputs the right thing when
using --show-depends with modules not loaded yet

12 years agotestsuite: update README file
Lucas De Marchi [Tue, 7 Feb 2012 12:58:48 +0000 (10:58 -0200)] 
testsuite: update README file

- Tell about TESTSUITE_MAIN and DEFINE_TEST macros
- Align item bodies and break on 80 chars

12 years agotestsuite: macronify test definitions
Lucas De Marchi [Tue, 7 Feb 2012 12:46:46 +0000 (10:46 -0200)] 
testsuite: macronify test definitions

12 years agotestsuite: macronify main function
Lucas De Marchi [Tue, 7 Feb 2012 12:09:20 +0000 (10:09 -0200)] 
testsuite: macronify main function

12 years agotestsuite: libtestsuite depends on individual components
Dan McGee [Sat, 4 Feb 2012 02:29:09 +0000 (20:29 -0600)] 
testsuite: libtestsuite depends on individual components

Ensure this dependency is explicit in the Makefile so rebuilding just
one test works correctly. Also reduce some repetition in the test LDADD
bits by adding a new TESTSUITE_LDADD variable.

12 years agolibkmod-module: probe: Fix ignore-loaded flag not being applied
Lucas De Marchi [Tue, 7 Feb 2012 11:48:59 +0000 (09:48 -0200)] 
libkmod-module: probe: Fix ignore-loaded flag not being applied

12 years agokmod 5 v5
Lucas De Marchi [Mon, 6 Feb 2012 22:34:33 +0000 (20:34 -0200)] 
kmod 5

12 years agomodinfo: handle arguments more carefully
Dan McGee [Sat, 4 Feb 2012 02:25:00 +0000 (20:25 -0600)] 
modinfo: handle arguments more carefully

A simple case of breakage before this commit:

    $ touch aes
    $ modinfo aes
    filename:       /tmp/aes
    ERROR: could not get modinfo from 'aes': Invalid argument

Add a new is_module_filename() function that attempts to do more than
just check if the passed argument is a regular file. We look at the name
for a '.ko' string, and if that is found, ensure it is either at the end
of the string or followed by another '.' (for .gz and .xz modules, for
instance). We don't make this second option conditional on the way the
tools are built with compression support; the file is a module file
regardless and should always be treated that way.

When doing this, and noticed in the test suite output, we open the
system modules index unconditionally, even if it is never going to be
used during the modinfo call, which is the case when passing module
filenames directly. For only one module there's not much advantage in
pre-loading the index, so just remove the call to kmod_load_resources().

With-help-from: Dave Reisner <dreisner@archlinux.org>
[lucas.demarchi@profusion.mobi: remove call to kmod_load_resources()]

12 years agoAdd WARNING file for test dir and improve testsuite README
Lucas De Marchi [Mon, 6 Feb 2012 21:50:17 +0000 (19:50 -0200)] 
Add WARNING file for test dir and improve testsuite README

12 years agotestsuite: add README
Lucas De Marchi [Mon, 6 Feb 2012 18:50:54 +0000 (16:50 -0200)] 
testsuite: add README