opensuse:module-init-tools.git
7 years agoMerge branch 'master' of master.kernel.org:/pub/scm/utils/kernel/module-init-tools... v3.15
Jon Masters [Thu, 2 Jun 2011 17:40:46 +0000 (13:40 -0400)]
Merge branch 'master' of /utils/kernel/module-init-tools/module-init-tools

Conflicts:
ChangeLog

Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agorelease: bump release to 3.15
Jon Masters [Thu, 2 Jun 2011 17:35:26 +0000 (13:35 -0400)]
release: bump release to 3.15

A brown paper bag fix for 3.14 to correct man page output handling.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agodoc: properly fix documentation generation
Jon Masters [Thu, 2 Jun 2011 17:29:27 +0000 (13:29 -0400)]
doc: properly fix documentation generation

The docbook2man package does not allow output to be written to standard out,
nor does the SGML allow for more than one file to be created. A previous
hack was to use symlinks and hope for the best. Rather than doing this,
retain the symlinks, but explicitly match on them during build and
create symlinks to the output files. Furthermore, clean up the
documentation source files to remove invalid multiple outputs.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agochangelog: update changelog for missing v3.14 changes
Jon Masters [Thu, 2 Jun 2011 17:25:07 +0000 (13:25 -0400)]
changelog: update changelog for missing v3.14 changes

Fix the changelog.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agochangelog: fix the changelog for v3.14 release v3.14
Jon Masters [Thu, 2 Jun 2011 06:37:04 +0000 (02:37 -0400)]
changelog: fix the changelog for v3.14 release

Quick edit to the 3.14 release to include an updated changelog.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agorelease: bump the release to 3.14
Jon Masters [Thu, 2 Jun 2011 06:29:18 +0000 (02:29 -0400)]
release: bump the release to 3.14

This pi release includes various fixes, an updated build release
system, and improved code documentation.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agobuild: fix release process to drive tools such as git, gpg, and scp
Jon Masters [Thu, 2 Jun 2011 06:27:12 +0000 (02:27 -0400)]
build: fix release process to drive tools such as git, gpg, and scp

The legacy release process was outdated. Fix it to use modern tools,
and create additional make targets, such as "push" to kernel.org.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agotodo: add various todo items
Jon Masters [Thu, 2 Jun 2011 03:11:06 +0000 (23:11 -0400)]
todo: add various todo items

Some more todos, this time for modprobe

Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agomodprobe: add documentation and clean up
Jon Masters [Thu, 2 Jun 2011 03:10:39 +0000 (23:10 -0400)]
modprobe: add documentation and clean up

Add proper function documentation and clean up

Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agomodprobe: cleanup source, Free Software Foundation mailing address.
Jon Masters [Wed, 1 Jun 2011 21:48:25 +0000 (17:48 -0400)]
modprobe: cleanup source, Free Software Foundation mailing address.

The FSF GPLv2 boilerplate has needed updating for a long, long time.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agodepmod: cleanup source, Free Software Foundation mailing address.
Jon Masters [Wed, 1 Jun 2011 21:44:40 +0000 (17:44 -0400)]
depmod: cleanup source, Free Software Foundation mailing address.

The FSF GPLv2 boilerplate has needed updating for a long, long time.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agotodo: update todo with various cleanup exercises
Jon Masters [Wed, 1 Jun 2011 07:10:40 +0000 (03:10 -0400)]
todo: update todo with various cleanup exercises

Some cleanup activities for depmod, and more generally.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agodepmod: add function documentation
Jon Masters [Wed, 1 Jun 2011 07:10:06 +0000 (03:10 -0400)]
depmod: add function documentation

Document various functions within depmod.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agotodo: add a note to fix depmod list handling wheel re-invention disease
Jon Masters [Wed, 1 Jun 2011 05:03:05 +0000 (01:03 -0400)]
todo: add a note to fix depmod list handling wheel re-invention disease

There are too many different functions basically managing lists in depmod.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agodoc: describe the incompatibility of the -E and -F options
Jon Masters [Wed, 1 Jun 2011 04:42:36 +0000 (00:42 -0400)]
doc: describe the incompatibility of the -E and -F options

These options are incompatible. Make sure that is clear.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agodoc: add description of -m depmod parameter
Jon Masters [Wed, 1 Jun 2011 04:37:50 +0000 (00:37 -0400)]
doc: add description of -m depmod parameter

The -m depmod parameter forces generation of legacy map files.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agodoc: add description of -w depmod parameter
Jon Masters [Wed, 1 Jun 2011 04:27:31 +0000 (00:27 -0400)]
doc: add description of -w depmod parameter

The -w parameter can be used to instruct depmod to detect duplicates
when generating its index tables.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agodoc: add documentation for depmod -P argument
Jon Masters [Wed, 1 Jun 2011 04:19:55 +0000 (00:19 -0400)]
doc: add documentation for depmod -P argument

The -P argument can be supplied to specify a prefix character to strip
from all symbols.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agodoc: add documentation for modules.devname depmod files
Jon Masters [Tue, 31 May 2011 23:50:15 +0000 (19:50 -0400)]
doc: add documentation for modules.devname depmod files

