platform/upstream/kmod.git
12 years agobuild: use AC_ARG_WITH for zlib
Jan Engelhardt [Sat, 24 Dec 2011 03:45:42 +0000 (04:45 +0100)]
build: use AC_ARG_WITH for zlib

Since it selects an external dependency for inclusion, AC_ARG_WITH
is preferred (autoconf.info 15.2 "Working with external software").

12 years agobuild: use pkgconfig to detect zlib
Jan Engelhardt [Sat, 24 Dec 2011 03:45:22 +0000 (04:45 +0100)]
build: use pkgconfig to detect zlib

build: explicitly call PKG_PROG_PKG_CONFIG

Per the manual page, PKG_PROG_PKG_CONFIG needs to be invoked
explicitly if PKG_CHECK_MODULES might not happen (it is indeed stowed
in an AS_IF in kmod). Without this, funny failures can occur.
(As it did.)

12 years agofile: speed up loading non-gzipped modules when zlib is enabled.
Gustavo Sverzut Barbieri [Sat, 24 Dec 2011 02:09:31 +0000 (00:09 -0200)]
file: speed up loading non-gzipped modules when zlib is enabled.

Just now realized that my distro (Gentoo) enables support for gzip but
does not compress modules by default.

In this case it's better to have a special case that uses mmap()
instead of a loop of realloc() + gzread().

12 years agobuild-sys: use AS_IF
Lucas De Marchi [Fri, 23 Dec 2011 14:03:19 +0000 (12:03 -0200)]
build-sys: use AS_IF

12 years agotools: kmod: show wrong command in err message
Lucas De Marchi [Fri, 23 Dec 2011 13:44:28 +0000 (11:44 -0200)]
tools: kmod: show wrong command in err message

12 years agotools: kmod: print help message when no commands given
Lucas De Marchi [Fri, 23 Dec 2011 13:35:48 +0000 (11:35 -0200)]
tools: kmod: print help message when no commands given

12 years agotools: kmod: add list command
Lucas De Marchi [Fri, 23 Dec 2011 13:33:02 +0000 (11:33 -0200)]
tools: kmod: add list command

It's the same of lsmod since there's not much to change on its format.

12 years agotools: kmod: Add handling of compat modprobe
Lucas De Marchi [Thu, 22 Dec 2011 05:54:46 +0000 (03:54 -0200)]
tools: kmod: Add handling of compat modprobe

12 years agotools: kmod: Add handling of compat modinfo
Lucas De Marchi [Thu, 22 Dec 2011 05:50:54 +0000 (03:50 -0200)]
tools: kmod: Add handling of compat modinfo

12 years agotools: kmod: Add handling of compat insmod
Lucas De Marchi [Thu, 22 Dec 2011 05:45:07 +0000 (03:45 -0200)]
tools: kmod: Add handling of compat insmod

12 years agotools: kmod: Add handling of compat rmmod
Lucas De Marchi [Thu, 22 Dec 2011 05:39:11 +0000 (03:39 -0200)]
tools: kmod: Add handling of compat rmmod

12 years agotools: kmod: Add handling of compat lsmod
Lucas De Marchi [Thu, 22 Dec 2011 05:01:45 +0000 (03:01 -0200)]
tools: kmod: Add handling of compat lsmod

12 years agotools: kmod: check progname for handling compat commands
Lucas De Marchi [Thu, 22 Dec 2011 21:21:11 +0000 (19:21 -0200)]
tools: kmod: check progname for handling compat commands

12 years agoFix leak on error path
Cristian Rodríguez [Fri, 23 Dec 2011 05:06:56 +0000 (03:06 -0200)]
Fix leak on error path

12 years agotools: kmod: Add global options
Lucas De Marchi [Fri, 23 Dec 2011 04:56:27 +0000 (02:56 -0200)]
tools: kmod: Add global options

12 years agotools: add skeleton of kmod tool
Lucas De Marchi [Thu, 22 Dec 2011 04:33:36 +0000 (02:33 -0200)]
tools: add skeleton of kmod tool

