Bug 842175

Summary: Building certain kernel modules fails with the error Illegal char '['
Product: Red Hat Enterprise Linux 6 Reporter: Akemi Yagi <toracat>
Component: redhat-rpm-configAssignee: Minfei Huang <mhuang>
Status: CLOSED UPSTREAM QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.3CC: ajb, ccui, gedwards, jcm, lkardos, pasteur, phil, ruyang, salmy, toracat
Target Milestone: rc   
Target Release: 6.5   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-10 13:26:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Replace brackets in the value of modver in modalias.prov with acceptable char
none
rpmbuild think "[" and "]" are illegal in version field
none
fix aacraid version none

Description Akemi Yagi 2012-07-22 19:04:06 UTC
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):
redhat-rpm-config-9.0.3-39.el6

How reproducible:
Always

Steps to Reproduce:
1. Build the aacraid kernel module using redhat-rpm-config-9.0.3-39.el6
2.
3.
  
Actual results:
Build fails.

Expected results:
Build succeeds without an error

Additional info:

This error occurs if the module version contains the "[" or "]" chararacter. In this case,

$ modinfo aacraid | grep ^version
version:        1.1-7[28000]-ms

I compared redhat-rpm-config between -39 and -34 and found the source of the issue to be this change:

RHEL6.3-fix-find-provides-modalias-permissions.patch

+      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.

Comment 2 RHEL Program Management 2012-12-14 08:32:01 UTC
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.

Comment 5 Weiping Pan 2013-08-22 08:15:19 UTC
Hi, Akemi,

I can not reproduce your bug.
Can you attach your srpm ? Then I can check it.

thanks
Weiping Pan

Comment 6 Akemi Yagi 2013-08-22 16:00:26 UTC
Hi Weiping,

You can get the srpm from ELRepo:

http://elrepo.org/linux/elrepo/el6/SRPMS/aacraid-kmod-1.2.1-2.el6.elrepo.src.rpm

This one produces the error:

error: line 92: Illegal char '[' in: - Initial el6 build of the kmod package.

Comment 7 Weiping Pan 2013-08-23 08:13:16 UTC
(In reply to Akemi Yagi from comment #6)
> Hi Weiping,
> 
> You can get the srpm from ELRepo:
> 
> http://elrepo.org/linux/elrepo/el6/SRPMS/aacraid-kmod-1.2.1-2.el6.elrepo.src.
> rpm
> 
> 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 ?

thanks
Weiping Pan

Comment 8 Weiping Pan 2013-08-23 08:15:20 UTC
Created attachment 789497 [details]
rpmbuild think "[" and "]" are illegal in version field

rpmbuild think "[" and "]" are illegal in version field.

Comment 9 Weiping Pan 2013-08-23 08:16:10 UTC
Created attachment 789498 [details]
fix aacraid version

patch to fix aacraid version.

Comment 10 Akemi Yagi 2013-08-23 16:47:00 UTC
(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".

Akemi

Comment 11 Weiping Pan 2013-08-26 02:49:22 UTC
(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".
> 
> Akemi

Hi, Akemi,

Ok, then let me implemet in the second method.

thanks
Weiping Pan

Comment 12 Weiping Pan 2013-08-26 02:50:53 UTC
Hi, Chun,

Can you give QA ACK for this bug ?

thanks
Weiping Pan

Comment 13 Cui Chun 2013-08-26 03:20:58 UTC
(In reply to Weiping Pan from comment #12)
> Hi, Chun,
> 
> Can you give QA ACK for this bug ?
> 
> thanks
> Weiping Pan

Reassign to BaseOS QE for reviewing of redhat-rpm-config package.

Comment 14 RHEL Program Management 2013-10-14 04:52:28 UTC
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.

Comment 15 Akemi Yagi 2013-10-14 17:54:48 UTC
Hi Weiping,

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.

Akemi

Comment 16 Weiping Pan 2013-10-15 07:15:48 UTC
Hi, Akemi,

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.

thanks
Weiping Pan

Comment 17 Akemi Yagi 2013-10-15 17:58:46 UTC
Because this is not an urgent matter, I suppose we can wait for RHEL6.6.

Akemi

Comment 18 Weiping Pan 2013-12-10 07:44:54 UTC
Hi, PM,

Please help me set rhel 6.6 flag if you want to fix this bug in rhel 6.6.

thanks
Weiping Pan

Comment 20 Akemi Yagi 2014-06-16 03:29:37 UTC
This bug exists in RHEL 7.0 as well. Could you please apply the patch there?

Thanks,
Akemi

Comment 21 Weiping Pan 2014-06-17 01:23:46 UTC
Hi, Akemi,

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.

thanks
Weiping Pan

Comment 22 Akemi Yagi 2014-06-17 01:54:06 UTC
Hi Weiping,

According to the upstream driver page at:

http://www.adaptec.com/en-us/speed/raid/aac/linux/aacraid_linux_rpms_v1_2_1-30300_tgz.htm

their version is :

Version:   1.2.1-30300

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.

Akemi

Comment 23 Weiping Pan 2014-07-01 03:07:58 UTC
Hi, Akemi, 

In upstream,
drivers/scsi/aacraid/linit.c
  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
  69 #else
  70 #define AAC_DRIVER_FULL_VERSION AAC_DRIVER_VERSION AAC_DRIVER_BRANCH
  71 #endif

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.


thanks
Weiping Pan

Comment 24 Akemi Yagi 2014-07-01 17:55:59 UTC
Hi Weiping,

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 ...

Akemi

Comment 25 Weiping Pan 2014-07-07 08:02:54 UTC
Hi, Akemi,

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.

thanks
Weiping Pan

Comment 29 Ľuboš Kardoš 2015-01-06 13:23:52 UTC
Assigned to ffesti by mistake, assigning back to wpan.