Depmod has an ability to output a file named modules.devname containing
a list of all "devname" aliases provided by modules. This file is read by
a utility such as udev, which can create necessary devices in /dev.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agodoc: add description of -E (--symvers) option to depmod manpage
Jon Masters [Tue, 31 May 2011 23:46:13 +0000 (19:46 -0400)]
doc: add description of -E (--symvers) option to depmod manpage

A previous patch added support for verifying the list of symbols
supplied by modules matches with the kernel list.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agodoc: fix alignment of depmod SYNOPSIS in man page
Jon Masters [Tue, 31 May 2011 23:36:50 +0000 (19:36 -0400)]
doc: fix alignment of depmod SYNOPSIS in man page

Add an additional space character to fix formatting in SYNOPSIS.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agologs: update changelog and authors file
Jon Masters [Tue, 31 May 2011 22:11:05 +0000 (18:11 -0400)]
logs: update changelog and authors file

These files were a little out of date. There's always the git history,
but it's nice to have a record of various relevant changes here too.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agorelease: bump release to 3.13 v3.13
Jon Masters [Tue, 31 May 2011 04:57:37 +0000 (00:57 -0400)]
release: bump release to 3.13

This latest release includes multiple modprobe configuration directories
(allowing for runtime preference /run/modprobe.d, /etc/modprobe.d,
 /usr/local/lib/modprobe.d, /lib/modprobe.d). There is also support for
kernel versions other than 2.6.x since a 3.x release is forthcoming.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agomodprobe: remove extraneous info() call
Jon Masters [Tue, 31 May 2011 04:54:58 +0000 (00:54 -0400)]
modprobe: remove extraneous info() call

A previous patch for multiple modprobe configuration directories added a call
to info() for each configuration file loaded. This breaks various existing
behavior (for example --show-depends output) and so is reverted for now.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agodepmod: Handle X.Y kernel versions
Michal Marek [Mon, 30 May 2011 13:58:43 +0000 (15:58 +0200)]
depmod: Handle X.Y kernel versions

What a stupid check.

Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agomodprobe: implement precedence of configuration directories
Tom Gundersen [Thu, 26 May 2011 18:57:57 +0000 (20:57 +0200)]
modprobe: implement precedence of configuration directories

Configuration files are parsed in alphabetic order, regardles of what
directory they reside in. Furthermore, if several files by the same name
exist in different directories only the one in the directory with highest
precedence is loaded.

The order of precedence is /run, /etc, /usr/local/lib, /lib.

Cc: Jon Masters <jcm@jonmasters.org>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Aaron Griffin <aaron@archlinux.org>
Cc: Thomas Bächler <thomas@archlinux.org>
Signed-off-by: Tom Gundersen <teg@jklm.no>
Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agomodprobe: use more than one config directory
Tom Gundersen [Thu, 26 May 2011 18:57:56 +0000 (20:57 +0200)]
modprobe: use more than one config directory

Read config files from the following directories:

/run/modprobe.d
config files generated at runtime, useful e.g. for compatibility
with non-standard config files (such as /etc/rc.conf in Arch)
/etc/modprobe.d
config files manually created by the administrator
/lib/modprobe.d
config files installed by third-party packages
/usr/local/lib/modprobe.d
config files during development of third-party packages

This scheme is the same as the one employed by udev, systemd and possibly
others.

A follow-up patch lets files in one directory override files in others, as
done elsewhere.

Cc: Jon Masters <jcm@jonmasters.org>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Aaron Griffin <aaron@archlinux.org>
Cc: Thomas Bächler <thomas@archlinux.org>
Signed-off-by: Tom Gundersen <teg@jklm.no>
Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agomodprobe: blacklist modules on kernel commandline
Tom Gundersen [Thu, 26 May 2011 18:57:55 +0000 (20:57 +0200)]
modprobe: blacklist modules on kernel commandline

Modules mod1, mod2 and mod3 can now be blacklisted by passing

modprobe.blacklist=mod1,mod2,mod3

on the kernel command line.

This is useful in case a module prevents the system from booting.

Cc: Jon Masters <jcm@jonmasters.org>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Aaron Griffin <aaron@archlinux.org>
Cc: Thomas Bächler <thomas@archlinux.org>
Signed-off-by: Tom Gundersen <teg@jklm.no>
Signed-off-by: Jon Masters <jcm@jonmasters.org>
7 years agotestsuite: check size against the right file
Keegan McAllister [Thu, 16 Dec 2010 16:53:03 +0000 (11:53 -0500)]
testsuite: check size against the right file

Signed-off-by: Keegan McAllister <keegan@ksplice.com>
7 years agotestsuite: remove modprobe module renaming test
Keegan McAllister [Thu, 16 Dec 2010 16:53:02 +0000 (11:53 -0500)]
testsuite: remove modprobe module renaming test

Support for this feature was removed in 30df3f6e.

Signed-off-by: Keegan McAllister <keegan@ksplice.com>
7 years agotestsuite: pass -F to depmod when passing -e
Keegan McAllister [Thu, 16 Dec 2010 16:53:01 +0000 (11:53 -0500)]
testsuite: pass -F to depmod when passing -e

