Commit Graph

1112 Commits

Author SHA1 Message Date
Caio Marcelo de Oliveira Filho
211e3840fc testsuite: add more input cases to freadline_wrapped test 2015-01-21 10:18:07 -02:00
Caio Marcelo de Oliveira Filho
22f602c3c5 testsuite: add test for growing then shrinking a hash 2015-01-21 10:17:27 -02:00
Caio Marcelo de Oliveira Filho
9c2d39c735 testsuite: add test for hash_add_unique 2015-01-21 10:15:40 -02:00
Lucas De Marchi
9c6084d90c testsuite: improve coverage of shared/util.h
Add tests to improve coverage of shared/util.h functions.
2015-01-14 17:26:36 -02:00
Lucas De Marchi
2d1f8bdec0 testsuite: improve assert report 2015-01-14 16:28:16 -02:00
Lucas De Marchi
5b0436a759 tools: prefer the use of streq() 2015-01-14 14:32:09 -02:00
Lucas De Marchi
5c42c5fced testsuite: prefer the use of streq() 2015-01-14 14:32:09 -02:00
Lucas De Marchi
9b51e13b84 testsuite: test kmod_module_remove_module for failure 2015-01-14 14:32:09 -02:00
Lucas De Marchi
bf2fbabb9e shared: add STRINGFY macro 2015-01-14 14:32:09 -02:00
Lucas De Marchi
af87874f9c testsuite: fix retcodes parsing
It was not saving _modules in modules and thus all check were falling in
the fallback "consider a success if module is not in the list". Also the
name check wasn't right: replace with streq().

The parsing could be better implemented, but this is left for later.
2015-01-14 14:25:02 -02:00
Lucas De Marchi
7db094c050 tools: kmod: use streq 2015-01-14 12:35:04 -02:00
Lucas De Marchi
5ca15057e3 CODING-STYLE: add include order 2015-01-14 12:35:04 -02:00
Caio Marcelo de Oliveira Filho
ace71985fc tools: kmod: break iteration once a command is executed 2015-01-14 12:24:31 -02:00
Lucas De Marchi
895aa13478 Update TODO 2015-01-14 11:10:53 -02:00
Lucas De Marchi
c78066aef1 testsuite: add test for array_pop() 2015-01-08 17:10:18 -02:00
Lucas De Marchi
e9b0d1b40e build-sys: integrate coverage report
Just pass --enable-coverage to configure and then "make coverage" to
have the coverage report at coverage dir.
2015-01-07 23:02:34 -02:00
Lucas De Marchi
8ff7f008cd testsuite: do not overrid paths inside build
If we are accessing a file inside the build directory we should really
not trap the path. Right now this isn't important because we never do
such accesses. However it will be needed when gcov is integrated because
it dumps files to the same place where the binaries are located.
2015-01-07 19:14:20 -02:00
Lucas De Marchi
84aaaedfa6 build-sys: rename cflags/ldflags variable
Not all of them are for warnings or gc.
2015-01-02 16:32:03 -02:00
Lucas De Marchi
b35bf2a11c Fix include in python bindings
Prefix the include of libkmod in python bindings.
2015-01-02 13:11:39 -02:00
Lucas De Marchi
0a67d4f360 libkmod-elf: Remove unused variables
libkmod/libkmod-elf.c:52:34: warning: unused variable 'native_endianess'
      [-Wunused-const-variable]
