opensuse:module-init-tools.git
9 years agorelease: bump release to v3.7 v3.7
Jon Masters [Wed, 8 Apr 2009 21:54:26 +0000 (17:54 -0400)]
release: bump release to v3.7

NOTE: future releases will no longer be preceeded by a series of "-pre"
releases. Instead, we'll just use incrementing numbers and bump the major
version if something horrible needs merging that might lead to breaks.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agoremove all legacy support for pre-2.6 kernels
Alan Jenkins [Tue, 31 Mar 2009 12:27:07 +0000 (13:27 +0100)]
remove all legacy support for pre-2.6 kernels

An earlier change removed backcompat from modprobe only.  Remove
backcompat from the other commands, and update the documentation
accordingly.

This means "make install" doesn't need modprobe.old and friends.
It should make it simpler to create distribution packages.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agotestsuite: remove test-generate-modprobe.conf/disabled*
Alan Jenkins [Tue, 31 Mar 2009 12:26:13 +0000 (13:26 +0100)]
testsuite: remove test-generate-modprobe.conf/disabled*

generate-modprobe.conf has been touched recently, and the testsuite has
been refreshed a couple of times.  But generate-modprobe.conf is of
limited interest, and no-one has tried to re-enable, fix, or update
these tests.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years ago"make check" shouldn't run our testsuite
Alan Jenkins [Tue, 31 Mar 2009 12:13:03 +0000 (13:13 +0100)]
"make check" shouldn't run our testsuite

Automake doesn't expect tests to run ./configure or create files under
the source directory.  This change allows "make distcheck" to pass.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agorelease: bump new pre-release to v3.7-pre9 v3.7-pre9
Jon Masters [Thu, 12 Mar 2009 17:40:53 +0000 (13:40 -0400)]
release: bump new pre-release to v3.7-pre9

9 years agoMerge branch 'master' of git://github.com/sourcejedi/module-init-tools
Jon Masters [Thu, 12 Mar 2009 17:38:14 +0000 (13:38 -0400)]
Merge branch 'master' of git://github.com/sourcejedi/module-init-tools

9 years agodocs: don't forget to pass -I m4 to aclocal
Jon Masters [Thu, 12 Mar 2009 17:35:50 +0000 (13:35 -0400)]
docs: don't forget to pass -I m4 to aclocal

We now use a separated out build directory to aid in building debug/nodebug
versions of the binaries for ease of testing, and other reasons. We need to
have aclocal include the m4 directory to pull in the additional macro.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agoTake advantage of strstarts
Alan Jenkins [Thu, 12 Mar 2009 11:46:00 +0000 (11:46 +0000)]
Take advantage of strstarts

It's nice to use strstarts(), rather than open-coding it with strncmp()
and strlen().

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
9 years agodepmod: Don't accept "make_map_files yes-please"
Alan Jenkins [Thu, 12 Mar 2009 11:45:45 +0000 (11:45 +0000)]
depmod: Don't accept "make_map_files yes-please"

There's no obvious reason to use strncmp() here, to try and accept all
words which _start_ with "yes" or "no".  Just check for "yes" and "no"
using streq(), like the "config binary_indexes" option in modprobe.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
9 years agoEnforce use of streq
Alan Jenkins [Thu, 12 Mar 2009 11:45:34 +0000 (11:45 +0000)]
Enforce use of streq

I don't mind either way, but if it is worth using streq() then we
should be consistent and use it everywhere.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>.
9 years agoMove a few common functions and macros to "util"
Alan Jenkins [Thu, 12 Mar 2009 11:45:21 +0000 (11:45 +0000)]
Move a few common functions and macros to "util"

As suggested by Arjan on redhat bugzilla.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
9 years agoMove more logging to common files
Alan Jenkins [Thu, 12 Mar 2009 11:45:13 +0000 (11:45 +0000)]
Move more logging to common files

- Add info() which prints to stdout if verbose == 1.
- Add error() for rmmod.
- Convert modprobe and depmod to use info().
- Convert rmmod to use "logging.h".

This removes multiple different implementations, without changing the
actual output in any way.  Converting rmmod will also make it possible
to change rmmod in future, to use common functions which call NOFAIL.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
9 years agormmod: -a with no arguments can't do anything reasonable
Alan Jenkins [Thu, 12 Mar 2009 11:45:05 +0000 (11:45 +0000)]
rmmod: -a with no arguments can't do anything reasonable

Presumably "rmmod -a" (with no modules) would do the same as
"modprobe --autoclean".  This feature is not useful on a modern
system, so no-one is going to implement it.  Remove the FIXME.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
9 years agomodprobe: Fix segfault in parse_config_file
Alan Jenkins [Thu, 12 Mar 2009 11:44:18 +0000 (11:44 +0000)]
modprobe: Fix segfault in parse_config_file

