[Lunar] UBUNTU: [Packaging] Fix module-check error when modules are compressed

Masahiro Yamada masahiro.yamada at canonical.com
Thu Jan 12 13:55:35 UTC 2023


On Thu, Jan 12, 2023 at 10:47 PM Masahiro Yamada
<masahiro.yamada at canonical.com> wrote:
>
> Some parts in the packaging scripts are written based on the assumption
> that module file names always end with the .ko suffix.
>
> The module suffix might be .ko.gz, .ko.xz, or .ko.zst if module
> compression is enabled.
>
> If CONFIG_MODULE_COMPRESS_GZIP/XZ/ZSTD is enabled, the module-check
> fails with a lot of "MISS" because currently only files with *.ko
> suffix are picked up.
>
> Ubuntu kernels do not enable module compression by default, but users
> may tweak CONFIG options when they build their custom kernel.
>
> Modules are compressed in some distributions, for example in Fedora,
> modules are *.ko.xz.
>
> Signed-off-by: Masahiro Yamada <masahiro.yamada at canonical.com>
> ---


There are more places that only take care of *.ko suffix.

If this is worth the effort, I will look into the scripts
for consistency fix.




>  debian/rules.d/2-binary-arch.mk | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
> index 365656ea6272b..08b07ceba2347 100644
> --- a/debian/rules.d/2-binary-arch.mk
> +++ b/debian/rules.d/2-binary-arch.mk
> @@ -477,8 +477,8 @@ endif
>                 $(builddir)/build-$*/Module.symvers | sort > $(abidir)/$*
>
>         # Build the final ABI modules information.
> -       find $(pkgdir_bin) $(pkgdir) $(pkgdir_ex) -name \*.ko | \
> -               sed -e 's/.*\/\([^\/]*\)\.ko/\1/' | sort > $(abidir)/$*.modules
> +       find $(pkgdir_bin) $(pkgdir) $(pkgdir_ex) \( -name '*.ko' -o -name '*.ko.*' \) | \
> +               sed -e 's/.*\/\([^\/]*\)\.ko.*/\1/' | sort > $(abidir)/$*.modules
>
>         # Build the final ABI built-in modules information.
>         if [ -f $(pkgdir)/lib/modules/$(abi_release)-$*/modules.builtin ] ; then \
> --
> 2.34.1
>



More information about the kernel-team mailing list