If using libtool 2.4.2, running the script generated by libtool will not
work because libtool changes argv[0] to lt-progname.

To test this is necessary to either fix the installed
build-aux/ltmain.sh file or run the binary directly like in:

$ export LD_LIBRARY_PATH=$PWD/libkmod/.libs/
$ ./tools/.libs/kmod help

12 years agobuild-sys: use MKDIR_P
Lucas De Marchi [Fri, 23 Dec 2011 03:59:31 +0000 (01:59 -0200)]
build-sys: use MKDIR_P

12 years agokmod_modprobe: use basename(argv[0]) in help message
Lucas De Marchi [Fri, 23 Dec 2011 03:36:10 +0000 (01:36 -0200)]
kmod_modprobe: use basename(argv[0]) in help message

12 years agokmod-modprobe: fix leak in command line option processing.
Gustavo Sverzut Barbieri [Thu, 22 Dec 2011 01:54:35 +0000 (23:54 -0200)]
kmod-modprobe: fix leak in command line option processing.

not that it should matter for the binary, but let's be strict with
leaks so running in valgrind never complains.

12 years agointroduce --with-rootlibdir=DIR
Kay Sievers [Thu, 22 Dec 2011 14:40:24 +0000 (15:40 +0100)]
introduce --with-rootlibdir=DIR

Support the installation of the shared library in the rootfs --rootlibdir=,
while the development symlink stays in --libdir=.

12 years agoInitialize line number with 0
Lucas De Marchi [Thu, 22 Dec 2011 03:30:40 +0000 (01:30 -0200)]
Initialize line number with 0

12 years agoRemove useless warning causing trouble in sparc64
Lucas De Marchi [Wed, 21 Dec 2011 22:10:43 +0000 (20:10 -0200)]
Remove useless warning causing trouble in sparc64

-Wcast-align is not that useful and just generates lots of warnings in
architectures like sparc64.

12 years agoFix unaligned memory access
Gustavo Sverzut Barbieri [Wed, 21 Dec 2011 20:23:58 +0000 (18:23 -0200)]
Fix unaligned memory access

Bug found on sparc64. Thanks to "Jan Engelhardt <jengelh@medozas.de>"
for providing access to such a machine.

12 years agodo not (mis-)use the config file generator for non-autobuild stuff
Kay Sievers [Wed, 21 Dec 2011 13:48:07 +0000 (11:48 -0200)]
do not (mis-)use the config file generator for non-autobuild stuff

"Similarly, you should not rely on AC_CONFIG_FILES to replace bindir
and friends in your shell scripts and other files; instead, let make
manage their replacement."

http://www.gnu.org/software/autoconf/manual/autoconf.html#Makefile-Substitutions

12 years agogitignore: ignore dist files
Lucas De Marchi [Wed, 21 Dec 2011 13:44:25 +0000 (11:44 -0200)]
gitignore: ignore dist files

12 years agokmod 2 v2
Lucas De Marchi [Wed, 21 Dec 2011 01:48:46 +0000 (23:48 -0200)]
kmod 2

12 years agoChange error message to reflect reality
Lucas De Marchi [Wed, 21 Dec 2011 01:39:56 +0000 (23:39 -0200)]
Change error message to reflect reality

12 years agoUpdate doc to reflect function behavior
Lucas De Marchi [Wed, 21 Dec 2011 01:39:30 +0000 (23:39 -0200)]
Update doc to reflect function behavior

12 years agoTesting for return of alias_normalize.
Luis Felipe Strano Moraes [Tue, 20 Dec 2011 16:13:56 +0000 (08:13 -0800)]
Testing for return of alias_normalize.

12 years agobuild-sys: do not use some compile flags by default
Lucas De Marchi [Tue, 20 Dec 2011 21:45:59 +0000 (19:45 -0200)]
build-sys: do not use some compile flags by default