depmod -e without -E or -F will print a warning and have no effect.

Signed-off-by: Keegan McAllister <keegan@ksplice.com>
7 years agotestsuite: mock unlink()
Keegan McAllister [Thu, 16 Dec 2010 16:53:00 +0000 (11:53 -0500)]
testsuite: mock unlink()

Needed by depmod.

Signed-off-by: Keegan McAllister <keegan@ksplice.com>
7 years agotestsuite: export TEST_ENDIAN and TEST_BITS
Keegan McAllister [Thu, 16 Dec 2010 16:52:59 +0000 (11:52 -0500)]
testsuite: export TEST_ENDIAN and TEST_BITS

These environment variables were introduced in f2668710 but were not exported
by tests/runtests.  As a result, a lot of tests were silently failing to run.

Signed-off-by: Keegan McAllister <keegan@ksplice.com>
7 years agom-i-t: constify
Mike Frysinger [Wed, 8 Dec 2010 09:25:51 +0000 (04:25 -0500)]
m-i-t: constify

Constify a bunch of data structures that need not be writable.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
7 years agodepmod/modprobe: localize functions/variables
Mike Frysinger [Wed, 8 Dec 2010 09:25:50 +0000 (04:25 -0500)]
depmod/modprobe: localize functions/variables

No reason for these guys to be exported, so mark them all static.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
7 years agodepmod: new --symbol-prefix option
Mike Frysinger [Wed, 13 Apr 2011 06:56:47 +0000 (02:56 -0400)]
depmod: new --symbol-prefix option

Some ports (like the Blackfin architecture) prefix all their symbols with
an underscore.  So add a new --symbol-prefix option to support this.

In the past, I've always used depmod.pl from busybox, so the limitation
in m-i-t's depmod wasn't a blocker for me.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Jon Masters <jcm@jonmasters.org>
8 years agorelease: module-init-tools v3.12 v3.12
Jon Masters [Mon, 7 Jun 2010 07:57:04 +0000 (03:57 -0400)]
release: module-init-tools v3.12

The latest version of module-init-tools contains new features such
as "devname" and "softdep" alias support, as well as various bug
fixes and other miscellaneous enhancements. A detailed list of
changes is also available on modules.wiki.kernel.org:

https://modules.wiki.kernel.org/index.php/Module_init_tools_3_12

Signed-off-by: Jon Masters <jcm@jonmasters.org>
8 years agodepmod: export static device node information to modules.devname
Kay Sievers [Mon, 24 May 2010 14:15:05 +0000 (16:15 +0200)]
depmod: export static device node information to modules.devname

To be able to let udev support kernel module on-demand loading, the next
kernel will export:
  alias: devname:<name>
for some well-defined common kernel modules. This will let the kernel call
modprobe when the device node is accessed, the subsystem/driver will be
initialized and the open() of the device node will magically succeed.

The static device node aliases will be carried in the module itself. depmod
extracts this information:
  $ cat /lib/modules/2.6.34-00650-g537b60d-dirty/modules.devname
  # Device nodes to trigger on-demand module loading.
  microcode cpu/microcode c10:184
  fuse fuse c10:229
  ppp_generic ppp c108:0
  tun net/tun c10:200
  dm_mod mapper/control c10:235

Udev will pick up the depmod created file on startup and create all the
static device nodes which the kernel modules specify, so that these modules
get automatically loaded when the device node is accessed:
  $ /sbin/udevd --debug
  ...
  static_dev_create_from_modules: mknod '/dev/cpu/microcode' c10:184
  static_dev_create_from_modules: mknod '/dev/fuse' c10:229
  static_dev_create_from_modules: mknod '/dev/ppp' c108:0
  static_dev_create_from_modules: mknod '/dev/net/tun' c10:200
  static_dev_create_from_modules: mknod '/dev/mapper/control' c10:235
  udev_rules_apply_static_dev_perms: chmod '/dev/net/tun' 0666
  udev_rules_apply_static_dev_perms: chmod '/dev/fuse' 0666

Signed-off-by: Jon Masters <jcm@jonmasters.org>
8 years agodepmod: add some comments to the code v3.12-pre3
Jon Masters [Tue, 25 May 2010 18:53:06 +0000 (14:53 -0400)]
depmod: add some comments to the code

Some comments I was working on recently. More coming later.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
8 years agoBUGS: Update the bugs file
Jon Masters [Tue, 25 May 2010 04:48:57 +0000 (00:48 -0400)]
BUGS: Update the bugs file

8 years agoBUGS: Tracking bugs being worked on from bugzilla
Jon Masters [Tue, 25 May 2010 04:47:06 +0000 (00:47 -0400)]
BUGS: Tracking bugs being worked on from bugzilla

BUGS contains bugs being worked on/status if they are simple enough
for ease of reference - canonical source is bugzilla.kernel.org

