platform/upstream/kmod.git
12 years agoAdd missing static const
Lucas De Marchi [Wed, 4 Jan 2012 10:00:45 +0000 (08:00 -0200)]
Add missing static const

12 years agokmod-depmod: fix replacement of existing modules.
Gustavo Sverzut Barbieri [Tue, 3 Jan 2012 18:14:57 +0000 (16:14 -0200)]
kmod-depmod: fix replacement of existing modules.

We cannot create a kmod_module for existing module name, it will fail
due existing in the hash table "modules_by_name".

To avoid it, we first delete the existing module, if lower priority,
then add the new one.

kmod_module_new_from_path() is called only when the former module was
deleted or does not exist.

12 years agokmod-depmod: fix comparison of module priority.
Gustavo Sverzut Barbieri [Tue, 3 Jan 2012 18:03:06 +0000 (16:03 -0200)]
kmod-depmod: fix comparison of module priority.

This code was never tested, my bad!

 * the prefix should be ignored, as it is not stored in cfg_search/override.

 * baselen should not include '/'.

 * search length should not include '\0'.

 * override path should not include cfg->dirname prefix.

12 years agoutils/array: add array_remove_at()
Gustavo Sverzut Barbieri [Tue, 3 Jan 2012 17:58:24 +0000 (15:58 -0200)]
utils/array: add array_remove_at()

remove array element at given position, will be used by depmod.

12 years agokmod-depmod: fix incorrect math finding out end of dirname.
Gustavo Sverzut Barbieri [Tue, 3 Jan 2012 17:11:58 +0000 (15:11 -0200)]
kmod-depmod: fix incorrect math finding out end of dirname.

12 years agokmod-depmod: document --config/-C in help output.
Gustavo Sverzut Barbieri [Tue, 3 Jan 2012 17:06:08 +0000 (15:06 -0200)]
kmod-depmod: document --config/-C in help output.

12 years agokmod-depmod: add missing trailing \n to log messages.
Gustavo Sverzut Barbieri [Tue, 3 Jan 2012 17:04:34 +0000 (15:04 -0200)]
kmod-depmod: add missing trailing \n to log messages.

12 years agoelf: zero *array when count is zero.
Gustavo Sverzut Barbieri [Tue, 3 Jan 2012 16:53:15 +0000 (14:53 -0200)]
elf: zero *array when count is zero.

12 years agolibkmod-file: refactor code to avoid ifdef mess.
Gustavo Sverzut Barbieri [Tue, 3 Jan 2012 16:25:49 +0000 (14:25 -0200)]
libkmod-file: refactor code to avoid ifdef mess.

Refactor code to use pointer to functions, avoiding the previous

Now comp_types defines a magic header to be checked (size and bytes),
with the associated load() and unload() operations. If a header
matches, their operations are used. Otherwise the regular file
operations (mmap/munmap) are used.

File descriptor close is managed by the common code if it's valid
(>=0). If some code steals the file descriptor (eg: gzopen), then they
must change file->fd to -1.

This way the code should be easier to extend and avoid bugs.

12 years agoutils/read_str_safe(): fix wrong behavior and bugs.
Gustavo Sverzut Barbieri [Tue, 3 Jan 2012 16:22:05 +0000 (14:22 -0200)]
utils/read_str_safe(): fix wrong behavior and bugs.

ouch, I did a mess in the original function, fix them:

 * on errors (read() < 0), continue reading after the done bytes, not
   at position 0.

 * read buflen - 1 bytes, so there is always room to store the
   trailing \0, as expected by user due behavior of snprintf(),
   fgets() and others.

12 years agoTODO: add task for providing man page
Lucas De Marchi [Sat, 31 Dec 2011 21:41:05 +0000 (19:41 -0200)]
TODO: add task for providing man page

12 years agoAdd test to check kmod_validate_resources
Lucas De Marchi [Sat, 31 Dec 2011 21:29:13 +0000 (19:29 -0200)]
Add test to check kmod_validate_resources

12 years agoAdd call to check if resources are valid
Lucas De Marchi [Sat, 31 Dec 2011 21:28:31 +0000 (19:28 -0200)]
Add call to check if resources are valid

12 years agoindex: save timestamp of each loaded index
Lucas De Marchi [Sat, 31 Dec 2011 20:53:24 +0000 (18:53 -0200)]
index: save timestamp of each loaded index