$ echo "config" > modprobe.conf
$ gdb --args ./modprobe -C modprobe.conf ipip

Program received signal SIGSEGV, Segmentation fault.
parse_config_file (filename=0xbffc96a6 "modprobe.conf",
    name=0xbffc96b4 "ipip", dump_only=0, removing=0,
    options=0xbffc8c14, commands=0xbffc8c18, aliases=0xbffc8c10,
    blacklist=0xbffc8c0c) at modprobe.c:1284
1284                            if (strcmp(tmp, "binary_indexes") == 0) {

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
9 years agodepmod: Replace malloc+sprintf with asprintf
Alan Jenkins [Thu, 12 Mar 2009 11:43:04 +0000 (11:43 +0000)]
depmod: Replace malloc+sprintf with asprintf

asprintf is simpler and less error-prone than malloc+sprintf, because
you don't have to work out how much memory to allocate.

Signed-off-by: Alan Jenkinss <alan-jenkins@tuffmail.co.uk>
9 years agomodprobe: Fix out of date comment
Alan Jenkins [Thu, 12 Mar 2009 11:40:49 +0000 (11:40 +0000)]
modprobe: Fix out of date comment

modprobe *does* now die, if we fail to load a dependency of the module.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
9 years agopre-release: update to release v3.7-pre8 v3.7-pre8
Jon Masters [Wed, 11 Mar 2009 06:11:29 +0000 (02:11 -0400)]
pre-release: update to release v3.7-pre8

9 years agobuild: Build tests in a separate directory
Alan Jenkins [Wed, 11 Mar 2009 06:09:44 +0000 (02:09 -0400)]
build: Build tests in a separate directory

Use tests/build for the -DJUST_TESTING versions of modprobe and friends.
That way we can run the tests without screwing up the normal build
directory.

This requires that the normal build directory be kept separate from
the source directory.  The default build directory is now "build".
This dirty work is done by a heavily fixed-up version of
AC_ENABLE_BUILDDIR from the autoconf macro archive.

The macro creates a toplevel Makefile, which should handle the
requirements of most users without requiring them to enter the build
directory.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Jon Masters <jcm@jonmasters.org>
---
Changes since version 2:

1. Move autoconf extensions to m4 directory, as suggested by Mike
   Frysinger.

2. Remove sinclude from configure.ac. sinclude is an obsolete alias for
   m4_include. aclocal generates m4_include's automatically.

3. Make it clear that ax_enable_builddir.m4 has been modified, i.e. it
   is out of sync with the autoconf archive.  I've sent the patches
   to the maintainer now, so hopefully this is a temporary situation.

9 years agotestsuite: use PATH
Alan Jenkins [Wed, 11 Mar 2009 06:07:09 +0000 (02:07 -0400)]
testsuite: use PATH

In the tests, replace e.g.
    ./modprobe
with
    modprobe
and make sure that PATH includes ".".

This will make it possible to move modprobe and friends around, by
simply changing PATH.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agobuild: Fix "make distclean"
Alan Jenkins [Wed, 11 Mar 2009 06:03:48 +0000 (02:03 -0400)]
build: Fix "make distclean"

Conventionally, "make distclean" blows away autogenerated Makefiles and
configure output.  This is necessary to avoid confusion when using a
separate build directory:

$ ./configure
..
$ mkdir build; cd build; ./configure
..
configure: error: source directory already configured;
run "make distclean" there first

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agodocs: update the README to prefer autoreconf over individual utilities
Jon Masters [Wed, 11 Mar 2009 06:00:55 +0000 (02:00 -0400)]
docs: update the README to prefer autoreconf over individual utilities

From: Alan Jenkins <alan-jenkins@tuffmail.co.uk>

This is easier to remember.  At least for me, it means I can avoid
copying+pasting the longer command from the README each time.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agoTODO: fix the build system with respect to docs.
Jon Masters [Thu, 5 Mar 2009 20:00:57 +0000 (15:00 -0500)]
TODO: fix the build system with respect to docs.

9 years agopre-release: update to v3.7-pre7 v3.7-pre7
Jon Masters [Wed, 4 Mar 2009 00:12:13 +0000 (19:12 -0500)]
pre-release: update to v3.7-pre7

9 years agomodprobe: remove obsolete -k, --autoclean option
Michal Marek [Wed, 4 Mar 2009 00:06:32 +0000 (19:06 -0500)]
modprobe: remove obsolete -k, --autoclean option

This is a leftover from 2.4 times.

Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agodoc: remove autoclean and kernel options from modprobe documentation
Jon Masters [Wed, 4 Mar 2009 00:03:54 +0000 (19:03 -0500)]
doc: remove autoclean and kernel options from modprobe documentation

Previous patch added these, but Michal's patch removed them already.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agomodprobe: abort loading module if one of its dependents fails to load
Don Zickus [Wed, 4 Mar 2009 00:00:38 +0000 (19:00 -0500)]
modprobe: abort loading module if one of its dependents fails to load

The gist of the patch is that once a dependency has failed, propagate the error
up and stop loading all the modules that are dependent on the failed one.  This
allows us to bail out quicker and not run into issues like 'Unknown symbols'
because the parent modules are never asked to load.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agodoc: [PATCH] modprobe: document undocumented options
Jon Masters [Tue, 3 Mar 2009 23:53:53 +0000 (18:53 -0500)]
doc: [PATCH] modprobe: document undocumented options

Document --show, -S, -D, -b, -k, --autoclean, -d and --dirname options.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agobuild: make module-init-tools explicitly depend on docbook2man
Jon Masters [Tue, 3 Mar 2009 23:44:01 +0000 (18:44 -0500)]
build: make module-init-tools explicitly depend on docbook2man

The build system silently relies on docbook2man being installed on the
build host. The following patch makes docbook2man an explicit
dependency. The benefit of erroring out earlier at ./configure is, that
the user gets a meaningful error message

There is no functional change.

Signed-off-by: Christian Ludwig <chrissicool@chrissicool.net>
Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agopre-release: update release to v3.7-pre6 v3.7-pre6
Jon Masters [Tue, 3 Mar 2009 23:25:56 +0000 (18:25 -0500)]
pre-release: update release to v3.7-pre6

Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agologging: add quiet global and cleanup logging files
Jon Masters [Tue, 3 Mar 2009 23:22:09 +0000 (18:22 -0500)]
logging: add quiet global and cleanup logging files

Make a new global called "quiet" to replace the unknown silent that was
being passed around. Strictly speaking, "quiet" is supposed to refer only
to silently failing without warning on module load failure, but the docs
have always (erroneously) said we would also be completely silent. The
tests likewise have always assumed we will say nothing out stderr. So,
I'm just going to start treating quiet as it has been actually used.

This patch should have gone in a previous commit.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agoNEWS: replace the NEWS file with something useful
Jon Masters [Tue, 3 Mar 2009 23:21:00 +0000 (18:21 -0500)]
NEWS: replace the NEWS file with something useful

This also allows us to use "make dist" target properly. Not sure that "NEWS"
is needed for GNU compliance but it doesn't hurt to actually have one. I
just need to actually keep it up to date.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agomodprobe: fix handling of quiet module loading
Jon Masters [Tue, 3 Mar 2009 23:14:31 +0000 (18:14 -0500)]
modprobe: fix handling of quiet module loading

Fix up the handling of logging, quiet module loading, and printing of warning
messages. Also, don't print warnings when we said we would be quiet.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agomodprobe: make return values consistent for quiet/non-quiet
Jon Masters [Tue, 3 Mar 2009 22:26:24 +0000 (17:26 -0500)]
modprobe: make return values consistent for quiet/non-quiet

Calling warn vs. fatal as the error function has the side effect of changing
the return value, so add a check at the end to see if we need to return 1.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agodocs: add Marco and Kay to the authors file
Jon Masters [Tue, 3 Mar 2009 21:46:37 +0000 (16:46 -0500)]
docs: add Marco and Kay to the authors file

Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agodocs: remove outdated "NEWS" file
Jon Masters [Tue, 3 Mar 2009 21:44:35 +0000 (16:44 -0500)]
docs: remove outdated "NEWS" file

I will replace this with actual news in due course.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agopre-release: bump release to v3.7-pre5 v3.7-pre5
Jon Masters [Tue, 3 Mar 2009 03:03:11 +0000 (22:03 -0500)]
pre-release: bump release to v3.7-pre5

9 years agomodprobe: don't exit when silent
Loïc Minier [Tue, 3 Mar 2009 03:01:54 +0000 (22:01 -0500)]
modprobe: don't exit when silent

   % modprobe --all foo bar
 will attempt loading foo and bar (and output two WARNINGs and exit 0)

    % modprobe --all --quiet foo bar
 will only attempt to load foo (and output nothing and exit 1)

 This is due to the exit(1); around line 1377.  Note that error() is
 either warn() or fatal().

Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agotestsuite: remove locking tests since the flock() is gone v3.7-pre4
Jon Masters [Tue, 3 Mar 2009 01:41:15 +0000 (20:41 -0500)]
testsuite: remove locking tests since the flock() is gone

Marco d'Itri noticed that the file locking never really worked as intended
anyway, so we removed it (let the kernel handle simultaneous duplicate
loading attempts, which it already does on read-only filesystems - i.e.
almost everyone during early boottime module loading - anyway).

See previous commit for futher detail.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agopre-release: bump release up to v3.7-pre4
Jon Masters [Tue, 3 Mar 2009 01:38:11 +0000 (20:38 -0500)]
pre-release: bump release up to v3.7-pre4

9 years agomodprobe: remove flock() because it never worked anyway
Jon Masters [Tue, 3 Mar 2009 01:32:24 +0000 (20:32 -0500)]
modprobe: remove flock() because it never worked anyway

We used to have a file lock/unlock using flock() and acquiring a "write"
lock on the module file prior to load/unload as a means to acquire an
exclusive access to the module file. Sounds good, right? The problem is
that this will instead block if anyone else is holding the file open in
userspace (as well as the intention of preventing concurrent modprobe).

We could just wait 5 seconds, print warnings, kill the offending other
process, or many other things. But since modprobe already works on a
read-only filesystem (by not taking the lock at all, allowing the
kernel to catch and prevent the concurrent load situation) we do
this in every case instead. If I get complaints, I'll try an
alternative mechanism instead - like a warning, kill, etc.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agoTODO: make a new TODO that makes sense
Jon Masters [Tue, 3 Mar 2009 01:17:10 +0000 (20:17 -0500)]
TODO: make a new TODO that makes sense

The old file had long since stopped being used, replace it with one where we
actually know what we need to do :) Thanks to Kay for mentioning that!

Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agorelease: bump release to v3.7-pre3 v3.7-pre3
Jon Masters [Mon, 2 Mar 2009 15:46:12 +0000 (10:46 -0500)]
release: bump release to v3.7-pre3

Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agodepmod: "updates" fixes
Michal Marek [Mon, 2 Mar 2009 14:33:03 +0000 (15:33 +0100)]
depmod: "updates" fixes