12 years agoRemoving comments saying flags are not implemented
Lucas De Marchi [Tue, 20 Dec 2011 21:31:14 +0000 (19:31 -0200)]
Removing comments saying flags are not implemented

Both removal and insertion flags are already implemented.

12 years agoMove symbols introduced in libkmod2 to the right place
Lucas De Marchi [Tue, 20 Dec 2011 19:08:53 +0000 (17:08 -0200)]
Move symbols introduced in libkmod2 to the right place

12 years agobuild-sys: remove remaining _SOURCES var
Lucas De Marchi [Tue, 20 Dec 2011 18:57:11 +0000 (16:57 -0200)]
build-sys: remove remaining _SOURCES var

12 years agobuild-sys: default to "" as rootprefix
Lucas De Marchi [Tue, 20 Dec 2011 18:52:21 +0000 (16:52 -0200)]
build-sys: default to "" as rootprefix

12 years agokmod_modprobe: fix description of -C flag
Lucas De Marchi [Tue, 20 Dec 2011 18:39:59 +0000 (16:39 -0200)]
kmod_modprobe: fix description of -C flag

12 years agoconfigure: disable static zlib build.
Gustavo Sverzut Barbieri [Tue, 20 Dec 2011 18:30:01 +0000 (16:30 -0200)]
configure: disable static zlib build.

It was not being done correctly, disable until we find a way for
libtool to cooperate.

12 years agointroduce --with-rootprefix=DIR
Kay Sievers [Tue, 20 Dec 2011 16:58:05 +0000 (17:58 +0100)]
introduce --with-rootprefix=DIR

Configure the location of the rootfs directories and use it
to find (/usr)/lib/modules and (/usr)/lib/modprobe.d.

12 years agoUse sorted configuration files in precedence order
Lucas De Marchi [Tue, 20 Dec 2011 17:56:31 +0000 (15:56 -0200)]
Use sorted configuration files in precedence order

We need to keep config files sorted and use them taking the precedence
order into account.

The following message was taken from module-init-tools commit doing a
similar thing:

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/lib, /lib.

The sad thing is that we are not using openat() anymore since each file
is in different directories. In future we might change the
implementation to open all DIRs and keep a reference
to them instead of the path. However we'd have to keep a separate list
with all the opened dirs so we can close them later (when all configs
are parsed).

12 years agobuild: use dist-xz
Jan Engelhardt [Tue, 20 Dec 2011 15:28:27 +0000 (16:28 +0100)]
build: use dist-xz

It's 2011 already.

12 years agogitignore: only ignore build system files in the top directory
Jan Engelhardt [Tue, 20 Dec 2011 15:27:07 +0000 (16:27 +0100)]
gitignore: only ignore build system files in the top directory

12 years agolibkmod: use C99 __func__ over GNU-specific __FUNCTION__
Jan Engelhardt [Tue, 20 Dec 2011 15:27:40 +0000 (16:27 +0100)]
libkmod: use C99 __func__ over GNU-specific __FUNCTION__

12 years agokmod_config: fix kcmd line parser with dots after =
Lucas De Marchi [Tue, 20 Dec 2011 15:25:24 +0000 (13:25 -0200)]
kmod_config: fix kcmd line parser with dots after =

Check if '=' appeared before the dot. In this case, it's not a valid
module option in kernel command line.

The command line that was failing is:

"root=/dev/sda3 ro pcie_aspm=force init=/sbin/bootchartd
initrd=../initramfs-linux.img BOOT_IMAGE=../vmlinuz-linux"

12 years agoRemoving warnings when compiling on i686 platform.
Luis Felipe Strano Moraes [Tue, 20 Dec 2011 15:11:46 +0000 (07:11 -0800)]
Removing warnings when compiling on i686 platform.

12 years agokmod_module_new_*: improve debugging.
Gustavo Sverzut Barbieri [Tue, 20 Dec 2011 15:04:10 +0000 (13:04 -0200)]
kmod_module_new_*: improve debugging.