12 years agoconfig: save list of config paths with their timestamps
Lucas De Marchi [Sat, 31 Dec 2011 20:48:05 +0000 (18:48 -0200)]
config: save list of config paths with their timestamps

Save a list of config paths with their timestamps so they can be checked
later.

12 years agoutil: add helper function to compare timestamps
Lucas De Marchi [Sat, 31 Dec 2011 14:28:54 +0000 (12:28 -0200)]
util: add helper function to compare timestamps

12 years agokmod-modprobe: mimic modprobe when removing deps with usecount=0
Lucas De Marchi [Sun, 1 Jan 2012 08:07:46 +0000 (06:07 -0200)]
kmod-modprobe: mimic modprobe when removing deps with usecount=0

12 years agoFix leak of kmod_module and fix code style
Lucas De Marchi [Sun, 1 Jan 2012 07:55:25 +0000 (05:55 -0200)]
Fix leak of kmod_module and fix code style

12 years agoTODO: add list of things that are different on kmod
Lucas De Marchi [Sun, 1 Jan 2012 07:47:17 +0000 (05:47 -0200)]
TODO: add list of things that are different on kmod

12 years agokmodprobe: post-remove module deps with 0 refcnt
Dave Reisner [Sat, 31 Dec 2011 23:02:45 +0000 (18:02 -0500)]
kmodprobe: post-remove module deps with 0 refcnt

12 years agomodprobe: use lighter access call instead of stat
Dave Reisner [Sat, 31 Dec 2011 23:02:30 +0000 (18:02 -0500)]
modprobe: use lighter access call instead of stat

12 years agomodprobe: remove --list option
Dave Reisner [Sat, 31 Dec 2011 21:51:40 +0000 (16:51 -0500)]
modprobe: remove --list option

This was marked as deprecated in m-i-t's modprobe in favor of find and
basename.

12 years agolibkmod-config: remove warning for skipped config files
Dave Reisner [Sat, 31 Dec 2011 16:19:55 +0000 (11:19 -0500)]
libkmod-config: remove warning for skipped config files

conf_files_filter_out() already skips these files, but writes to the log
to warn that they'll be ignored in the future.

12 years agoUse last enum value instead of ARRAY_SIZE
Lucas De Marchi [Sat, 31 Dec 2011 15:01:55 +0000 (13:01 -0200)]
Use last enum value instead of ARRAY_SIZE

12 years agoDo not call exported function for mod->name
Lucas De Marchi [Sat, 31 Dec 2011 13:21:52 +0000 (11:21 -0200)]
Do not call exported function for mod->name

Name is always available and we don't neet to call a exported function
to get it.

12 years agoMove function to the right place
Lucas De Marchi [Sat, 31 Dec 2011 13:15:52 +0000 (11:15 -0200)]
Move function to the right place

12 years agoIgnore "already loaded" error in module_probe_insert_module()
Lucas De Marchi [Fri, 30 Dec 2011 16:15:40 +0000 (14:15 -0200)]
Ignore "already loaded" error in module_probe_insert_module()

It also fixes a leak in the error path.

12 years agoUse errno instead of return value of init_module()
Lucas De Marchi [Fri, 30 Dec 2011 16:13:33 +0000 (14:13 -0200)]
Use errno instead of return value of init_module()

Return -errno instead of the value returned by init_module(). We need to
differentiate between the several errors that might occur, e.g. "module
already loaded", access denied, etc.

12 years agolibkmod-util: getline_wrapped: return NULL when buffer allocation fails
Leandro Pereira [Wed, 28 Dec 2011 16:44:35 +0000 (14:44 -0200)]
libkmod-util: getline_wrapped: return NULL when buffer allocation fails

12 years agoDo not forget parenthesis around if (streq(A, B)).
Leandro Pereira [Wed, 28 Dec 2011 17:01:16 +0000 (15:01 -0200)]
Do not forget parenthesis around if (streq(A, B)).

12 years agoMove libkmod-util.c to convenience util lib
Lucas De Marchi [Wed, 28 Dec 2011 15:33:26 +0000 (13:33 -0200)]
Move libkmod-util.c to convenience util lib

Share more code between tools and libkmod. underscores() in kmod-depmod
can not use the same function as in the lib, so rename it.

12 years agoMove array implementation from depmode to libkmod-util
Lucas De Marchi [Wed, 28 Dec 2011 14:53:37 +0000 (12:53 -0200)]
Move array implementation from depmode to libkmod-util