9 years agomodprobe,depmod: deprecate "include", sort config files, warn if they miss .conf
Kay Sievers [Mon, 2 Mar 2009 12:59:29 +0000 (13:59 +0100)]
modprobe,depmod: deprecate "include", sort config files, warn if they miss .conf

The "include" directive causes a warning now, because it should not be
used anymore. All user-supplied config file belong into the single
directories /etc/modprobe.d/ and /etc/depmod.d/ and nowhere else.
This allows tools like mkinitramfs to find all files without the current
pain.

Any include directives for /etc/modprobe.d/ and /etc/depmod.d/ themselves
are completely ignored now, they are the default and do not need any
configuration.

The existence of the file /etc/modprobe.conf, /etc/depmod.conf will
cause a warning now, and they should be moved to the single directories
/etc/modprobe.d/ and /etc/depmod.d/.

All /etc/modprobe.d/ and /etc/depmod.d/ files without a ".conf" extension
cause a warning now, the extension will be required in a future release
to make the "can-never-be-complete file name filter" obsolete, which tries
to filter left-over files from editors and package managers.

All files in /etc/modprobe.d/ and /etc/depmod.d/ are sorted alphabetically
now, before they are parsed, to produce predictable results and to no longer
depend on readdir() order.

If the config option "binary_indexes no" is given, all possible ".bin"
files are properly ignored now.

