kernel/selinux-testsuite: fix kernel pkg name detection

The directory may also be owned by <name>-modules-core rather than
<name>-core in some cases. Use the "config" file as the reference
instead.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
This commit is contained in:
Ondrej Mosnacek 2024-02-14 15:34:22 +01:00
commit 3e8824e0aa
No known key found for this signature in database
GPG key ID: BDE08B7A0C57B343

View file

@ -122,7 +122,7 @@ rlJournalStart
# Determine the base kernel package name and version corresponding
# to the currently running kernel. Use this information to derive
# the correct kernel subpackages to install.
if KERNEL_CORE_NVRA="$(rpm -qf "/lib/modules/$(uname -r)")"; then
if KERNEL_CORE_NVRA="$(rpm -qf "/lib/modules/$(uname -r)/config")"; then
KERNEL_CORE_NV="${KERNEL_CORE_NVRA%-*}"
KERNEL_CORE_N="${KERNEL_CORE_NV%-*}"