package/kmod: add compression support for the host variant
authorYann E. MORIN <yann.morin.1998@free.fr>
Sun, 3 May 2020 13:10:01 +0000 (15:10 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Tue, 6 Oct 2020 19:45:37 +0000 (21:45 +0200)
The kernel may install compressed modules. At the end of the build, we
then run depmod, to generate modules.dep and a few assorted files, so
that loading modules works properly on the target (loading by alias,
loading dependencies...)

However, depmod needs support for compressed modules, or it would
generate empty modules.dep et al.

Uconditionally adding support for gz and xz, and the required deps,
was deemed too much of a burden [0], so we add options to enable
either or both compression.

[0] http://lists.busybox.net/pipermail/buildroot/2018-April/218410.html

Yegor Yefremov <yegorslists@googlemail.com>
Cc: Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Lucian Buga <lucianbuga@gmail.com>
Tested-by: Matt Weber <matthew.weber@rockwellcollins.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/kmod/Config.in.host
package/kmod/kmod.mk

index ea99a790f691ecd3d062773417cff51eb174e536..9dbbcea78209ff01fbe07b90481ca2d6ae07a0fe 100644 (file)
@@ -4,3 +4,13 @@ config BR2_PACKAGE_HOST_KMOD
          kmod is a set of tools to handle common tasks with Linux
          kernel modules like insert, remove, list, check properties,
          resolve dependencies and aliases.
+
+if BR2_PACKAGE_HOST_KMOD
+
+config BR2_PACKAGE_HOST_KMOD_GZ
+       bool "support gzip-compressed modules"
+
+config BR2_PACKAGE_HOST_KMOD_XZ
+       bool "support xz-compressed modules"
+
+endif
index b27447192cb72f0536866e4f3f3a706e92a46bea..69615452cfb12e0d5f134858b0e6ae136f45c64c 100644 (file)
@@ -82,6 +82,20 @@ else
 KMOD_CONF_OPTS += --disable-tools
 endif
 
+ifeq ($(BR2_PACKAGE_HOST_KMOD_GZ),y)
+HOST_KMOD_DEPENDENCIES += host-zlib
+HOST_KMOD_CONF_OPTS += --with-zlib
+else
+HOST_KMOD_CONF_OPTS += --without-zlib
+endif
+
+ifeq ($(BR2_PACKAGE_HOST_KMOD_XZ),y)
+HOST_KMOD_DEPENDENCIES += host-xz
+HOST_KMOD_CONF_OPTS += --with-xz
+else
+HOST_KMOD_CONF_OPTS += --without-xz
+endif
+
 # We only install depmod, since that's the only tool used for the
 # host.
 define HOST_KMOD_INSTALL_TOOLS