Commit Graph

885 Commits

Author SHA1 Message Date
Lucas De Marchi 113d0084d4 testsuite: trap calls to mkdir 2012-06-05 00:54:47 -03:00
Lucas De Marchi 0de690c96c testsuite: check if rootfs dir is dirty before running
Keep around a stamp-rootfs file that is generated together with the
rootfs. testsuite checks each test directory if its mtime is greater
than stamp's mtime, deciding if rootfs should be re-generated.
2012-06-05 00:54:47 -03:00
Lucas De Marchi ada9719942 testsuite: separate insert and delete rootfs from modinfo 2012-06-05 00:54:47 -03:00
Lucas De Marchi e46bca009d libkmod-util: add missing stdbool.h include 2012-06-05 00:54:47 -03:00
Lucas De Marchi e2ee7d9b7a testsuite: rename rootfs dir 2012-06-05 00:54:47 -03:00
Lucas De Marchi 851ee75c19 build-sys: provide --sysconfdir to make distcheck flags
test-blacklist is accessing the wrong location in make distcheck, making
the test to fail. Fix is by providing --sysconfdir=/etc in configure
flags.
2012-06-05 00:54:46 -03:00
Lucas De Marchi 90fc410b32 testsuite: fix find_module() finding wrong module 2012-06-05 00:54:39 -03:00
Lucas De Marchi 9e2eadb1d7 Silence clang warnings with __unused__ attribute
I hate this kind of READV and WRITEV macros that Gustavo seems to love.
clang-analyzer hates them as well.

I'm not motivated enough to refactor this, but I want a clean clang
report, so just shut it up.
2012-05-23 20:31:18 -03:00
Lucas De Marchi a70c1e774e Don't use __ for attribute defines
System headers use __, don't mess with them.
2012-05-23 20:27:23 -03:00
Lucas De Marchi 5bbec8cdcb libkmod-index: use generic function for unaligned access 2012-05-23 19:32:58 -03:00
Josh Boyer 7ef9f30c91 doc: Don't reference /etc/modprobe.conf
kmod doesn't read /etc/modprobe.conf at all, so don't mention it in the
modprobe man page.  Point users to modprobe.d(5) instead.
2012-05-23 18:03:35 -03:00
Lucas De Marchi af9080d9f9 libkmod-hash: use generic function for unaligned access 2012-05-21 20:43:39 -03:00
Lucas De Marchi a6b67f90c3 libkmod-util: copy macros for unaligned access from BlueZ 2012-05-21 20:22:12 -03:00
Mike Frysinger d30319e433 libkmod: move function to the only file using it
If we don't have --gc-sections support, linking kmod fails:
libkmod/.libs/libkmod-util.a(libkmod-util.o): In function 'underscores':
libkmod/libkmod-util.c:117: undefined reference to 'kmod_log'

This is because libkmod-util.la uses kmod_log(), that is in libkmod.la.
Move the function so we don't have a dependency loop while building the
libraries and it works with compilers with no support for --gc-sections.
2012-05-15 19:30:05 -03:00
Dan McGee c88aec70d1 test-conversion: convert test-get-dependencies to new infrastructure
The test uses the ext4 module dependencies as the testcase, checking
both the number and the names of the returned modules.
2012-05-11 08:44:55 -03:00
Dan McGee bcca1b95d2 test-conversion: convert test-blacklist to new infrastructure
Add a modprobe.conf with some blacklist entries in a test rootfs, and
then ensure our blacklist function actually cuts out the two listed
entries (and doesn't cut out the others).
2012-05-11 08:44:55 -03:00
Lucas De Marchi 452c1dde2f build-sys: copy rootfs to another directory
We can't use the rootfs directory because it breaks out-of-tree build
and in future we want to make modifications to the fake filesystem such
as adding and removing files.

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

Fix 'make distcheck'
2012-05-11 02:23:34 -03:00
Lucas De Marchi 9c41596ecc build-sys: distribute testsuite
Fix 'make dist'
2012-05-11 01:21:46 -03:00
Dan McGee cdbcc2481c testsuite: ship testsuite/rootfs unzipped
The current configuration is dumb in any number of ways:
1) If the rationale was for space savings, it works the opposite- the
   git repo gets more bloated because we are adding binary compressed
   blobs that share little in common with their parent, and anyone that
   wants to run the test suite has to unzip it anyway.