12 years agokmod_modprobe: Fix regression when inserting module
Lucas De Marchi [Tue, 20 Dec 2011 15:11:33 +0000 (13:11 -0200)]
kmod_modprobe: Fix regression when inserting module

Commit "e5e2a68 kmod_modprobe: properly handle install/remove commands"
introduced a regression that, while it worked for install/remove
commands, it ceased to work for normal module names. Move the check for
whether it's a install command or a module so both cases work.

12 years agoFix check for opened indexes
Lucas De Marchi [Tue, 20 Dec 2011 14:29:13 +0000 (12:29 -0200)]
Fix check for opened indexes

12 years agoelf: fix regression with empty strings
Lucas De Marchi [Tue, 20 Dec 2011 14:04:21 +0000 (12:04 -0200)]
elf: fix regression with empty strings

Commit "b20dc17 Remove unneeded reference to last string" reverted the
fix in "47a0ef6 elf: do not output empty strings." and empty strings are
appearing again in kmod-modinfo.

With this commit we do a bit different and instead of keeping the
reference to last string we skip the '\0' inside the loop.

12 years agoCache the offset of crc
Lucas De Marchi [Tue, 20 Dec 2011 13:41:19 +0000 (11:41 -0200)]
Cache the offset of crc

This way we don't need to check every time in loop. Indeed compiler
could already optimize out that checks, but this ways is cleaner and
shorter.

12 years agoMake section size constant since it's always the same
Lucas De Marchi [Tue, 20 Dec 2011 06:02:15 +0000 (04:02 -0200)]
Make section size constant since it's always the same

12 years agoOptimize kmod_elf_get_strings() by reducing calls to memcpy
Lucas De Marchi [Tue, 20 Dec 2011 05:25:23 +0000 (03:25 -0200)]
Optimize kmod_elf_get_strings() by reducing calls to memcpy

Copy the entire string only once and then scan it, setting up the
pointers of the vector.

12 years agoRemove unneeded reference to last string
Lucas De Marchi [Tue, 20 Dec 2011 05:12:35 +0000 (03:12 -0200)]
Remove unneeded reference to last string

12 years agoPut blank lines where it's due
Lucas De Marchi [Tue, 20 Dec 2011 05:10:58 +0000 (03:10 -0200)]
Put blank lines where it's due

See CODING-STYLE for reference

12 years agoTerminate strv with NULL
Lucas De Marchi [Tue, 20 Dec 2011 05:09:58 +0000 (03:09 -0200)]
Terminate strv with NULL

12 years agoReduce ident by continuing early
Lucas De Marchi [Tue, 20 Dec 2011 05:08:09 +0000 (03:08 -0200)]
Reduce ident by continuing early

12 years agobuild-sys: remove unneeded _SOURCES vars
Lucas De Marchi [Mon, 19 Dec 2011 20:07:37 +0000 (18:07 -0200)]
build-sys: remove unneeded _SOURCES vars

12 years agoelf: skip leading symbol dot in modversion.
Gustavo Sverzut Barbieri [Mon, 19 Dec 2011 23:53:24 +0000 (21:53 -0200)]
elf: skip leading symbol dot in modversion.

Mimics module-init-tools's dump_modversions() that calls skip_dot()
to skip leading dots. This is required for PPC64.

12 years agoelf: fix typo that resulted in invalid uint reads for big-endian platforms.
Gustavo Sverzut Barbieri [Mon, 19 Dec 2011 23:51:31 +0000 (21:51 -0200)]
elf: fix typo that resulted in invalid uint reads for big-endian platforms.

12 years agokmod-modinfo: -p (-F parm) shows also parmtype in Debian expected formatting.
Gustavo Sverzut Barbieri [Mon, 19 Dec 2011 20:31:15 +0000 (18:31 -0200)]
kmod-modinfo: -p (-F parm) shows also parmtype in Debian expected formatting.

debian expected formatting is:

    name:description (type)

variants:

    name:description
    name: (type)