The tests have been updated not to use "include", but put all files
in /etc/modprobe.d/ and have a .conf entension.

9 years agodocumentation update
Marco d'Itri [Mon, 2 Mar 2009 12:19:40 +0000 (13:19 +0100)]
documentation update

Correctly document the -b argument of modprobe.
Mention modinfo(8) in the lsmod(8) and modprobe(8) man pages.

9 years agoignore the "CVS" directory
Marco d'Itri [Mon, 2 Mar 2009 04:04:33 +0000 (05:04 +0100)]
ignore the "CVS" directory

9 years agoMerge branch 'master' of git://github.com/sourcejedi/module-init-tools
Kay Sievers [Mon, 2 Mar 2009 11:59:15 +0000 (12:59 +0100)]
Merge branch 'master' of git://github.com/sourcejedi/module-init-tools

9 years agomodprobe: fix comment on kcmdline
Jon Masters [Thu, 26 Feb 2009 20:51:03 +0000 (15:51 -0500)]
modprobe: fix comment on kcmdline

Add documentation comment in dump path too. What the heck, I was
fixing a RHEL4 bug and noticed this in doing the backport.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agodoc: fix typo in modprobe.sgml
Jon Masters [Thu, 26 Feb 2009 20:46:03 +0000 (15:46 -0500)]
doc: fix typo in modprobe.sgml