2) It is a pain in the butt to add new tests, and not accidentally lose
   any new rootfs you built in the directory.
3) `git status` won't help you if you are tweaking files in the rootfs
   and don't know they have been changed, or if some test did that and
   you couldn't detect it.
4) `git log` won't help you find out what is changing in the rootfs test
   directory itself when changes are made to the binary blob, such as
   new files being added or even existing files being tweaked.
5) The files just aren't that big anyway- 2.7MB unzipped.
2012-05-11 01:03:17 -03:00
Lucas De Marchi 96253751ae build: remove private symbol from linker script
There's no reason kmod_log should be exported, remove it from linker
script. This doesn't break the API/ABI because we are luck: since the
function had visibility=hidden it was not getting exported as a global
symbol.
2012-05-10 21:11:27 -03:00
Lucas De Marchi 719282889a Revert "libkmod: make sure to export kmod_log"
This reverts commit 88a170dbd6.

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

The bug that this patch fixed needs to be fixed another way, not
exporting this function.
2012-05-10 20:58:46 -03:00
Dave Reisner 819f79a24d depmod: report failures in loading symbols
Previously, depmod would relegate failures of kmod_module_get_symbols()
to debug output, assuming the "error" was simply a lack of symbols.
Leave the ENOENT return to debug output, but report anything else as a
real error.
2012-05-08 10:22:14 -03:00
Dave Reisner c7d5a60d3d libkmod-file: gracefully handle errors from zlib
zlib won't necessarily set the system errno, and this is particularly
evident on corrupted data (which results in a double free). Use zlib's
gzerror to detect the failure, returning a generic EINVAL when zlib
doesn't provide us with an errno.
2012-05-08 10:22:13 -03:00
Lucas De Marchi 4321590770 Remove dead increment 2012-04-26 11:42:27 -03:00
Lucas De Marchi 20c6e18c37 Return error instead of always 0 2012-04-26 11:40:26 -03:00
Lucas De Marchi 18a492e6f7 Remove dead assignment 2012-04-26 11:39:54 -03:00
Mike Frysinger 88a170dbd6 libkmod: make sure to export kmod_log
If we don't have --gc-sections support, linking kmod fails:
libkmod/.libs/libkmod-util.a(libkmod-util.o): In function 'underscores':
libkmod/libkmod-util.c:117: undefined reference to 'kmod_log'

This is because kmod_log is missing the export define, even though it's
already listed in the exported symbol list.
2012-04-23 10:40:04 -03:00
Lucas De Marchi 46684bc2d9 kmod 8 2012-04-19 11:21:00 -03:00
Lucas De Marchi 883d8c42c7 doc: remove links to NULL going nowhere 2012-04-19 11:08:24 -03:00
Lucas De Marchi 9461893cf1 TODO: add item to implement actions in kmod 2012-04-16 20:21:45 -03:00
Dave Reisner ccb64d1ead modprobe: handle -ENOENT return from init_module
init_module returns -ENOENT when the module failed to load because of a
bad parameter or unknown symbol. Throw a more descriptive error message
than the generic "No such file or directory" to alert the user.

Fixes Debian bug 668216.
2012-04-16 10:37:32 -04:00
Kay Sievers 471a7d0089 doc: silent man page generation and fix gtk-doc warnings 2012-04-15 18:10:10 -03:00
Elan Ruusamäe 02629fa02e modprobe: fix typo in config dump: option->options
kmod uses "option MODNAME", not "options MODNAME"

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