12 years agoelf: do not output empty strings.
Gustavo Sverzut Barbieri [Mon, 19 Dec 2011 19:42:34 +0000 (17:42 -0200)]
elf: do not output empty strings.

12 years agokmod-modinfo: fix typo and output format.
Gustavo Sverzut Barbieri [Mon, 19 Dec 2011 19:41:09 +0000 (17:41 -0200)]
kmod-modinfo: fix typo and output format.

 * it's parm, not param (does not have the second 'a');
 * output format requires ':' after the name.

12 years agokmod-modinfo: add missing short options.
Gustavo Sverzut Barbieri [Mon, 19 Dec 2011 19:28:06 +0000 (17:28 -0200)]
kmod-modinfo: add missing short options.

Thanks to falconindy for testing.

12 years agoIntroduce kmod-modinfo.
Gustavo Sverzut Barbieri [Mon, 19 Dec 2011 16:48:07 +0000 (14:48 -0200)]
Introduce kmod-modinfo.

12 years agoelf: fix minimum file size calculation.
Gustavo Sverzut Barbieri [Mon, 19 Dec 2011 16:34:00 +0000 (14:34 -0200)]
elf: fix minimum file size calculation.

there is only a single file header, multiple sections.

12 years agokmod-modprobe: improve --help output.
Gustavo Sverzut Barbieri [Mon, 19 Dec 2011 15:02:15 +0000 (13:02 -0200)]
kmod-modprobe: improve --help output.

12 years agokmod-modprobe: implement --dump-modversions
Gustavo Sverzut Barbieri [Mon, 19 Dec 2011 14:45:22 +0000 (12:45 -0200)]
kmod-modprobe: implement --dump-modversions

12 years agoELF: initial support for modinfo and strip of modversions and vermagic.
Gustavo Sverzut Barbieri [Sun, 18 Dec 2011 03:25:06 +0000 (01:25 -0200)]
ELF: initial support for modinfo and strip of modversions and vermagic.

Needs testing, but should work.

12 years agoFix debug message formatting
Lucas De Marchi [Mon, 19 Dec 2011 16:36:23 +0000 (14:36 -0200)]
Fix debug message formatting

12 years agoTODO: add idea about single file with all compressed modules.
Gustavo Sverzut Barbieri [Mon, 19 Dec 2011 13:37:08 +0000 (11:37 -0200)]
TODO: add idea about single file with all compressed modules.

12 years agokmod_modprobe: properly handle install/remove commands
Lucas De Marchi [Mon, 19 Dec 2011 04:26:34 +0000 (02:26 -0200)]
kmod_modprobe: properly handle install/remove commands

Handle install/remove commands just like modprobe does. Test configure
file:

install installme echo "this is a install message"
remove  removeme echo "this is a remove message"

Tests:

$ ./tools/kmod-modprobe installme
this is a install message

$ ./tools/kmod-modprobe -r removeme
this is a remove message

$ ./tools/kmod-modprobe removeme
FATAL: Module removeme not found.

./tools/kmod-modprobe -r installme
FATAL: Module installme not found.

12 years agokmod_modprobe: fix handling of remove commands
Lucas De Marchi [Mon, 19 Dec 2011 04:18:14 +0000 (02:18 -0200)]
kmod_modprobe: fix handling of remove commands

The check for remove/install commands must be before the ignore_loaded
check because we will actually run something instead of
removing/inserting a module and the modname might not correspond to a
real module. Otherwise a fake module like "remove removeme echo 'bla'"
would not work.

This also keeps compatibility with modprobe.

12 years agoFix wrong name len when converting path to modname
Lucas De Marchi [Sun, 18 Dec 2011 17:12:19 +0000 (15:12 -0200)]
Fix wrong name len when converting path to modname

12 years agoFix leak of kmod_module
Lucas De Marchi [Sun, 18 Dec 2011 03:35:30 +0000 (01:35 -0200)]
Fix leak of kmod_module

