Red Hat Bugzilla – Bug 842175
Building certain kernel modules fails with the error Illegal char '['
Last modified: 2015-03-10 09:26:56 EDT
Created attachment 599636 [details]
Replace brackets in the value of modver in modalias.prov with acceptable char
Description of problem:
Attempt to build kmod-aacraid fails with the following error:
Processing files: kmod-aacraid-1.1.7-4.el6.elrepo.x86_64
Finding Provides: /usr/lib/rpm/redhat/find-provides
error: line 86: Illegal char '[' in: - Initial el6 build of the kmod package.
The error does not occur if redhat-rom-config is downgraded to an earlier version (e.g. 9.0.3-34.el6).
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Build the aacraid kernel module using redhat-rpm-config-9.0.3-39.el6
Build succeeds without an error
This error occurs if the module version contains the "[" or "]" chararacter. In this case,
$ modinfo aacraid | grep ^version
I compared redhat-rpm-config between -39 and -34 and found the source of the issue to be this change:
+ chmod +x $(DESTDIR)/usr/lib/rpm/redhat/find-provides.d/modalias.prov
When the permission bits were changed back to 644, the error did not happen.
A workaround is to replace the "[" and "]" in modver with some acceptable char. For example:
modver=$(/sbin/modinfo -F version "$module"| head -n1 | tr "\[\]" "__" )
A patch file has been attached.
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.
I can not reproduce your bug.
Can you attach your srpm ? Then I can check it.
You can get the srpm from ELRepo:
This one produces the error:
error: line 92: Illegal char '[' in: - Initial el6 build of the kmod package.
(In reply to Akemi Yagi from comment #6)
> Hi Weiping,
> You can get the srpm from ELRepo:
> This one produces the error:
> error: line 92: Illegal char '[' in: - Initial el6 build of the kmod package.
Hi, Akemi Yagi,
Yes I can reproduce your bug now.
The root cause is that rpmbuild think "[" and "]" are illegal character in the version.
I will attach a simple spec, and if you add "[" or "]" in Version, it can not be built.
Yes your patch for /usr/lib/rpm/redhat/find-provides.d/modalias.prov is good.
But how about just chaning AAC_DRIVER_FULL_VERSION in your source file ?
I will attach another patch, too.
So there are two methods to fix this problem now.
1 replace "[" and "]" in AAC_DRIVER_FULL_VERSION in the source file
2 modify modalias.prov and replace "[" and "]" with maybe "_"
Any ideas which one is better or do you have other methods ?
Created attachment 789497 [details]
rpmbuild think "[" and "]" are illegal in version field
rpmbuild think "[" and "]" are illegal in version field.
Created attachment 789498 [details]
fix aacraid version
patch to fix aacraid version.
(In reply to Weiping Pan from comment #7)
> So there are two methods to fix this problem now.
> 1 replace "[" and "]" in AAC_DRIVER_FULL_VERSION in the source file
> 2 modify modalias.prov and replace "[" and "]" with maybe "_"
> Any ideas which one is better or do you have other methods ?
I think that your number 2 is a preferred solution. Modifying modalias.prov is a universal solution whereas patching the source is good only for that particular package. If/when other manufacturers choose to use "[" or "]", they'd have to be fixed too. Your solution 2 is "fix once and for all".
(In reply to Akemi Yagi from comment #10)
> (In reply to Weiping Pan from comment #7)
> > So there are two methods to fix this problem now.
> > 1 replace "[" and "]" in AAC_DRIVER_FULL_VERSION in the source file
> > 2 modify modalias.prov and replace "[" and "]" with maybe "_"
> > Any ideas which one is better or do you have other methods ?
> Hi Weiping,
> I think that your number 2 is a preferred solution. Modifying modalias.prov
> is a universal solution whereas patching the source is good only for that
> particular package. If/when other manufacturers choose to use "[" or "]",
> they'd have to be fixed too. Your solution 2 is "fix once and for all".
Ok, then let me implemet in the second method.
Can you give QA ACK for this bug ?
(In reply to Weiping Pan from comment #12)
> Hi, Chun,
> Can you give QA ACK for this bug ?
> Weiping Pan
Reassign to BaseOS QE for reviewing of redhat-rpm-config package.
I thought this bug fix was already in QA. If it is indeed necessary to file a request through the support channel, I can do it.
I am sorry that for RHEL6.5, redhat-rpm-config is not on ACL, then we can not modify this package, so this bug has not been fixed for RHEL6.5.
And since it is RHEL6.5 snap5 now, it is very late to try to fix it, how about deferring it to RHEL6.6 ?
If you do want this bug to be fixed in RHEL6.5 and have strong reason,
I will ask my manager and PM evaluate your request.
Because this is not an urgent matter, I suppose we can wait for RHEL6.6.
Please help me set rhel 6.6 flag if you want to fix this bug in rhel 6.6.
This bug exists in RHEL 7.0 as well. Could you please apply the patch there?
Can you cork a patch to modify the driver version in upstream ?
In my opinion, it is odd to have such a version format, and it does not deserve the efforts to fix it in redhat-rpm-config package.
According to the upstream driver page at:
their version is :
I don't see the '[' character upstream. So, I suspect it was introduced to RHEL at some point.
Therefore, an appropriate fix seems to be either 1) to update the RH version to 1.2.1-30300 or 2) fix redhat-rpm-config.
65 #ifdef AAC_DRIVER_BUILD
66 #define _str(x) #x
67 #define str(x) _str(x)
68 #define AAC_DRIVER_FULL_VERSION AAC_DRIVER_VERSION "[" str(AAC_DRIVER_BUILD) "]" AAC_DRIVER_BRANCH
70 #define AAC_DRIVER_FULL_VERSION AAC_DRIVER_VERSION AAC_DRIVER_BRANCH
Line 68 introduces the illegal character "[" and "]",
and REHL version is the same as upstream version.
So in my opinion, when you build this kmod, can you cork a patch like in comment 9, fix the version ?
I think it does not deserve the efforts to fix it in redhat-rpm-config.
Thank you for your note.
Well, if patching redhat-rpm-config does not seem to justify the effort involved, we can give it up. But updating the driver to the current version might be worthwhile (and it fixes the current problem). Guess that is for another day ...
I recommend that you can cork a patch to fix the version problem in upstream,
then next time when you request a driver sync, our developer will pick up this fix into RHEL.
Assigned to ffesti by mistake, assigning back to wpan.