diff mbox series

[3/3,v2] package/lmod: add compression support for the host variant

Message ID d66d07fe82ae1c515eb9a010f1df2cbcc10f1a87.1588511382.git.yann.morin.1998@free.fr
State New
Headers show
Series [1/3,v2] package/kmod: explicitly disable compression when not enabled | expand

Commit Message

Yann E. MORIN May 3, 2020, 1:10 p.m. UTC
The kernel may install compressed modules. At the end of the buid, we
then run depmod, to generate modules.dep and a few assorted files, so
that loadign 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.

Systematically adding support for gz and xz, and the required deps, was
deemed too much of a burden [0], so we add too 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>

---
Changes v1 -> v2:
  - make compression support optional  (Thomas)
---
 package/kmod/Config.in.host | 10 ++++++++++
 package/kmod/kmod.mk        | 14 ++++++++++++++
 2 files changed, 24 insertions(+)

Comments

Matthew Weber May 15, 2020, 12:30 a.m. UTC | #1
Yann,



On Sun, May 3, 2020 at 8:14 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> The kernel may install compressed modules. At the end of the buid, we
> then run depmod, to generate modules.dep and a few assorted files, so
> that loadign 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.
>
> Systematically adding support for gz and xz, and the required deps, was
> deemed too much of a burden [0], so we add too 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>
Matthew Weber May 15, 2020, 11:41 a.m. UTC | #2
Yann,

On Sun, May 3, 2020 at 8:14 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> The kernel may install compressed modules. At the end of the buid, we
buid -> build
> then run depmod, to generate modules.dep and a few assorted files, so
> that loadign modules works properly on the target (loading by alias,
loading -> loading

> loading dependencies...)
>
> However, depmod needs support for compressed modules, or it would
> generate empty modules.dep et al.
>
> Systematically adding support for gz and xz, and the required deps, was
> deemed too much of a burden [0], so we add too 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>
>
> ---
> Changes v1 -> v2:
>   - make compression support optional  (Thomas)
> ---
>  package/kmod/Config.in.host | 10 ++++++++++
>  package/kmod/kmod.mk        | 14 ++++++++++++++
>  2 files changed, 24 insertions(+)
>
> diff --git a/package/kmod/Config.in.host b/package/kmod/Config.in.host
> index ea99a790f6..810fac3156 100644
> --- a/package/kmod/Config.in.host
> +++ b/package/kmod/Config.in.host
> @@ -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-compresed modules"

gzip-compresed ->  gzip-compressed

> +
> +config BR2_PACKAGE_HOST_KMOD_XZ
> +       bool "support xz-compresed modules"

xz-compresed -> xz-compressed

-Matt
diff mbox series

Patch

diff --git a/package/kmod/Config.in.host b/package/kmod/Config.in.host
index ea99a790f6..810fac3156 100644
--- a/package/kmod/Config.in.host
+++ b/package/kmod/Config.in.host
@@ -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-compresed modules"
+
+config BR2_PACKAGE_HOST_KMOD_XZ
+	bool "support xz-compresed modules"
+
+endif
diff --git a/package/kmod/kmod.mk b/package/kmod/kmod.mk
index cdbfc5a469..979c3e87e6 100644
--- a/package/kmod/kmod.mk
+++ b/package/kmod/kmod.mk
@@ -75,6 +75,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