libkmod: Clean up all dependencies on error path

If kmod_module_parse_depline runs out of memory, it is possible
that not all dependency modules are unlinked.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/211
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
1 file changed
tree: 4caa796be1db0798c2cb11ecb1333e284b2e24b8
  1. .github/
  2. libkmod/
  3. m4/
  4. man/
  5. scripts/
  6. shared/
  7. shell-completion/
  8. testsuite/
  9. tools/
  10. .clang-format
  11. .codespellignore
  12. .editorconfig
  13. .gitignore
  14. .mailmap
  15. autogen.sh
  16. build-dev.ini
  17. CODING-STYLE
  18. configure.ac
  19. CONTRIBUTING.md
  20. COPYING
  21. DCO.txt
  22. Makefile.am
  23. meson.build
  24. meson_options.txt
  25. NEWS
  26. README.md
README.md

kmod - Linux kernel module handling

OVERVIEW

kmod is a set of tools to handle common tasks with Linux kernel modules like insert, remove, list, check properties, resolve dependencies and aliases.

These tools are designed on top of libkmod, a library that is shipped with kmod. See libkmod/README for more details on this library and how to use it. The aim is to be compatible with tools, configurations and indexes from module-init-tools project.

Links

Compilation and installation

In order to compile the source code you need the following software packages:

  • GCC/CLANG compiler
  • GNU C library / musl / uClibc

Optional dependencies:

  • ZLIB library
  • LZMA library
  • ZSTD library
  • OPENSSL library (signature handling in modinfo)

Typical configuration and installation

meson setup builddir/
meson compile -C builddir/
sudo meson install -C builddir/

Alternatively you can try autotools build. NOTE: The autotools build is slated for removal with kmod v35

./configure CFLAGS="-g -O2" --prefix=/usr \
            --sysconfdir=/etc --libdir=/usr/lib

Configure automatically searches for all required components and packages.

To compile and install run:

make && make install

Hacking

When working on kmod, use the included build-dev.ini file, as:

meson setup --native-file build-dev.ini builddir/

Make sure to read our contributing guide and the other READMEs: libkmod and testsuite.

Compatibility with module-init-tools

kmod replaced module-init-tools, which was EOL'ed in 2011. All the tools were rewritten on top of libkmod and they can be used as drop in replacements. Along the years there were a few behavior changes and new features implemented, following feedback from Linux kernel community and distros.