Commit Graph

392 Commits

Author SHA1 Message Date
Jan Engelhardt
7b3a74fc67 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.)
2011-12-24 20:25:21 +01:00
Lucas De Marchi
3af4f558da Fix version script with v3 symbols 2011-12-24 02:40:30 -02:00
Gustavo Sverzut Barbieri
674f8590e3 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.
2011-12-24 01:44:31 -02:00
Gustavo Sverzut Barbieri
4b55befd37 elf: add bind type to kmod_modversion.
will be used to share this structure with get_dependency_symbols()
2011-12-24 01:44:31 -02:00
Gustavo Sverzut Barbieri
f85ae0d598 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.
2011-12-24 01:44:31 -02:00
Gustavo Sverzut Barbieri
45e6db9c01 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.
2011-12-24 01:44:31 -02:00
Gustavo Sverzut Barbieri
9bbb72df05 elf: minimum size is enough. 2011-12-24 01:24:55 -02:00
Gustavo Sverzut Barbieri
bb417099e4 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().
2011-12-24 01:15:25 -02:00
Lucas De Marchi
cfb908bf66 build-sys: use AS_IF 2011-12-23 12:03:19 -02:00
Lucas De Marchi
9b966da87e tools: kmod: show wrong command in err message 2011-12-23 11:44:28 -02:00
Lucas De Marchi
a458e36738 tools: kmod: print help message when no commands given 2011-12-23 11:35:48 -02:00
Lucas De Marchi
252c51a996 tools: kmod: add list command
It's the same of lsmod since there's not much to change on its format.
2011-12-23 11:33:02 -02:00
Lucas De Marchi
fa29c0ee96 tools: kmod: Add handling of compat modprobe 2011-12-23 03:09:05 -02:00
Lucas De Marchi
769becb5db tools: kmod: Add handling of compat modinfo 2011-12-23 03:09:05 -02:00
Lucas De Marchi
ad6026965f tools: kmod: Add handling of compat insmod 2011-12-23 03:09:05 -02:00
Lucas De Marchi
f712ebc429 tools: kmod: Add handling of compat rmmod 2011-12-23 03:09:05 -02:00
Lucas De Marchi
6fcf69e62b tools: kmod: Add handling of compat lsmod 2011-12-23 03:09:05 -02:00
Lucas De Marchi
35a29aa519 tools: kmod: check progname for handling compat commands 2011-12-23 03:09:05 -02:00
Cristian Rodríguez
67d94ad388 Fix leak on error path 2011-12-23 03:08:57 -02:00
Lucas De Marchi
bc85432aa3 tools: kmod: Add global options 2011-12-23 03:03:23 -02:00
Lucas De Marchi
8900b9166b 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
2011-12-23 03:01:58 -02:00
Lucas De Marchi
6a4fa8d8f1 build-sys: use MKDIR_P 2011-12-23 01:59:31 -02:00
Lucas De Marchi
3e8de63d2d kmod_modprobe: use basename(argv[0]) in help message 2011-12-23 01:36:27 -02:00
Gustavo Sverzut Barbieri
5f9f58f9f6 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.
2011-12-23 01:25:21 -02:00
Kay Sievers
e79bf83b06 introduce --with-rootlibdir=DIR
Support the installation of the shared library in the rootfs --rootlibdir=,
while the development symlink stays in --libdir=.
2011-12-22 19:08:04 -02:00
Lucas De Marchi
759214fad0 Initialize line number with 0 2011-12-22 01:30:40 -02:00
Lucas De Marchi
c72f79b465 Remove useless warning causing trouble in sparc64
-Wcast-align is not that useful and just generates lots of warnings in
architectures like sparc64.
2011-12-21 20:10:43 -02:00
Gustavo Sverzut Barbieri
c6824b62f2 Fix unaligned memory access
Bug found on sparc64. Thanks to "Jan Engelhardt <jengelh@medozas.de>"
for providing access to such a machine.
2011-12-21 18:37:46 -02:00
Kay Sievers
9faa7b376c 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
2011-12-21 11:50:04 -02:00
Lucas De Marchi
205c24e636 gitignore: ignore dist files 2011-12-21 11:44:25 -02:00
Lucas De Marchi
acc18b1451 kmod 2 2011-12-20 23:48:46 -02:00
Lucas De Marchi
f304afe153 Change error message to reflect reality 2011-12-20 23:48:27 -02:00
Lucas De Marchi
142db570bf Update doc to reflect function behavior 2011-12-20 23:39:30 -02:00
Luis Felipe Strano Moraes
9efaf2f627 Testing for return of alias_normalize. 2011-12-20 23:23:55 -02:00
Lucas De Marchi
7ea6eddda2 build-sys: do not use some compile flags by default 2011-12-20 19:45:59 -02:00
Lucas De Marchi
f39dc70e4b Removing comments saying flags are not implemented
Both removal and insertion flags are already implemented.
2011-12-20 19:31:14 -02:00
Lucas De Marchi
5e50464548 Move symbols introduced in libkmod2 to the right place 2011-12-20 17:16:24 -02:00
Lucas De Marchi
9ce0966197 build-sys: remove remaining _SOURCES var 2011-12-20 16:57:11 -02:00
Lucas De Marchi
0c5fad937a build-sys: default to "" as rootprefix 2011-12-20 16:52:21 -02:00
Lucas De Marchi
2c96693eb2 kmod_modprobe: fix description of -C flag 2011-12-20 16:39:59 -02:00
Gustavo Sverzut Barbieri
1e482783ad configure: disable static zlib build.
It was not being done correctly, disable until we find a way for
libtool to cooperate.
2011-12-20 16:33:26 -02:00
Kay Sievers
a308abec37 introduce --with-rootprefix=DIR
Configure the location of the rootfs directories and use it
to find (/usr)/lib/modules and (/usr)/lib/modprobe.d.
2011-12-20 16:22:07 -02:00
Lucas De Marchi
7fe5f7abce 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).
2011-12-20 16:08:18 -02:00
Jan Engelhardt
a597c8bbf5 build: use dist-xz
It's 2011 already.
2011-12-20 13:48:44 -02:00
Jan Engelhardt
2689912b56 gitignore: only ignore build system files in the top directory 2011-12-20 13:48:44 -02:00
Jan Engelhardt
87beacc99f libkmod: use C99 __func__ over GNU-specific __FUNCTION__ 2011-12-20 13:48:44 -02:00
Lucas De Marchi
135bffd652 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"
2011-12-20 13:25:24 -02:00
Luis Felipe Strano Moraes
a969376fb0 Removing warnings when compiling on i686 platform. 2011-12-20 13:15:32 -02:00
Gustavo Sverzut Barbieri
b55df2ee03 kmod_module_new_*: improve debugging. 2011-12-20 13:13:41 -02:00
Lucas De Marchi
95dd837daf 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.
2011-12-20 13:11:33 -02:00