static const enum kmod_elf_class native_endianess = KMOD_ELF_LSB;
2015-01-02 12:47:00 -02:00
Lucas De Marchi
f357866d97 Fix includes after change to build-sys
Make the includes be libkmod/libkmod.h for code outside of library. This
fixes the broken build after 1315123 ('build-sys: Don't add libkmod
subdirectory to include path').
2015-01-02 12:41:01 -02:00
Lucas De Marchi
dea2dfee9b Remove FSF mailing address
It has changed in the past, and these days, anyone can get a copy of the
LGPL via the web rather than by post.

Like 657a122 (Remove FSF mailing address) in libabc by Josh Tripplet,
but let the FSF website in which the license can be found.
2014-12-25 23:41:34 -02:00
Lucas De Marchi
15cfa1d19c build-sys: set -e separately, rather than putting -e in the shebang line
Like a008d76 (autogen.sh: set -e separately, rather than putting -e in
the shebang line) in libabc by Josh Triplett.
2014-12-25 23:41:34 -02:00
Lucas De Marchi
dd66ff3a14 build-sys: Don't define LIBEXECDIR
Like b2fd181 (Makefile.am: Don't define LIBEXECDIR) in libabc by Josh
Triplett.
2014-12-25 23:41:34 -02:00
Lucas De Marchi
1315123955 build-sys: Don't add libkmod subdirectory to include path
Like 05437b8 (Makefile.am: Don't add abc subdirectory to include path)
in libabc by Josh Triplett.
2014-12-25 23:41:34 -02:00
Mike Auty
fd56638aed build: Do not force diagnostics-color flag
The -fdiagnostics-color flag is only available on GCC >= 4.9, for
older versions this could raise an error in certain circumstances
(such as when using ccache).  Instead, since -fdiagnostic-color=auto
by default  in gcc-4.9, simply set the required environment variable
to the default one if it's undefined.

Based mostly on the systemd commit f44541bc by Michal Schmidt.
2014-12-17 00:41:01 -02:00
Lucas De Marchi
1dd4ff56f6 README: move mailing list information to top
It seems people are missing the information about the mailing list, so
let's move it to the top in hope it's more visible.
2014-12-13 11:55:05 -02:00
Natanael Copa
efb5bfaca9 util: fix build on systems missing strndupa
we need include shared/missing.h to be able to compile on sysmtes that
lacks strndupa.
2014-11-17 13:00:19 -02:00
Lucas De Marchi
3b058610b4 NEWS: Fix typos 2014-11-16 10:37:45 -02:00
Lucas De Marchi
f9e2167b10 kmod 19 2014-11-16 10:24:50 -02:00
Lucas De Marchi
bb72153d34 libkmod-index: move comment to include the includes 2014-11-15 11:18:54 -02:00
Lucas De Marchi
a5852e3b36 libkmod-index: remove invalid comment 2014-11-15 11:18:54 -02:00
Lucas De Marchi
778395e4e8 depmod: point to documentation in libkmod
Instead of repeating all documentation, point to the documentation
available in libkmod-index.c

This also removes INDEX_PRIORITY_MIN that was not being used.
2014-11-15 11:18:46 -02:00
Lucas De Marchi
c4cbdf8e17 libkmod-index: keep index and comments in .c
Just like other source files, keep the index and comments in the source
file rather than the header.

This also removes INDEX_PRIORITY_MIN that was never being used.
2014-10-29 11:58:12 -02:00
Tom Gundersen
27eceb2e4e static-nodes: indicate that creation of static nodes should only happen at boot
udev will only manage static nodes that exist at the time udev is started, so
creating static nodes later on will likely not behave as expected. In
particular, recreating the static nodes at run-time will reset any permissions
udev may have applied to the nodes at boot.

See <https://bugzilla.redhat.com/show_bug.cgi?id=1147248> and the discussion
following <http://permalink.gmane.org/gmane.comp.sysutils.systemd.devel/23795>.

Note that this requires (the yet to be released) systemd v217 or a backport
of systemd patch 8c94052ee543c3598a3c7b0c46688150aa2c6168.
2014-10-28 16:49:46 -02:00
Lucas De Marchi
e62d8c725b strbuf: make strbuf_pushchars() a little less dumb
Do not push one char at a time. We have strlen() and memcpy() to rely
on.
2014-10-16 21:39:33 -03:00
Lucas De Marchi
8863154e44 strbuf: do not calculate next step in size on all calls
We only need to check if the new size is less or equal than the current
size. We don't really need to calculate the next step.
2014-10-16 21:22:32 -03:00
Lucas De Marchi
405b8927fe strbuf: reduce default buffer size
Using 2048 as buffer sizer for strbuf is a bit exaggerated. strbuf is
used much more when we are not using mmapped indexes, but it's used for
mmapped when for example searching for an alias. A quick and dirty hack
to output the size of our strbufs is to print buf->used inside
strbuf_str(). Doing this and creating some statistics with:

while read xxx alias xxx; do
    tools/modprobe -R "$alias" > /dev/null;
done < /lib/modules/$(uname -r)/modules.alias 2>&1 | \
	     Rscript -e 'summary (as.numeric (readLines ("stdin")))'

   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's
   1.00   29.00   31.00   31.55   38.00   92.00      26

So, reduce the step to 128, which is still greater than the maximum in
these cases. In the worst case this can only create a few calls to
realloc(), while keeping the memory footprint low for the common cases.
2014-10-16 21:02:13 -03:00
Lucas De Marchi
48e4d18191 testsuite: add tests for strbuf 2014-10-13 18:42:01 -03:00
Lucas De Marchi
15a7ae30b3 shared: rename prefixes of strbuf functions
Use strbuf_ prefix instead of buf_.
2014-10-11 13:25:51 -03:00
Lucas De Marchi
b4d1f44af1 Move strbuf implementation to shared/
Just move the strbuf-like implementation to shared/. No renames were
made yet to avoid cluttering the diff. It will come in a separate patch.
2014-10-11 13:09:42 -03:00
Lucas De Marchi
4328982058 testsuite: remove now unused array of tests
Remove the arrays and let each test with a guaranteed unique name.
2014-10-09 14:29:04 -03:00
Lucas De Marchi
c5798fea93 testsuite: use a section to put tests in instead of array
Intead of having to declare an array of tests, tweak the definition of
DEFINE_TEST and TESTSUITE_MAIN so they know the tests are put in a
particular section of the ELF file.

This avoids the mistake of adding a test and forgetting to add it to the
array. Now once a test is defined, it's ready to run, so one less step
to define new tests.

The removal of the arrays is left for another patch so not to clutter
the diff on this one.
2014-10-09 14:17:24 -03:00
Lucas De Marchi
f1155c1574 Move static keyword to DEFINE_TEST macro 2014-10-09 13:00:30 -03:00
Lucas De Marchi
eb6f9112cf libkmod: remove unused inline functions
libkmod/libkmod-list.c:39:33: warning: unused function 'list_node_next' [-Wunused-function]
static inline struct list_node *list_node_next(const struct list_node *node)
                                ^
libkmod/libkmod-list.c:47:33: warning: unused function 'list_node_prev' [-Wunused-function]
static inline struct list_node *list_node_prev(const struct list_node *node)
                                ^

It doesn't really matter in the end result since the compiler won't
generate any code for it. But let's keep it clean. It wasn't needed
until now, so probably it won't be anymore.
2014-10-09 11:11:29 -03:00
Lucas De Marchi
9a437531af Change parameter from int to char
It's a char not an int.
2014-10-09 11:03:29 -03:00
Lucas De Marchi
52c9c99056 Log error on failed underscores(), moving it to shared/
Move underscores() to shared/. It's the same as alias_normalize(), but
it rather operates in place, with the same string being passed.

The difference now that it's in shared/ is that it's a non-logging
function.

This makes us a little bit more verbose: we don't accept partially
correct module and aliases names in kcmdline and in configuration files.
We log an error instead.
2014-10-09 11:00:21 -03:00
Lucas De Marchi
2c5bc218be build-sys: rename libkmod-util convenience library
Now that all source code from libkmod-util has been moved to shared/
directory, rename also the convenience library to libshared.
2014-10-09 01:26:39 -03:00
Lucas De Marchi
f4e8c16291 Move remaining functions from libkmod-util to shared 2014-10-09 01:26:39 -03:00
Lucas De Marchi
3753ae16f5 depmod: use alias_normalize() from shared
Remove underscores2() function which is essentially the same as
alias_normalize() and the latter, which is now in shared/.
2014-10-09 01:26:39 -03:00