12 years agocompatibility: match commands using fnmatch() instead of strcmp().
Gustavo Sverzut Barbieri [Sat, 17 Dec 2011 00:43:04 +0000 (22:43 -0200)]
compatibility: match commands using fnmatch() instead of strcmp().

module-init-tools modprobe.c use fnmatch() and not strcmp() to match
commands and softdeps, although the man page does not say so. Then use
the same function to provide compatibility.

12 years agokmod-modprobe: implement softdeps.
Gustavo Sverzut Barbieri [Sat, 17 Dec 2011 00:35:28 +0000 (22:35 -0200)]
kmod-modprobe: implement softdeps.

Implement soft dependencies in a way similar to module-init-tools
modprobe. Unlike regular dependencies they are allowed to fail
inserting or removing.

The rmmod version walks the lists in reverse order, also doing post
before and pre later.

12 years agointroduce kmod_list_foreach_reverse().
Gustavo Sverzut Barbieri [Sat, 17 Dec 2011 00:33:08 +0000 (22:33 -0200)]
introduce kmod_list_foreach_reverse().

walks the list in the reverse order.

12 years agoUse tab instead of spaces
Lucas De Marchi [Sat, 17 Dec 2011 22:03:13 +0000 (20:03 -0200)]
Use tab instead of spaces

12 years agointroduce kmod_list_last()
Gustavo Sverzut Barbieri [Sat, 17 Dec 2011 00:32:33 +0000 (22:32 -0200)]
introduce kmod_list_last()

This gets the last element in the list, that is, the previous element
of the head.

12 years agofix kmod_list_prev().
Gustavo Sverzut Barbieri [Sat, 17 Dec 2011 00:27:02 +0000 (22:27 -0200)]
fix kmod_list_prev().

kmod_list_prev() should return NULL if the current element is the
head, not if the previous element is the head. This was likely a copy
& paste error from kmod_list_next().

12 years agoimplement softdeps.
Gustavo Sverzut Barbieri [Fri, 16 Dec 2011 23:18:10 +0000 (21:18 -0200)]
implement softdeps.

12 years agofix error handling path.
Gustavo Sverzut Barbieri [Fri, 16 Dec 2011 18:17:50 +0000 (16:17 -0200)]
fix error handling path.

12 years agoimplement zlib module loading.
Gustavo Sverzut Barbieri [Fri, 16 Dec 2011 18:08:53 +0000 (16:08 -0200)]
implement zlib module loading.

12 years agoLookup for commands in kmod_module_new_from_lookup()
Lucas De Marchi [Fri, 16 Dec 2011 05:57:12 +0000 (03:57 -0200)]
Lookup for commands in kmod_module_new_from_lookup()

Install and remove commands are now properly treated on lookup. Example
config file:

$ ./test/test-lookup installme
libkmod version 1
Alias: 'installme'
Modules matching:
installme
install commands: 'echo "this is a install message"'

$ ./test/test-lookup removeme
libkmod version 1
Alias: 'removeme'
Modules matching:
removeme
remove commands: 'echo "this is a remove message"'

12 years agokmod_module: do not find more than the first command
Lucas De Marchi [Fri, 16 Dec 2011 05:33:26 +0000 (03:33 -0200)]
kmod_module: do not find more than the first command

modprobe from module-init-tools does not use more than one
install/remove command, it just stops on the first one. Test
modprobe.conf:

install bla echo "this is a message"
install bla echo "this is a message"

$ modprobe bla
this is a message
$

Install and remove commands are already a legacy thing we need to carry,
but let's not extend it so people do not start doing crazy things.

With this patch we are breaking on the first element we find in the
configuration. May be we can add a warning later when parsing the config
that install commands are duplicated.

12 years agoOpen more file descriptors with O_CLOEXEC
Cristian Rodríguez [Fri, 16 Dec 2011 17:46:52 +0000 (14:46 -0300)]
Open more file descriptors with O_CLOEXEC

12 years agoLibrary must use O_CLOEXEC whenever it opens file descriptors
Cristian Rodríguez [Fri, 16 Dec 2011 05:49:54 +0000 (02:49 -0300)]
Library must use O_CLOEXEC whenever it opens file descriptors