should be <module>.<option> not <module>.option>

Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agoMerge branches 'tests' and 'fixes'
Alan Jenkins [Mon, 23 Feb 2009 12:13:34 +0000 (12:13 +0000)]
Merge branches 'tests' and 'fixes'

9 years agotestsuite: remove useless use of echo
Alan Jenkins [Mon, 23 Feb 2009 10:39:13 +0000 (10:39 +0000)]
testsuite: remove useless use of echo

$(echo `foo`) simplifies to `foo`.

sed -i -e 's/$(echo `\(.*\)`)/`\1`/' */*.sh

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
9 years agotestsuite: more delay reduction
Alan Jenkins [Mon, 23 Feb 2009 10:25:14 +0000 (10:25 +0000)]
testsuite: more delay reduction

"test-depmod/12compressed.sh" copied the delay from 11quick.sh. But it
makes more sense to copy 02simple.sh, which includes no delay.

Other tests which use delays don't depend on bitness or endianness - so
we don't need to repeat them for each combination. This affects:

 test-depmod/11quick.sh   (depmod -A)
 test-modprobe/25locking.sh

In fact, most of the modprobe tests don't need to be repeated.
Overall test runtime goes from 85s to 65s on my netbook.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
9 years agotestsuite: cleanup /sys/module/ in modprobe tests
Alan Jenkins [Mon, 23 Feb 2009 10:22:48 +0000 (10:22 +0000)]
testsuite: cleanup /sys/module/ in modprobe tests

1) If a test wants to create an "Empty sysfs", it needs to do
   "mkdir -p tests/sys/module".

   Without this, there is _no_ sysfs. This is treated as an undefined
   state. Both "modprobe *" and "modprobe -r *" will try to operate.
   Many tests do this deliberately to keep things simple, which is fine.
   But several tests want an empty sysfs, and we should do it properly.

2) "touch tests/sys/module/*/initstate" should be
   "echo live > tests/sys/module/*/initstate"

   An empty "initstate" file is pointless, because it's treated as an
   undefined state for that module. We should either define the state,
   or not create a fake sysfs at all, and leave everything undefined.

3) Remove vestigal references to /proc/modules.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
9 years agotestsuite: complete test-modprobe/02sysfs.sh
Alan Jenkins [Mon, 23 Feb 2009 10:24:11 +0000 (10:24 +0000)]
testsuite: complete test-modprobe/02sysfs.sh

Reimplement all the tests from the original 02proc.sh

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
9 years agotestsuite: MODTEST_OVERRIDE_ROOT conversion fixup
Alan Jenkins [Mon, 23 Feb 2009 10:24:18 +0000 (10:24 +0000)]
testsuite: MODTEST_OVERRIDE_ROOT conversion fixup

Fix the path of a test file, which was overlooked in the transition to
MODTEST_OVERRIDE_ROOT.  This didn't stop the test passing. But it meant
it wasn't testing that read-only module files could be loaded.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
9 years agotestsuite: work around slow SSDs
Alan Jenkins [Mon, 23 Feb 2009 09:55:44 +0000 (09:55 +0000)]
testsuite: work around slow SSDs

First generation SSDs can have bad write performance, causing delays of
at least half a second in some circumstances. This can cause modprobe
to take longer than expected. The locking test will fail as a result.

Here's a quick hack: sync the disks before running the test.  This
limits the amount of un-written data, so we should only fail if someone
else is thrashing the disk.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
9 years agotestsuite: fix reduced delays
Alan Jenkins [Sun, 22 Feb 2009 11:13:20 +0000 (11:13 +0000)]
testsuite: fix reduced delays

b0a7d9613e27e121fa92d54c5a7c0a950723ff6a
overlooked the delay for _removing_ modules.
This caused 25locking.sh to fail half the time.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
9 years agomodinfo: fix --field
Alan Jenkins [Fri, 20 Feb 2009 17:14:46 +0000 (17:14 +0000)]
modinfo: fix --field

"--field" is supposed to be the long version of "-F".
"-F" requires an option.  So we need to set "has_arg"
in the struct option for "--field".

<https://bugzilla.redhat.com/show_bug.cgi?id=447280>

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
9 years agomodinfo.8: "param" is really spelled "parm"
Alan Jenkins [Fri, 20 Feb 2009 16:11:21 +0000 (16:11 +0000)]
modinfo.8: "param" is really spelled "parm"

<https://bugs.launchpad.net/ubuntu/+source/module-init-tools/+bug/259791>

    one field of the -F option is wrong.
    It is named "param" in my man page.
    But it is "parm".

    Sincerely, Nicolas Michel

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
9 years agomodprobe.8: document "-b"
Alan Jenkins [Fri, 20 Feb 2009 15:51:24 +0000 (15:51 +0000)]
modprobe.8: document "-b"