This breaks scripts that depend in modprobe -c output grepping
2012-03-22 12:00:16 -03:00
Lucas De Marchi 314719c581 README: note that there are more files to read 2012-03-21 22:26:03 -03:00
Lucas De Marchi 8885ced062 kmod 7 2012-03-19 08:23:14 -03:00
Lucas De Marchi e48f37657d build-sys: don't set CFLAGS and LDFLAGS
These variables are supposed to be set by user. What we can do in
configure is to set another variable and AC_SUBST() it. Then in
Makefile.am we assign it to AM_{CFLAGS,LDFLAGS}. This way user can
always override their values, in configure or make phase.

Reference: http://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html
2012-03-19 01:17:05 -03:00
Lucas De Marchi 3ef7208ecf build-sys: re-organize configure.ac 2012-03-17 11:07:10 -03:00
Randy Witt 1701b1b46f configure.ac: Move link only flags out of CFLAGS and into LDFLAGS.
On the ARM gcc 4.2.2 I'm using I get many
"--as-needed: linker input file unused because linking not done"
style errors when libtool is using compile mode.

In order to silence these warnings and be "correct", the flags that
only make sense for linking were moved into LDFLAGS.
2012-03-17 03:34:08 -03:00
Randy Witt 00ff57663d Add CC_CHECK_LDFLAGS_APPEND m4 macro.
This is mostly just preparation for the next patch. But this macro is
used for flags that are only needed during linking but that don't
make sense for normal compilation.

I saw this exact type of patch online for systemd, but it never seems to
have actually been incorporated into their attributes.m4.
2012-03-17 03:34:08 -03:00
Lucas De Marchi 436da1e96e config: use order /etc, /run, /lib
This matches the change in systemd and udev. Log message on udev's
change by Kay Sievers:

	After long consideration we came to the conclusion that user
	configuration in /etc should always override the (generally
	computer generated) configuration in /run. User configuration
	should always be what matters over anything else. Hence rearrange
	the search orders accordingly. In general this should change
	very little as overriding like this is seldomn done so far,
	and the order between /etc and /usr stays the same.
2012-03-15 09:19:34 -03:00
Lucas De Marchi ae7ebe8770 modprobe: set log prio to 0 if user passed -q arg 2012-03-15 01:16:54 -03:00
Lucas De Marchi 23ea575014 Merge branch 'master' of git://code.falconindy.com/kmod 2012-03-15 00:31:22 -03:00
Lucas De Marchi c1b84540bb modprobe: always try to remove all modules in command line 2012-03-15 00:27:18 -03:00
Lucas De Marchi 4744ebcef4 modprobe: don't check if module builtin to decide if it's builtin
More or less confusing message, but if module is builtin in the live
system, it doesn't mean it's builtin in the target kernel.

Instead we now check if module has a path. It don't have a path only if
it's builtin in the target or if it doesn't exist at all. The latter
should not be a problem since this code is being called from inside the
library. Anyway, put an assert to make sure we get bug reports if any
case slipped in here.
2012-03-15 00:14:35 -03:00
Dave Reisner f758caf57c modprobe: fix error path in removing modules
We really haven't paid this code much attention, and it's somewhat
evident in our divergence in behavior from module-init-tools. This patch
asserts the following behavior on exit:

* modprobe -r realmod_notloaded => exit zero
* modprobe -r --first-time realmod_notloaded => exit non-zero
* modprobe -r bogusmod => exit non-zero
2012-03-14 22:26:30 -04:00
Lucas De Marchi 26906fe73e kmod 6 2012-03-02 22:34:36 -03:00
Lucas De Marchi 49c6489d74 Use upper case after Deprecated in doc 2012-03-02 22:28:38 -03:00
Lucas De Marchi 6204d5b123 Add kmod_module_apply_filter() to doc-sections file 2012-03-02 22:18:33 -03:00
Lucas De Marchi bfcd31def9 Fix wrong printf format string
This fixes build in 32 bits machines.
2012-03-02 21:28:11 -03:00
Lucas De Marchi 2e2e252bd4 libkmod-index: do not pre-populate mmap
If we tell mmap to populate all the indexes and they are big, this will
impact load time. Let them be mapped as they are used.
2012-03-02 20:33:26 -03:00