Signed-off-by: Jon Masters <jcm@jonmasters.org>
8 years agopre-release: module-init-tools v3.12-pre3 v3.3-pre13
Jon Masters [Tue, 4 May 2010 05:13:43 +0000 (01:13 -0400)]
pre-release: module-init-tools v3.12-pre3

A few more misc. fixes. Assuming nothing blows up 3.12 will follow
with a couple more fixes shortly after this one.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
8 years agobuild: handle old (System V) style wc output
Alan Jenkins [Tue, 4 May 2010 05:10:01 +0000 (01:10 -0400)]
build: handle old (System V) style wc output

wc -w may output "      0" instead of "0".  Handle this using an integer
comparison (instead of a string comparison).

Signed-off-by: Jon Masters <jcm@jonmasters.org>
8 years agomodprobe: try to remove unused modules first
Alan Jenkins [Tue, 16 Mar 2010 17:49:58 +0000 (17:49 +0000)]
modprobe: try to remove unused modules first

This allows e.g. removing all alsa modules with

    modprobe -r `lsmod|cut -d " " -f1|grep snd`

or even removing all currently unused modules.

    modprobe -r `lsmod|cut -d " " -f1|grep -v Module`

8 years agomodprobe: pull underscores() out of do_modprobe()
Alan Jenkins [Tue, 16 Mar 2010 13:36:36 +0000 (13:36 +0000)]
modprobe: pull underscores() out of do_modprobe()

The softdep parser should probably have done the conversion already.

Both callers (do_softdep() and main()) are able to run underscores()
in-place.  So this means we don't need to allocate and free a copy.

It also makes the next commit easier.

8 years agomodprobe: --dump-modversions takes one filename only
Alan Jenkins [Tue, 16 Mar 2010 13:55:27 +0000 (13:55 +0000)]
modprobe: --dump-modversions takes one filename only