The "-b" option is equivalent to "--use-blacklist",
but this is not documented.

"modprobe --help" shows the "-b" option, so we
should document this in the manual page.

<https://bugs.launchpad.net/ubuntu/+source/module-init-tools/+bug/203828/>

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
9 years agomodinfo: Fix failure with inaccessible current dir
Alan Jenkins [Fri, 20 Feb 2009 13:50:56 +0000 (13:50 +0000)]
modinfo: Fix failure with inaccessible current dir

kerneltools bugzilla #6
<https://bugs.launchpad.net/module-init-tools/+bug/227198>

Originally report refers to "sudo modinfo fglrx"
on an NFS mount with root_sqaush.  To reproduce:

$ mkdir /tmp/noaccess
$ cd /tmp/noaccess
$ chmod a-x /tmp/noaccess
$ /sbin/modinfo fglrx
$ modinfo: could not open fglrx: Permission denied

As suggested by Martin Pitt on Launchpad, the fix
is to distinguish better between module names and
filenames.  If it contains "." or "/", it must be
a filename.  Otherwise, assume it is a module name.
Users can still do "modinfo ./fglrx" if thats what
they really want.

Signed-off-by: Alan Jenkins <alan@alan-eeepc.jenkins>
9 years agodepmod: Allow modules outside the normal module directory
Alan Jenkins [Fri, 20 Feb 2009 12:10:43 +0000 (12:10 +0000)]
depmod: Allow modules outside the normal module directory

We used to allow this.  But we switched to relative paths
and it stopped working without any warning at depmod time.

This can only happen if depmod is run with a list of modules.
Probably no-one is affected.  But failing silently is bad,
and once we add the check for this case it is trivial to
support it.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
9 years agoBump the revision up to v3.7-pre2 for these fixes. v3.7-pre2
Jon Masters [Wed, 18 Feb 2009 04:40:52 +0000 (23:40 -0500)]
Bump the revision up to v3.7-pre2 for these fixes.

9 years agoMerge branch 'master' of ../module-init-tools_alan
Jon Masters [Wed, 18 Feb 2009 04:39:26 +0000 (23:39 -0500)]
Merge branch 'master' of ../module-init-tools_alan

9 years agopatch testsuite-dir
Alan Jenkins [Thu, 12 Feb 2009 11:51:45 +0000 (11:51 +0000)]
patch testsuite-dir

9 years agoReduce test delays
Alan Jenkins [Wed, 11 Feb 2009 12:03:55 +0000 (12:03 +0000)]
Reduce test delays

Total test time goes from 65 to 50 seconds

9 years agotestsuite: add temporary directory to gitignore
Alan Jenkins [Wed, 11 Feb 2009 11:41:12 +0000 (11:41 +0000)]
testsuite: add temporary directory to gitignore

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
9 years agotestsuite: add test for order of values in binary index
Alan Jenkins [Wed, 11 Feb 2009 11:30:59 +0000 (11:30 +0000)]
testsuite: add test for order of values in binary index

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
9 years agoMake sure each command includes "testing.h"
Alan Jenkins [Wed, 11 Feb 2009 16:00:02 +0000 (16:00 +0000)]
Make sure each command includes "testing.h"

This only works because everything includes backwards_compat.c,
which in turn includes testing.h.  (It won't work if
CONFIG_NO_BACKWARDS_COMPAT is ever defined).

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
9 years agoSurvive "/sys is not mounted"
Alan Jenkins [Wed, 11 Feb 2009 16:18:24 +0000 (16:18 +0000)]
Survive "/sys is not mounted"

modprobe used to be able to work if /proc was not mounted;
the tests required it.  Let's keep it that way with /sys too.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
9 years agobuild: update the configure.ac to v3.7-pre1 v3.7-pre1
Jon Masters [Wed, 11 Feb 2009 01:33:08 +0000 (20:33 -0500)]
build: update the configure.ac to v3.7-pre1

9 years agotestsuite: update for order change to option parsing
Jon Masters [Wed, 11 Feb 2009 01:26:45 +0000 (20:26 -0500)]
testsuite: update for order change to option parsing

A previous patch by Michal Marek changes the order of option parsing
to favor command line options over config file options. This patch
updates the testsuite files to handle this change correctly.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agomodprobe: parse empty options correctly
Jon Masters [Wed, 11 Feb 2009 00:36:28 +0000 (19:36 -0500)]
modprobe: parse empty options correctly

