RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1271199 - bad variable usage in kmodtool usage
Summary: bad variable usage in kmodtool usage
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: redhat-rpm-config
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Florian Festi
QA Contact: Karel Srot
URL:
Whiteboard:
Depends On:
Blocks: 1289025
TreeView+ depends on / blocked
 
Reported: 2015-10-13 11:23 UTC by Levente Farkas
Modified: 2016-07-27 06:14 UTC (History)
1 user (show)

Fixed In Version: redhat-rpm-config-9.1.0-69.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-26 11:34:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Levente Farkas 2015-10-13 11:23:10 UTC
in redhat-rpm-config-9.1.0-kmod-kabi.patch there is a bug in line 375 there is a bug:
rpm -ql kmod-${kmod_name}${dashvariant}-%{kmod_version}-%{kmod_release}.$(arch) | grep '\.ko$' > /var/run/rpm-kmod-${kmod_name}${dashvariant}-modules

the variables
%{kmod_version}-%{kmod_release}
should have to be 
${kmod_version}-${kmod_release}

since it's not run in the spec file itself but during the post install phase. so otherwise you've got such an error:

error: ^%{kmod_version}$: regcomp failed: Invalid content of \{\}
error: %preun(kmod-stretch-7.14.0-1.el7.viduxos.x86_64) scriptlet failed, exit status 1
error: kmod-stretch-7.14.0-1.el7.viduxos.x86_64: erase failed

Comment 5 Karel Srot 2016-07-08 10:46:20 UTC
I am not skilled in building kernel modules but to my understanding the output of kmodtool is supposed to be part of the global spec file. Assuming that, I would expect that %{kmod_version} and %{kmod_release} macros would be defined earlier in that spec file.

If this is true, then kmod-testmodule-%{kmod_version}-%{kmod_release} is properly expanded during the package build.

There is also additional code in the kmodtool:

    if [ ! -z "$kmod_version" ]; then
        echo "Version: %{kmod_version}"
    fi

    if [ ! -z "$kmod_release" ]; then
        echo "Release: %{kmod_release}"
    fi

This code also implies that those two macros are expected to be defined earlier within the global spec file.

The proposed fix replaces these macros with shell variables but expects that these variables are defined outside of the script. But from the kmodtool script I assume that such variables are supposed to work only as switches (on/off) for adding the respective SPEC content, not to store particular value.
Similarly to
    if [ -z "$kmod_provides_group" ]; then
        echo "Group:            System Environment/Kernel"
    fi
where kmod_provides_group is also not defined in the script at all.

So to summarize it, I believe that this report should be closed as NOTABUG and we should rollback the applied patch.

Comment 6 Levente Farkas 2016-07-09 08:48:19 UTC
not it's a bug! in the spec file it should have to be % but it's a kmodtool shell script which inherit variables from the spec file so it'd have to be $. just as used a few lines above where it's wrong.

but anyway it's very easy to try! just let's make a try and you'll see it.
if you like i can send a spec file.

Comment 7 Karel Srot 2016-07-09 19:45:05 UTC
Hi Levente,

these two macros are supposed to be defined earlier in the SPEC file via %kernel_module_package macro call (or you need to define them explicitly) and therefore they are properly expanded during the SPEC file processing. Actually, I just found bug 653170 from 2011 which explains that in #c8.

Comment 8 Florian Festi 2016-07-26 11:34:00 UTC
Removed the fix from the current package. Closing as NOTABUG.


Note You need to log in before you can comment on or make changes to this bug.