12 years agotools: kmod: bundle depmod together with the others
Lucas De Marchi [Tue, 27 Dec 2011 21:56:33 +0000 (19:56 -0200)]
tools: kmod: bundle depmod together with the others

12 years agoFix header guard
Lucas De Marchi [Tue, 27 Dec 2011 21:53:38 +0000 (19:53 -0200)]
Fix header guard

12 years agokmod tool: don't keep iterating when command has been executed
Leandro Pereira [Tue, 27 Dec 2011 20:22:30 +0000 (18:22 -0200)]
kmod tool: don't keep iterating when command has been executed

12 years agoMove util functions to libkmod-util.c
Lucas De Marchi [Tue, 27 Dec 2011 16:38:26 +0000 (14:38 -0200)]
Move util functions to libkmod-util.c

These allow them to be later shared with tools.

12 years agokmod-depmod: use hash implementation from util lib
Lucas De Marchi [Tue, 27 Dec 2011 15:27:42 +0000 (13:27 -0200)]
kmod-depmod: use hash implementation from util lib

12 years agohash: add iterator
Lucas De Marchi [Tue, 27 Dec 2011 15:27:01 +0000 (13:27 -0200)]
hash: add iterator

12 years agobuild-sys: create libkmod-util.la convenience lib
Lucas De Marchi [Tue, 27 Dec 2011 14:26:51 +0000 (12:26 -0200)]
build-sys: create libkmod-util.la convenience lib

Util functions can be shared betweeing libkmod and tools. Start with the
hash implementation.

12 years agoCopy missing hash functions from kmod-depmod to libkmod
Lucas De Marchi [Tue, 27 Dec 2011 14:20:35 +0000 (12:20 -0200)]
Copy missing hash functions from kmod-depmod to libkmod

12 years agoRemove kmod_ prefix from hash implementation
Lucas De Marchi [Tue, 27 Dec 2011 14:13:54 +0000 (12:13 -0200)]
Remove kmod_ prefix from hash implementation

In a future commit, hash implementation will be shared between libkmod
and depmod. kmod_hash is not exported, so remove the namespace.

12 years agoLog paths if kmod_module_new_from_path() failed
Lucas De Marchi [Tue, 27 Dec 2011 20:10:19 +0000 (18:10 -0200)]
Log paths if kmod_module_new_from_path() failed

12 years agoTODO: format and add task
Lucas De Marchi [Tue, 27 Dec 2011 19:32:55 +0000 (17:32 -0200)]
TODO: format and add task

12 years agokmod-depmod: Fix leak of dependency vector
Lucas De Marchi [Tue, 27 Dec 2011 16:18:32 +0000 (14:18 -0200)]
kmod-depmod: Fix leak of dependency vector

12 years agokmod-depmod: refactor extension matching array, support XZ.
Gustavo Sverzut Barbieri [Mon, 26 Dec 2011 15:19:07 +0000 (13:19 -0200)]
kmod-depmod: refactor extension matching array, support XZ.

move the extensions array match to global, conditionally add GZ and XZ
if the support is enabled.

12 years agokmod-depmod: implement -A (--quick)
Gustavo Sverzut Barbieri [Sat, 24 Dec 2011 13:16:40 +0000 (11:16 -0200)]
kmod-depmod: implement -A (--quick)

12 years agokmod-depmod: implement -F and -E options.
Gustavo Sverzut Barbieri [Sat, 24 Dec 2011 12:31:55 +0000 (10:31 -0200)]
kmod-depmod: implement -F and -E options.

Read System.map and Module.symvers from kernel built, then be able to
report unknown symbols.

12 years agoupdate TODO
Gustavo Sverzut Barbieri [Sat, 24 Dec 2011 03:45:23 +0000 (01:45 -0200)]
update TODO

depmod was done, and without map support

12 years agokmod-depmod: dump modules.dep.bin
Gustavo Sverzut Barbieri [Sat, 24 Dec 2011 01:21:48 +0000 (23:21 -0200)]
kmod-depmod: dump modules.dep.bin

12 years agokmod-depmod: dump modules.alias.bin
Gustavo Sverzut Barbieri [Sat, 24 Dec 2011 01:21:09 +0000 (23:21 -0200)]
kmod-depmod: dump modules.alias.bin

12 years agokmod-depmod: dump modules.symbols.bin
Gustavo Sverzut Barbieri [Sat, 24 Dec 2011 01:20:44 +0000 (23:20 -0200)]
kmod-depmod: dump modules.symbols.bin