When pre-pending module options, only insert a space if there was
already an option parsed previously, otherwise just copy verbatim.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agomodinfo: needs logging.c to compile
Kay Sievers [Tue, 10 Feb 2009 19:42:39 +0000 (20:42 +0100)]
modinfo: needs logging.c to compile

9 years agogenerate-modprobe.conf: detect errors and abort
Martin Schlemmer [Mon, 9 Feb 2009 00:05:59 +0000 (19:05 -0500)]
generate-modprobe.conf: detect errors and abort

If modprobe fails for whatever reason, generate-modprobe.conf should detect
this and inform the user.

Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
9 years agogenerate-modprobe.conf: cleanup usage and add --assume-kernel
Mike Frysinger [Sun, 8 Feb 2009 23:57:57 +0000 (18:57 -0500)]
generate-modprobe.conf: cleanup usage and add --assume-kernel

Unify option parsing to make it easier to add new options, and add a new
--assume-kernel option so people can set the kernel version they wish to
use.  This is useful when building/boostrapping a system whose kernel is
different from the running one.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
9 years agodepmod: abort on OOM
Alan Jenkins [Tue, 10 Feb 2009 16:01:10 +0000 (16:01 +0000)]
depmod: abort on OOM

Alan Jenkins napsal(a):
> Michal Marek wrote:
> > if depmod runs out memory reading modules, it will print a "WARNING:
> > Can't read module ....ko" line for each module it fails to load and
> > later, depending on the moon phase, either abort when a malloc() or
> > strdup() fails, or it will simply miss dependencies and exit
> > successfully. Attached patch makes depmod abort in case of OOM (but
> > doesn't abort if you have e.g. stale symlinks in the modules tree).

Wouldn't it be better to move zlibsupport.c into line with the rest of
m-i-t, and abort immediately on allocation failures?  It seems a better
way forward now we have a shared "logging.h" (since version 3.5).

9 years agomodprobe: fix options priority
Michal Marek [Tue, 10 Feb 2009 13:41:22 +0000 (14:41 +0100)]
modprobe: fix options priority

Currently, options set in modprobe.conf take precedence over options
given on the command line. Flip this, to make it possible to override
modprobe.conf options.

Signed-off-by: Michal Marek <mmarek@suse.cz>
9 years agoremove generated automake files
Mike Frysinger [Tue, 10 Feb 2009 15:50:20 +0000 (16:50 +0100)]
remove generated automake files

9 years agomark man pages as dist targets
Mike Frysinger [Mon, 9 Feb 2009 16:39:48 +0000 (11:39 -0500)]
mark man pages as dist targets

Making people install the docbook packages just to generate man pages is
pretty heavy handed.  If we simply mark them as dist targets in the
Makefile, then they'll be generated/bundled in the dist tarball
automatically when `make dist` is run.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
9 years agodepmod: fix is_higher_priority()
Michal Marek [Tue, 10 Feb 2009 15:35:18 +0000 (16:35 +0100)]
depmod: fix is_higher_priority()

9 years agomodinfo: return error on incorrect usage
Michal Marek [Tue, 10 Feb 2009 15:28:38 +0000 (16:28 +0100)]
modinfo: return error on incorrect usage

9 years agoadd module ordering support for binary indexes
Alan Jenkins [Thu, 5 Feb 2009 18:56:16 +0000 (18:56 +0000)]
add module ordering support for binary indexes

Tejun Heo added support to prioritize modules based
on their position in modules.order, in the same way
built-in drivers are prioritized by link order.
Unfortunately this didn't work by the time it was
applied, because we added fast binary indexes,
which did not preserve ordering.

This required a rethink of the index code.  Overall
it is now a few lines shorter and slightly easier
to understand.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
9 years agomodprobe: fallback to text files if binary index is wrong version
Alan Jenkins [Sun, 8 Feb 2009 11:41:33 +0000 (11:41 +0000)]
modprobe: fallback to text files if binary index is wrong version

The version check is moved to a new index_file_open() function.
Wrong version is indicated by a NULL return with errno set to EINVAL.

index.c gains a call to fopen(), so it now needs to #include
"testing.h" for the test harness hooks.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
9 years agodepmod: Specifying modules using relative paths is an error
Alan Jenkins [Fri, 6 Feb 2009 14:43:23 +0000 (14:43 +0000)]
depmod: Specifying modules using relative paths is an error

This never worked, but depmod doesn't warn about it;
I think it just writes the relative paths into modules.dep.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
9 years agomodprobe: Fix segfault when MODPROBE_OPTIONS=""
Alan Jenkins [Fri, 20 Feb 2009 12:05:03 +0000 (12:05 +0000)]
modprobe: Fix segfault when MODPROBE_OPTIONS=""

Fix from debian (author unknown).

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
9 years agoFix underscores() corner case (and optimise)
Alan Jenkins [Fri, 20 Feb 2009 12:14:32 +0000 (12:14 +0000)]
Fix underscores() corner case (and optimise)

The pattern "[[]-" matches the string "[-".
underscores() should convert the pattern to "[[]_".

The current code gets this wrong, leaving it as "[[]-".
It seems to think patterns can include nested square brackets.
This shouldn't affect anyone, but it does makes it a bit faster.

Also, we can reduce the number of calls to underscores()
for non-matching aliases.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
9 years agoindex: fix copy/paste error
Jon Masters [Thu, 5 Feb 2009 15:13:55 +0000 (10:13 -0500)]
index: fix copy/paste error

This one came from Alan J. originally and I just reworked it to apply.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agobump release to v3.6 v3.6
Jon Masters [Wed, 4 Feb 2009 07:45:24 +0000 (02:45 -0500)]
bump release to v3.6

This is the final release of v3.6.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agobump release to v3.6-pre5 v3.6-pre5
Jon Masters [Wed, 4 Feb 2009 07:43:52 +0000 (02:43 -0500)]
bump release to v3.6-pre5

This will be the final v3.6 release. Next step is cleaning up more
patches and configuration files between the distros.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agodepmod: fix return in sort_modules
Jon Masters [Wed, 4 Feb 2009 07:25:47 +0000 (02:25 -0500)]
depmod: fix return in sort_modules

Newer kernels implement modules.order, which is used in sort_modules to
pre-sort the module list according to that ordering. But older kernels
don't have this ordering information, so we should ignore it. We had
a blind return without sending back the unsorted list head.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agodepmod: Allow empty modules.dep file creation
Luiz Fernando N. Capitulino [Wed, 4 Feb 2009 07:19:12 +0000 (02:19 -0500)]
depmod: Allow empty modules.dep file creation

Commit c0aa5cd6b7c24345ba39a0082989b784d5d0d24a fixed the file
truncation bug but also introduced a new problem: it doesn't
allow the creation of an empty modules.dep file.

The right fix is to only forbid the truncation when modules have
been specified in the command-line.

Thanks to Alan Jenkins for noticing this.

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agobump release to v3.6-pre4 v3.6-pre4
Jon Masters [Wed, 4 Feb 2009 06:51:15 +0000 (01:51 -0500)]
bump release to v3.6-pre4

A few more fixes coming before the final v3.6 release.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
9 years agoMerge branch 'master' of ../module-init-tools_keybuk
Jon Masters [Wed, 4 Feb 2009 06:44:17 +0000 (01:44 -0500)]
Merge branch 'master' of ../module-init-tools_keybuk

9 years agoSort modules according to modules.order
Scott James Remnant [Fri, 23 Jan 2009 19:45:26 +0000 (19:45 +0000)]
Sort modules according to modules.order

Patch from SuSE by Tejun Heo <htejun@gmail.com>

Kbuild now generates and installs modules.order along with modules.
This patch updates depmod such that it sorts module list according to
the file before generating output files.  Modules which aren't on
modules.order are put after modules which are ordered by
modules.order.

This makes modprobe to prioritize modules according to kernel
Makefile's just as built-in modules are link-ordered by them.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
9 years agoSkip patch left-overs and RCS files.
Scott James Remnant [Fri, 23 Jan 2009 19:29:57 +0000 (19:29 +0000)]
Skip patch left-overs and RCS files.

Patch might leave .orig or .rej files, and if the user maintains their
/etc under RCS, there might be ,v files.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
9 years agoSkip dpkg files.
Scott James Remnant [Fri, 23 Jan 2009 19:29:14 +0000 (19:29 +0000)]
Skip dpkg files.

dpkg leaves files alongside configuration containing the old, new,
packaging and previously modified texts.  These should be ignored.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
9 years agoFilter configuration files
Scott James Remnant [Fri, 23 Jan 2009 19:28:06 +0000 (19:28 +0000)]
Filter configuration files

Apply patch from SuSE to filter configuration files by name when
recursing directories, avoiding temporary files, swap files and debris
from packaging systems.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
9 years agoBetter documentation for --use-blacklist
Scott James Remnant [Fri, 23 Jan 2009 19:07:50 +0000 (19:07 +0000)]
Better documentation for --use-blacklist

The documentation for --use-blacklist is a little thin, replace it with
the paragraph we have.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
9 years agoCorrect modinfo sgml documentation.
Scott James Remnant [Fri, 23 Jan 2009 18:49:00 +0000 (18:49 +0000)]
Correct modinfo sgml documentation.

modinfo.sgml was missing a <listitem> and had an extra closing tag of
the wrong type.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>