[--all would have worked, but that wasn't documented as a feature]
Fix the documentation.  Move the code out of the top-level loop.

This also makes the next commit easier.

8 years agomodprobe: remove some redundant softdep code
Alan Jenkins [Tue, 16 Mar 2010 14:55:50 +0000 (14:55 +0000)]
modprobe: remove some redundant softdep code

If we can't find a module, we don't need to check for a softdep.

The initial softdep design allowed you to define "fake" modules, in the
same way as with install commands.  But we decided this had only bad
effects, so the feature was removed.

8 years agomodprobe: remove support for renaming modules
Alan Jenkins [Tue, 16 Mar 2010 12:59:51 +0000 (12:59 +0000)]
modprobe: remove support for renaming modules

This was prompted by the observation that do_softdep() doesn't implement
module renaming.

Searching for "modprobe -o" and "modprobe --name" turns up two possible
uses: creating multiple instances of the "bonding" or "dummy" network
devices.  Modern kernels provide cleaner ways to do this.  The old
way using "modprobe --name" doesn't work any more.

<https://bugzilla.redhat.com/show_bug.cgi?id=247718>
"Bonding Module fails to recognise the '-o' parameter on load"

    Comment #1 should explain how to resolve this issue.
    To create an additional bond on rhel5, please do this:

    # echo another_name > /sys/class/net/bonding_masters

    rather than using modprobe. The kernel's bonding code now uses
    sysfs for configuration of multiple bonds

<http://lkml.org/lkml/2007/6/8/381>
"2.6 kernel: Cannot make multiple dummy network interfaces"

    [solution was to use the "numdummies" module option]

8 years agomodprobe: fix softdep flags
Alan Jenkins [Mon, 15 Mar 2010 15:34:38 +0000 (15:34 +0000)]
modprobe: fix softdep flags

1. When a softdep is present, all the flags e.g.
   --use-blacklist are being ignored.  Fix that.

2. When processing softdeps, mask out the "first_time"
   flag.  This brings them into line with both install
   commands and normal dependencies.  (We don't need to
   worry about "ignore_commands", because it would
   prevent softdeps from being loaded in the first
   place).  If we're unloading, we should also mask in
   the "quiet_inuse" flag.

8 years agomodprobe: fix dump_config
Alan Jenkins [Tue, 16 Mar 2010 11:22:40 +0000 (11:22 +0000)]
modprobe: fix dump_config

I broke this when refactoring the config handling.  --show-config
ended up printing the contents of user config files twice. Also
parse_kcmdline() was always called with dump_only=1, regardless of
whether --show-config was requested.

8 years agodoc: fix sgml errors
Alan Jenkins [Wed, 17 Mar 2010 10:13:28 +0000 (10:13 +0000)]
doc: fix sgml errors

8 years agodoc: fix typo
Alan Jenkins [Mon, 15 Mar 2010 14:29:22 +0000 (14:29 +0000)]
doc: fix typo

8 years agobuild: remove explicit call to build modules.dep.bin v3.12-pre2
Jon Masters [Wed, 10 Mar 2010 08:51:56 +0000 (03:51 -0500)]
build: remove explicit call to build modules.dep.bin

There's a known bug with docbook2man in some cases (Fedora) not
following multiple names for a manpage and only generating a
single output file. We use links in the source to ensure
those other versions will be built if possible. A better
fix will be to figure out how to make docbook2man behave.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
8 years agobuild: fix the release location for automated builds
Jon Masters [Wed, 10 Mar 2010 08:21:20 +0000 (03:21 -0500)]
build: fix the release location for automated builds

The location for my test builds is in a new directory.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
8 years agodoc: fix reference for modules.dep.bin
Jon Masters [Wed, 10 Mar 2010 08:18:58 +0000 (03:18 -0500)]
doc: fix reference for modules.dep.bin

The build scripts calling out to docbook2man need to have entries
in the individual man page sources for each of the output files.
Correct the missing entry for the modules.dep.bin file.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
8 years agopre-release: module-init-tools v3.12-pre2
Jon Masters [Wed, 10 Mar 2010 07:19:32 +0000 (02:19 -0500)]
pre-release: module-init-tools v3.12-pre2

The latest pre-release version including all of the hard work on
softdep support from Andreas and some cleanups from Alan and I.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
8 years agomodprobe: fix the softdep docs and re-order the modprobe.conf man page
Jon Masters [Wed, 10 Mar 2010 06:12:24 +0000 (01:12 -0500)]
modprobe: fix the softdep docs and re-order the modprobe.conf man page

The softdep docs were great but I cleaned them up slightly, and I also
added a warning to the new COMPATIBILITY section I had added recently.
Also, re-order this file so that everything is in alphabetical order.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
8 years agomodprobe: trivial cleanups post-merge of softdep bits
Jon Masters [Wed, 10 Mar 2010 06:10:39 +0000 (01:10 -0500)]
modprobe: trivial cleanups post-merge of softdep bits

In order to merge in the softdep bits from alan, I wound up resetting
the dev tree and remerging the whole lot. Next time, I'll just review
the patches in another tree and then pull the lot, which is better.
These two trivial differences were in my tree and are ok to keep.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
8 years agoMerge branch 'alan-softdep-merge' into dev
Jon Masters [Wed, 10 Mar 2010 06:04:57 +0000 (01:04 -0500)]
Merge branch 'alan-softdep-merge' into dev

8 years agodepmod: trivial add comment to depmod.h
Jon Masters [Tue, 9 Mar 2010 06:01:39 +0000 (01:01 -0500)]
depmod: trivial add comment to depmod.h

Signed-off-by: Jon Masters <jcm@jonmasters.org>
8 years agoconfig_filter: add some documentation
Jon Masters [Thu, 4 Mar 2010 08:07:05 +0000 (03:07 -0500)]
config_filter: add some documentation

Signed-off-by: Jon Masters <jcm@jonmasters.org>
8 years agodoc: Further documentation updates and rewrites
Jon Masters [Tue, 2 Mar 2010 10:29:14 +0000 (05:29 -0500)]
doc: Further documentation updates and rewrites

The documentation has been sadly lacking. Fortunately, there is a new
wiki and some great plans for content on module design/implementation.
Until that is all done, at least get these docs in better shape.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
8 years agotests: enable leak checking under --valgrind
Alan Jenkins [Tue, 2 Mar 2010 09:59:44 +0000 (09:59 +0000)]
tests: enable leak checking under --valgrind

Since we have squashed all the leaks (or at least the ones that show up
in the test suite), we can now use valgrind to look out for new ones.

One of the reasons for this exercise is the index code, which mixes
recursion with allocating and freeing memory.  Memory leaks may not
cause any problems at run-time - but they're still bugs, and bugs
can make code harder to maintain.

8 years agoMerge branch 'cleanups' into softdep-merge
Alan Jenkins [Tue, 2 Mar 2010 09:59:00 +0000 (09:59 +0000)]
Merge branch 'cleanups' into softdep-merge

Conflicts:
modprobe.c

8 years agomodprobe: re-use config data across multiple calls to do_modprobe()
Alan Jenkins [Fri, 26 Feb 2010 17:51:39 +0000 (17:51 +0000)]
modprobe: re-use config data across multiple calls to do_modprobe()

This avoids having do_softdep() leak the memory allocated for config
data.

8 years agomodprobe: complete the separation of config parsing and alias resolution
Alan Jenkins [Fri, 26 Feb 2010 15:59:22 +0000 (15:59 +0000)]
modprobe: complete the separation of config parsing and alias resolution

The parser now records all the aliases from the config file, deferring
alias resolution to do_modprobe().  This will allow the config data to
be re-used across multiple invocations of do_modprobe().

8 years agomodprobe: clean up minor memory leaks
Alan Jenkins [Fri, 26 Feb 2010 14:48:27 +0000 (14:48 +0000)]
modprobe: clean up minor memory leaks

 - "struct module"

 - use of setenv()

 - internal node leak in index_search() and index_searchwild()

 - some of the more obscure modprobe options, which were bypassing the
   cleanup code in main()

I can see only one more leak (which occurred during the softdep work):

 - the contents of "struct modprobe_conf"

8 years agomodprobe: re-enable inadvertently disabled options
Jon Masters [Tue, 2 Mar 2010 05:30:37 +0000 (00:30 -0500)]
modprobe: re-enable inadvertently disabled options

At some point several short options versions (-S, -D, -R) were inadvertently
disabled. The first is used to override the kernel version, the second is used
to dump dependency information, and the third dumps resolved alias information.

The documentation was updated in the manpages in the previous commit and is
now in sync with how modprobe is actually implemented.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
8 years agodoc: cleanup all of the man page documentation
Jon Masters [Tue, 2 Mar 2010 05:26:27 +0000 (00:26 -0500)]
doc: cleanup all of the man page documentation

The man pages have suffered from a little bitrot over time. Fix that by
updating them with references to recent changes, noting some planned
future behavioral changes (modprobe "install" commands), and improve
readability by re-ordering modprobe options to ensure everything is
documented in the current release.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
8 years agometa: update various documentation, logs, authors, etc.
Jon Masters [Mon, 1 Mar 2010 04:38:08 +0000 (23:38 -0500)]
meta: update various documentation, logs, authors, etc.

The various files within the tree documenting who did what and when were
rather sadly out of date. I have begun cleaning this up properly.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
8 years agomodprobe: refactor read_aliases()
Alan Jenkins [Fri, 26 Feb 2010 14:43:29 +0000 (14:43 +0000)]
modprobe: refactor read_aliases()

It doesn't care whether we are "removing", and it only parses aliases
(not an entire config).

Enhance readability by splitting it into two functions, for binary
and text files respectively.  This matches the way read_depends()
is written.

Fix some sites to use read_aliases() instead of parse_config_file().

8 years agoinsmod: fix memory leak
Alan Jenkins [Wed, 30 Sep 2009 16:22:10 +0000 (17:22 +0100)]
insmod: fix memory leak

insmod makes a half-successful attempt to clean up on failure.  Let's
make it clean up on all failures, and remember to clean up on success
as well.

This leaves modprobe as the only leaky program, at least for the code
paths executed by the test suite.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
8 years agomodprobe: fix memory leak when built with zlib support
Alan Jenkins [Wed, 30 Sep 2009 16:22:10 +0000 (17:22 +0100)]
modprobe: fix memory leak when built with zlib support

We don't use posix file locks anymore, so we don't need to play games
with fds, and we don't need to worry about dropping locks when we close
fds.  This allows us to simplify the code a bit and remove the
intentional memory leak.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
8 years agoelfops: fix crash on grab_fd() failure
Alan Jenkins [Wed, 30 Sep 2009 16:22:10 +0000 (17:22 +0100)]
elfops: fix crash on grab_fd() failure

If we call release_elf_file() when grab_fd() fails, it will call
release_file() with a NULL pointer and undefined length.  This can
cause a crash when zlib support is disabled and release_file() is
implemented using munmap().

This is only theoretical at the moment.  However it will allow
grab_elf_file_fd() to be removed straightforwardly, without
creating a more significant bug.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
8 years agomodprobe: fix potential memory leak on failure path
Alan Jenkins [Wed, 30 Sep 2009 16:22:10 +0000 (17:22 +0100)]
modprobe: fix potential memory leak on failure path

Ensure release_elf_file() is called on a rare failure path.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
8 years agomodprobe: simplify insmod() calling convention - don't free optstring
Alan Jenkins [Wed, 30 Sep 2009 16:22:10 +0000 (17:22 +0100)]
modprobe: simplify insmod() calling convention - don't free optstring

There's no need to clobber optstring; we can afford to make a copy.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
8 years agomodprobe: clean up mit_ignore_loaded flag in rmmod()
Alan Jenkins [Wed, 30 Sep 2009 16:22:11 +0000 (17:22 +0100)]
modprobe: clean up mit_ignore_loaded flag in rmmod()

handle_module() clears mit_ignore_loaded before calling rmmod(). So we
didn't really want to set it in the first place!  Also, rmmod() uses the
flag to mean something which differs both from the name itself, and the
way it is used in insmod().

Replace the mit_ignore_loaded in rmmod() with a new flag mit_quiet_inuse
(it means not to complain if the module cannot be removed because it is
in use).

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
8 years agoFix SGML docs in module-init-tools-3.11
Thomas Koeller [Thu, 11 Feb 2010 19:18:05 +0000 (20:18 +0100)]
Fix SGML docs in module-init-tools-3.11

Hi Jon,

there is a bug in module-init-tools-3.11 that leads to an error when building the man pages. The patch below fixes it.

Signed-off-by: Jon Masters <jcm@modules.bos.jonmasters.org>
8 years agoFix depmod -e without -F or -E unterminated warning
Gilles Espinasse [Tue, 16 Feb 2010 14:02:04 +0000 (15:02 +0100)]
Fix depmod -e without -F or -E unterminated warning

Signed-off-by: Gilles Espinasse <g.esp@free.fr>
Signed-off-by: Jon Masters <jcm@modules.bos.jonmasters.org>
8 years agopre-release: initial version for 3.12 v3.12-pre1
Jon Masters [Fri, 15 Jan 2010 07:10:19 +0000 (02:10 -0500)]
pre-release: initial version for 3.12

This is the initial release that will become 3.12. It has a few cleanups. I
will next work on the softdep patches.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
8 years agoMerge branch 'master' of ../module-init-tools_alan
Jon Masters [Fri, 15 Jan 2010 07:02:48 +0000 (02:02 -0500)]
Merge branch 'master' of ../module-init-tools_alan

8 years agodepmod: use real regex matching on depmod "overrides" entries
Jon Masters [Fri, 15 Jan 2010 06:55:02 +0000 (01:55 -0500)]
depmod: use real regex matching on depmod "overrides" entries

We implement support for matching "override" entries in depmod config
files to determine which module of several alternatives will be used.

The existing implementation is a very poor "wildcard" match that does
not use real regular expressions. This version uses the standard POSIX
extended regular expressions, with backward compatibility to match on
a single "*" kernel version as in the original (broken) design.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
8 years agoBug#548841: module-init-tools: Modprobe -q should always return 0.
Philipp Weis [Sun, 18 Oct 2009 03:50:08 +0000 (23:50 -0400)]
Bug#548841: module-init-tools: Modprobe -q should always return 0.

On 2009-09-30 16:49, Alan Jenkins <sourcejedi.lkml@googlemail.com> wrote:
> On 9/29/09, Alan Jenkins <sourcejedi.lkml@googlemail.com> wrote:
> >> When calling modprobe -q with a non-existing module, it returns with
> >> exit code 1. According to the manpage, modprobe "normally" will report
> >> an error, and with -q shouldn't, so I believe the exist code should
> >> always be 0, at least that seems to be the assumption in some init
> >> scripts (e.g. binfmt-support).
> >
> > That part is ambiguous, but I guess "modprobe will simply ignore any
> > bogus names" is pretty clear.
> >
>
> > ... and comments in the git log imply we _used_ to get this right.
> >
> > ""
> >
> > Andreas, at first glance this regression is due to your commit
> > 73bdf4ab.  Care to submit a patch to revert the relevant lines?
>
> Sorry, I completely misread both the git log comments and Andreas'
> code.  This isn't a regression, it's more of a feature request.
>
> The manpage does say modprobe -q "will simply ignore any bogus names",
> implying that modprobe should return success in this case.  But
> test-modprobe/19quiet.sh has always required "modprobe -q crap" to
> return failure.
>
> So this is intentional at some level, we've always done it this way in
> the past, and we need to consider the risk of breaking scripts which
> expect the current behaviour.
>
> The binfmt-support initscript seems a bad example to me.  It does this
>
>    # comments added by me
>
>     set -e # abort if any command fails
>     ...
>     modprobe -q binfmt_misc # this will cause an abort if
> binfmt_misc.ko doesn't exist...
>     mount -t binfmt_misc ... # but so will this
>
> It's only a problem if binfmt_misc is built into the kernel.  However,
> this will be solved by the modules.builtin work.
>
> So I think we would need a better justification to change this.

Ok, but then the manpage should be fixed. How about the attached
patch?

Philipp

--
Philipp Weis

Signed-off-by: Jon Masters <jcm@jonmasters.org>
8 years agoax_enable_builddir: improve quality of generated top-level Makefile
Alan Jenkins [Sat, 24 Oct 2009 12:56:53 +0000 (13:56 +0100)]
ax_enable_builddir: improve quality of generated top-level Makefile

The top-level Makefile is generated by mangling rules, "a: b".  We
already avoid mangling "a := b".  But we should also exclude "a = :".

Apparently this was causing unbalanced parenthesis errors on some
systems.

Reported-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Jon Masters <jcm@jonmasters.org>
8 years agodepmod: generate modules.softdep
Andreas Robinson [Thu, 5 Nov 2009 15:24:52 +0000 (16:24 +0100)]
depmod: generate modules.softdep

Signed-off-by: Andreas Robinson <andr345@gmail.com>
8 years agorelease: module-init-tools v3.11.1 v3.11.1
Jon Masters [Wed, 21 Oct 2009 04:07:58 +0000 (05:07 +0100)]
release: module-init-tools v3.11.1

Bump the release to 3.11.1 since the previous tarballs didn't have the
correct generated documentation files present.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
8 years agodoc: add softdep command
Andreas Robinson [Fri, 16 Oct 2009 09:50:11 +0000 (11:50 +0200)]
doc: add softdep command

Signed-off-by: Andreas Robinson <andr345@gmail.com>
8 years agorelease: module-init-tools v3.11 v3.11
Jon Masters [Thu, 15 Oct 2009 09:59:28 +0000 (11:59 +0200)]
release: module-init-tools v3.11

No major issues reported with the -rc1 so bump to v3.11 final and move on.

Signed-off-by: Jon Masters <jcm@jonmasters.org>
8 years agomodprobe: change softdep --pre/--post to pre:/post:
Andreas Robinson [Mon, 12 Oct 2009 08:26:58 +0000 (10:26 +0200)]
modprobe: change softdep --pre/--post to pre:/post:

"--" is modified by underscores(). This would have made the
future implementation of softdep in .modinfo more complicated.

Signed-off-by: Andreas Robinson <andr345@gmail.com>
8 years agotest: add softdep test, modprobe: fix simple bugs in do_softdep
Andreas Robinson [Sat, 10 Oct 2009 14:56:28 +0000 (16:56 +0200)]
test: add softdep test, modprobe: fix simple bugs in do_softdep

Signed-off-by: Andreas Robinson <andr345@gmail.com>
8 years agomodprobe: add simple softdep loop detector
Andreas Robinson [Sun, 4 Oct 2009 15:18:38 +0000 (17:18 +0200)]
modprobe: add simple softdep loop detector

Signed-off-by: Andreas Robinson <andr345@gmail.com>
8 years agoelfops: remove errfn_t from load_strings
Andreas Robinson [Sun, 4 Oct 2009 15:00:43 +0000 (17:00 +0200)]
elfops: remove errfn_t from load_strings

Commit 528db92ab1dd0d75dba415b9f3dc81f5a34773ce added an errfn_t
parameter to elfops_core.c:load_strings. This was for the purpose
of detecting missing terminators at the end of ELF-sections with
strings in them, such as .modinfo.

However, the committer (that'd be me) forgot to add any actual code to
load_strings() and now the errfn_t parameter complicates the error
handling when softdep is used.

This commit removes that parameter and adds a non-fatal warning message.

Signed-off-by: Andreas Robinson <andr345@gmail.com>
8 years agomodprobe: add softdep command
Andreas Robinson [Sat, 3 Oct 2009 19:30:18 +0000 (21:30 +0200)]
modprobe: add softdep command

Imlementation notes
-------------------

* find_softdep()/do_softdep() mirrors find_command()/do_command()
  precisely. (And if they don't, that's a bug.)

* Failures in the indirect modprobes, ie. those run by the softdep
  command, are ignored. This seems correct for removing, but I'm
  unsure what the proper action is when installing.

An example - or how it's supposed to work
-----------------------------------------

Configuration:
softdep foo --pre pre1 pre2 --post post1 post2

Installing a module:

$modprobe foo <CMDLINE_OPTS>

yields

modprobe pre1
modprobe pre2
modprobe --ignore-install foo <CMDLINE_OPTS>
modprobe post1
modprobe post2

Likewiese, removing a module:

$modprobe -r foo

yields

modprobe -r post2
modprobe -r post1
modprobe --ignore-remove -r foo
modprobe -r pre2
modprobe -r pre1

Signed-off-by: Andreas Robinson <andr345@gmail.com>
8 years agomodprobe: don't modify the modname string passed to do_modprobe
Andreas Robinson [Sat, 3 Oct 2009 19:20:23 +0000 (21:20 +0200)]
modprobe: don't modify the modname string passed to do_modprobe

The function will work on a copy instead.

Signed-off-by: Andreas Robinson <andr345@gmail.com>
8 years agomodprobe: enable calling do_modprobe from within handle_module,insmod,rmmod
Andreas Robinson [Sat, 3 Oct 2009 18:39:21 +0000 (20:39 +0200)]
modprobe: enable calling do_modprobe from within handle_module,insmod,rmmod

A new function, do_softdep(), will be invoked from the same locations
as do_command() as it eventually will replace it. do_softdep() in turn
needs to call do_modprobe().

This commit adds some parameters to do_modprobe, handle_module,
insmod and rmmod, needed to make this possible.

The pathnames for "module.symbols" and "modules.alias" are now
generated wherever they're needed, rather than in main().

Signed-off-by: Andreas Robinson <andr345@gmail.com>
8 years agomodprobe: put configuration objects in a struct
Andreas Robinson [Sat, 3 Oct 2009 18:22:48 +0000 (20:22 +0200)]
modprobe: put configuration objects in a struct

It is now possible to add or remove conf commands without rewriting
the function declarations of e.g parse_config_*() every time.

Signed-off-by: Andreas Robinson <andr345@gmail.com>
8 years agomodprobe: cleanup indentation change in conf parser
Andreas Robinson [Sat, 3 Oct 2009 18:18:35 +0000 (20:18 +0200)]
modprobe: cleanup indentation change in conf parser

Follow up to the previous commit.

Signed-off-by: Andreas Robinson <andr345@gmail.com>
8 years agomodprobe: reduce nesting in conf parser
Andreas Robinson [Sat, 3 Oct 2009 18:07:15 +0000 (20:07 +0200)]
modprobe: reduce nesting in conf parser

Helps readability and will simplify the softdep command parser.

Signed-off-by: Andreas Robinson <andr345@gmail.com>
8 years agoMerge branch 'master' into forkbomb
Alan Jenkins [Thu, 1 Oct 2009 09:18:00 +0000 (10:18 +0100)]
Merge branch 'master' into forkbomb

Conflicts:
modprobe.c

8 years agotestsuite: re-add test for /proc/modules support
Alan Jenkins [Wed, 30 Sep 2009 16:22:11 +0000 (17:22 +0100)]
testsuite: re-add test for /proc/modules support

Now we support /proc/modules as a fallback, we can revive the old
02proc.sh to provide testing coverage.

(The setup required alteration to fit with the current test suite,
 but the body of the test remains unchanged).

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>