12 years agokmod-depmod: dump modules.builtin.bin
Gustavo Sverzut Barbieri [Sat, 24 Dec 2011 01:19:22 +0000 (23:19 -0200)]
kmod-depmod: dump modules.builtin.bin

12 years agokmod-depmod: add utility functions to be used by binary dumps.
Gustavo Sverzut Barbieri [Sat, 24 Dec 2011 01:16:20 +0000 (23:16 -0200)]
kmod-depmod: add utility functions to be used by binary dumps.

Binary dumps will use functions to convert alias to underscores and
paths to module names.

12 years agokmod-depmod: copy code from module-init-tools/index.c
Gustavo Sverzut Barbieri [Sat, 24 Dec 2011 01:11:41 +0000 (23:11 -0200)]
kmod-depmod: copy code from module-init-tools/index.c

Copy code from module-init-tools/index.c, the following copyright applies:

    Copyright (C) 2008  Alan Jenkins <alan-jenkins@tuffmail.co.uk>.

12 years agokmod-depmod: dump deps.
Gustavo Sverzut Barbieri [Fri, 23 Dec 2011 22:53:16 +0000 (20:53 -0200)]
kmod-depmod: dump deps.

12 years agokmod-depmod: dump aliases
Gustavo Sverzut Barbieri [Fri, 23 Dec 2011 03:43:01 +0000 (01:43 -0200)]
kmod-depmod: dump aliases

12 years agokmod-depmod: dump softdeps.
Gustavo Sverzut Barbieri [Fri, 23 Dec 2011 03:37:07 +0000 (01:37 -0200)]
kmod-depmod: dump softdeps.

12 years agokmod-depmod: dump modules.symbols
Gustavo Sverzut Barbieri [Fri, 23 Dec 2011 03:27:28 +0000 (01:27 -0200)]
kmod-depmod: dump modules.symbols

note that the hash algorithm is different thus the output order will
be different as well.

to compare the outputs, sort the files:

   depmod -n | grep '^alias symbol:' | sort > /tmp/orig
   kmod-depmod -n | grep '^alias symbol:' | sort > /tmp/new
   diff /tmp/orig /tmp/new

12 years agokmod-depmod: dump devname
Gustavo Sverzut Barbieri [Fri, 23 Dec 2011 02:55:33 +0000 (00:55 -0200)]
kmod-depmod: dump devname

first try to dump files: modules.devname.

12 years agokmod-depmod: initial code (no files generated, untested)
Gustavo Sverzut Barbieri [Thu, 22 Dec 2011 22:23:11 +0000 (20:23 -0200)]
kmod-depmod: initial code (no files generated, untested)

this is the initial code for depmod, it should:
 * use configuration from /run/depmod.d, /etc/depmod.d, /lib/depmod.d
 * respect overrides and searches
 * resolve symbols and dependencies
 * break circular dependencies (dependency loops)
 * --errsyms: print out modules with unresolved symbols and incorrect crc
 * --symbol-prefix: respect architecture symbol prefix

it will not:
 * --quick: does not do quick mode
 * --warn: does not warn on duplicates
 * --filesyms: does not load symbols from map file
 * --symvers: does not load symbol versions from map file
 * dump files: does not dump any files at the moment.

it is highly untested, then I appreciate your help with real world
scenarios using overrides and searches. To get output run with -vvvvvv.

next version should fill in the gaps and at least generate the files

12 years agoAdd test for probe insert
Lucas De Marchi [Mon, 26 Dec 2011 18:06:50 +0000 (16:06 -0200)]
Add test for probe insert

12 years agoAdd implementation of modprobe's insertion
Lucas De Marchi [Tue, 27 Dec 2011 13:40:10 +0000 (11:40 -0200)]
Add implementation of modprobe's insertion

Treat module insertion as modprobe does: look for (soft-)dependencies, run
install commands, apply blacklist.

The difference with the blacklist is that it's applied to all modules,
including the dependencies. If you want to apply a blacklist only on the
module it's better to call the filter function by yourself.

This implementation detects loops caused by poorly written
soft-dependencies and fail gracefully, printing the loop to the log.

12 years agoDo not cache softdeps list
Lucas De Marchi [Tue, 27 Dec 2011 12:15:40 +0000 (10:15 -0200)]
Do not cache softdeps list

This might include a circular dependency which would screw up the
refcounting because there's an internal reference.

12 years agoAllow to internally get dependencies without copying list
Lucas De Marchi [Tue, 27 Dec 2011 06:51:05 +0000 (04:51 -0200)]
Allow to internally get dependencies without copying list