12 years agoAdd address of mailing list
Lucas De Marchi [Fri, 16 Dec 2011 06:11:25 +0000 (04:11 -0200)]
Add address of mailing list

12 years agotools: fix kmod-modprobe -R trying to insert module
Lucas De Marchi [Fri, 16 Dec 2011 04:58:48 +0000 (02:58 -0200)]
tools: fix kmod-modprobe -R trying to insert module

12 years agoTODO: add new tasks and notes to future development
Lucas De Marchi [Fri, 16 Dec 2011 04:02:58 +0000 (02:02 -0200)]
TODO: add new tasks and notes to future development

12 years agotrivial: fix typo causing an infinite loop
Ulisses Furquim [Thu, 15 Dec 2011 21:17:49 +0000 (19:17 -0200)]
trivial: fix typo causing an infinite loop

12 years agokmod 1 v1
Lucas De Marchi [Thu, 15 Dec 2011 17:43:58 +0000 (15:43 -0200)]
kmod 1

12 years agoAdd libkmod files to EXTRA_DIST
Lucas De Marchi [Thu, 15 Dec 2011 17:37:41 +0000 (15:37 -0200)]
Add libkmod files to EXTRA_DIST

12 years agoRemove module from hash when it's gone
Lucas De Marchi [Thu, 15 Dec 2011 15:43:22 +0000 (13:43 -0200)]
Remove module from hash when it's gone

Module was never being removed from hash table. Therefore, if we create
a module, unref it and create it again we will access freed memory.
Commit "53385cf Improve test of double references" introduced a new test
in test-mod-double-ref.c that previously to this commit was crashing and
now it's working fine.

12 years agoImprove test of double references
Lucas De Marchi [Thu, 15 Dec 2011 15:42:54 +0000 (13:42 -0200)]
Improve test of double references

12 years agoAdd safety NULL checks in exported functions
Lucas De Marchi [Thu, 15 Dec 2011 15:35:40 +0000 (13:35 -0200)]
Add safety NULL checks in exported functions

12 years agoFix changing hash key after module is inserted in hash
Lucas De Marchi [Thu, 15 Dec 2011 15:11:51 +0000 (13:11 -0200)]
Fix changing hash key after module is inserted in hash

The hash key is not copied so we can't change the string from:
modname/modalias

to:

modname'\0'modalias

in order to setup mod->name and mod->alias.

Now what we do is:

1) if name is in the form 'modname/modalias', the final struct
   kmod_module will be:

   struct kmod_module {
           char *alias;------,
           char *name;-----, |
           char *hashkey;--|-|-,
   }                       | | |
   name <------------------' | |
   alias <-------------------' |
   hashkey <-------------------'

2) if name is in the simple form 'modname', then the final struct
   kmod_module will be:

   struct kmod_module {
           char *alias;------> NULL
           char *name;-----,
           char *hashkey;--|---,
   }                       |   |
   name <------------------*---'

12 years agoFix docs with wrong function names
Lucas De Marchi [Thu, 15 Dec 2011 15:09:46 +0000 (13:09 -0200)]
Fix docs with wrong function names

12 years agoAdd comment in public header about flags not implemented
Lucas De Marchi [Thu, 15 Dec 2011 14:27:45 +0000 (12:27 -0200)]
Add comment in public header about flags not implemented

12 years agoRename symbol group
Lucas De Marchi [Thu, 15 Dec 2011 14:26:15 +0000 (12:26 -0200)]
Rename symbol group

12 years agoRemove flags that likely will not be used
Lucas De Marchi [Thu, 15 Dec 2011 14:15:31 +0000 (12:15 -0200)]
Remove flags that likely will not be used

12 years agoTODO: rephrase some tasks
Lucas De Marchi [Thu, 15 Dec 2011 14:14:43 +0000 (12:14 -0200)]
TODO: rephrase some tasks