Commit Graph

5 Commits

Author SHA1 Message Date
Eugene Syromiatnikov 5240efc112 modalias.prov: stricter module aliase/version mangling
* modalias.prov: Replace everyithing that is not "0-9a-zA-Z.:"
in a kernel module version with underscores;  replace everything
that is not "][0-9a-zA-Z.:*_?/-" in a kernel module alias with
underscores.

Resolves: #2002887
Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
2021-11-18 14:50:11 +01:00
Eugene Syromiatnikov c07c7ceda8 modalias.prov: change interpreter to /bin/bash -efu
* modalias.prov: Chnge interpreter from "/bin/sh" to "/bin/bash" because
it uses bashisms;  add "-efu" flags to keep things in check; initialise
is_kernel_package variable; check for presence of /sbin/modinfo, sed,
and sort.
(combine_modaliases): Initialise the "variants" and "pos" variables.

Resolves: #2002887
Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
2021-11-18 14:50:11 +01:00
Eugene Syromiatnikov bebabb191d Add zstd kmod compression support
* brp-kmod-restore-perms: Add chech for "$RPM_BUILD_ROOT/$path.zst".
* find-provides.ksyms: Add "\.zst" to the kernel module path matching
regular expression; process kernel module with zstd if its file name
ends with "zst".
* find-requires.ksyms: Likewise.
* firmware.prov: Add "\.zst" to the kernel module path matching
regular expression.
* kmodtool (%post, %preun): Likewise.
* modalias.prov: Likewise.
* modalias.attr (%__modalias_path): Add "ko\.zst" to the kernel module
path matching regular expression.
* provided_ksyms.attr (%__provided_ksyms_path): Likewise.
* required_ksyms.attr (%__required_ksyms_path): Likewise.
* kmod.attr (%__kmod_path): Add ".*\.ko\.zst" to the kernel module path
matching regular expression.
(strip_compress_sfx): Strip "\.zst" suffix, if present.

Resolves: #1942537
Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
2021-11-18 14:50:11 +01:00
Eugene Syromiatnikov 116fb03e8a modalias.prov: process compressed kmods
* modalias.prov: Add "(\.gz|\.bz2|\.xz)?" to the end of the module path
matching regular expression, use "$@" instead of $*.

Resolves: #1942537
Resolves: #2024117
Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
2021-11-18 14:22:00 +01:00
Michal Domonkos 2625834549 Adopt kernel-rpm-macros from redhat-rpm-config
No changes are being made to the individual files added here; they're
1:1 copies of the ones in redhat-rpm-config.

Note the kernel-rpm-macros version - the latest c9s build is versioned
after its parent SRPM which is redhat-rpm-config-184-1, so we need to
make this one NVR-newer to allow for clean upgrades.

The respective removals from redhat-rpm-config are tracked in #1959924.

Resolves: #1959914
2021-05-13 17:52:56 +02:00