12 years agobuild-sys: remove unneeded _SOURCES var
Lucas De Marchi [Mon, 26 Dec 2011 15:53:32 +0000 (13:53 -0200)]
build-sys: remove unneeded _SOURCES var

12 years agoAdd functions to get ctx blacklists
Lucas De Marchi [Sat, 24 Dec 2011 12:50:47 +0000 (10:50 -0200)]
Add functions to get ctx blacklists

12 years agoFix kmod_list_remove_n_latest()
Lucas De Marchi [Tue, 27 Dec 2011 04:46:12 +0000 (02:46 -0200)]
Fix kmod_list_remove_n_latest()

It only worked because n was always 1. kmod_list_remove returns a
pointer to the next element, relative to the removed one. Therefore we
need to always get a pointer to the last.

12 years agoReverse order of dependency list
Lucas De Marchi [Mon, 26 Dec 2011 22:10:49 +0000 (20:10 -0200)]
Reverse order of dependency list

Dependency list in modules.dep is kept in reverse order. Prepend to
list so all the other places treat it in the right order.

12 years agoTODO: add task in modprobe's compatibility
Lucas De Marchi [Mon, 26 Dec 2011 18:05:19 +0000 (16:05 -0200)]
TODO: add task in modprobe's compatibility

12 years agoindex_file_open: fix another fd leak on error path.
Cristian Rodríguez [Mon, 26 Dec 2011 04:38:04 +0000 (01:38 -0300)]
index_file_open: fix another fd leak on error path.

12 years agoMerge branch 'master' of git://dev.medozas.de/libkmod
Lucas De Marchi [Sat, 24 Dec 2011 19:51:27 +0000 (17:51 -0200)]
Merge branch 'master' of git://dev.medozas.de/libkmod

12 years agoMerge branch 'master' of git://dev.medozas.de/libkmod
Lucas De Marchi [Sat, 24 Dec 2011 19:39:44 +0000 (17:39 -0200)]
Merge branch 'master' of git://dev.medozas.de/libkmod

12 years agolibkmod: remove external cflags from .pc file
Jan Engelhardt [Sat, 24 Dec 2011 19:28:11 +0000 (20:28 +0100)]
libkmod: remove external cflags from .pc file

Since the public header files of libkmod do not include header files
of liblzma or zlib, the flags need not be present.

12 years agoSupport for loading Xz-compressed modules
Jan Engelhardt [Sat, 24 Dec 2011 13:58:30 +0000 (14:58 +0100)]
Support for loading Xz-compressed modules

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 agoFix version script with v3 symbols
Lucas De Marchi [Sat, 24 Dec 2011 04:40:30 +0000 (02:40 -0200)]
Fix version script with v3 symbols

12 years agoelf: implement kmod_module_get_dependency_symbols()
Gustavo Sverzut Barbieri [Tue, 20 Dec 2011 13:54:53 +0000 (11:54 -0200)]
elf: implement kmod_module_get_dependency_symbols()

Uses kmod_elf_get_dependency_symbols() that looks into ".symtab" for
UNDEF symbols and matches the name from ".strtab" to "__versions" to
get crc.

Likely the public API should unify the symbol information getters and
list release, they are almost the same.

12 years agoelf: add bind type to kmod_modversion.
Gustavo Sverzut Barbieri [Tue, 20 Dec 2011 12:11:22 +0000 (10:11 -0200)]
elf: add bind type to kmod_modversion.

will be used to share this structure with get_dependency_symbols()

12 years agoadd test/test-elf
Gustavo Sverzut Barbieri [Mon, 19 Dec 2011 23:23:45 +0000 (21:23 -0200)]
add test/test-elf

will be focused on testing ELF operations and takes a filename to load
instead of looking for it in the system.

12 years agoelf: add get_symbols()
Gustavo Sverzut Barbieri [Mon, 19 Dec 2011 23:23:13 +0000 (21:23 -0200)]
elf: add get_symbols()

Similar to module-init-tools load_symbols(), it will try .symtab and
.strtab for symbols starting with __crc_, if they are found their crc
is read from ELF's Elf_Sym::st_value.

If not found, then it will fallback to __ksymtab_strings.

12 years agoelf: minimum size is enough.
Gustavo Sverzut Barbieri [Fri, 23 Dec 2011 04:33:20 +0000 (02:33 -0200)]
elf: minimum size is enough.

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=.