Bug 63641 - rpm -ba kernel-2.4.spec doesn't produce SMP 2.4.9-31 kernel on i686
Summary: rpm -ba kernel-2.4.spec doesn't produce SMP 2.4.9-31 kernel on i686
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: kernel   
(Show other bugs)
Version: 7.2
Hardware: i686
OS: Linux
Target Milestone: ---
Assignee: Arjan van de Ven
QA Contact: Brian Brock
Depends On:
TreeView+ depends on / blocked
Reported: 2002-04-16 17:43 UTC by Jack Perdue
Modified: 2007-04-18 16:42 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-04-16 17:46:52 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Jack Perdue 2002-04-16 17:43:05 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.4) Gecko/20011128

Description of problem:
I thought in the past if I used -ba or --rebuild on a .spec/SRPM
on a SMP i686, it would automatically generate an SMP kernel.

It no longer does that.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. become root on a SMP i686 system
2.rpm -i

3. cd /usr/src/redhat/SPEC
4. rpm -ba kernel-2.4.spec


Actual Results:  No i686 kernels or SMP kernels created.  All I get are:

-rw-r--r--    1 root     root     10434043 Apr 15 18:46
-rw-r--r--    1 root     root      4365290 Apr 15 18:52
-rw-r--r--    1 root     root      1663964 Apr 15 18:51
-rw-r--r--    1 root     root      1152130 Apr 15 18:51
-rw-r--r--    1 root     root     25144112 Apr 15 18:51

[Where perfctr is an addition to the release on the custom kernel
I am bulding]

Expected Results:  That I'd get a kernel-smp-2.4.9-31.i686.rpm in

(actually kernel-smp-2.4.9-31.perfctr.i686.rpm in my case)

Additional info:

This is a dual processor PII.  `arch` return i686 at the command line.

In the spec file, "%ifarch i386", is (I think quite properly) true
due to the following.

[root@emmy SPECS]$ find /usr/lib/rpm/ -name macros | xargs grep %_arch
/usr/lib/rpm/i386-redhat-linux/macros:%_arch                    i386
/usr/lib/rpm/i486-redhat-linux/macros:%_arch                    i386
/usr/lib/rpm/i586-redhat-linux/macros:%_arch                    i386
/usr/lib/rpm/i686-redhat-linux/macros:%_arch                    i386
/usr/lib/rpm/macros:%_arch                      i386
/usr/lib/rpm/athlon-redhat-linux/macros:%_arch                  i386

Looking /var/tmp/rpm-tmp.xyzw for the session, I see this bit:

  RPM_OPT_FLAGS="-O2 -march=i386 -mcpu=i686"

which seems right given the above and the following:

[root@emmy SPECS]$ find /usr/lib/rpm/ -name macros | xargs grep march
/usr/lib/rpm/i386-redhat-linux/macros:%optflags         -O2 -march=i386
-mcpu=i686 -g
/usr/lib/rpm/i486-redhat-linux/macros:%optflags         -O2 -march=i486 -g
/usr/lib/rpm/i586-redhat-linux/macros:%optflags         -O2 -march=i586 -g
/usr/lib/rpm/i686-redhat-linux/macros:%optflags         -O2 -march=i686 -g
/usr/lib/rpm/athlon-redhat-linux/macros:%optflags               -O2 -march=athlon -g

However, in the .spec file, there is this section:

%ifarch i386
%define buildsmp 0

which seems to be activated.  Is this correct on a i686?

If I put this right after %prep:

%if %{buildsmp}
echo "Build SMP - %{_arch}"
echo "Don't build SMP"
%ifarch i386
echo "i386 architecutre - SMP build disabled"

%ifarch i686
echo "i686 architecture"

I get this for rpm -bp kernel.spec

[root@emmy SPECS]$ rpm -bp kernel-2.4.spec.save3.jkp
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.91258
+ umask 022
+ cd /usr/src/redhat/BUILD
+ echo 'Don'\''t build SMP'
Don't build SMP
+ echo 'i386 architecutre - SMP build disabled'
i386 architecutre - SMP build disabled
+ cd /usr/src/redhat/BUILD
+ rm -rf kernel-2.4.9

Notice the lack if i686 definition.

To force SMP, I can add --with smp kernel.spec as so:

[root@emmy SPECS]$ rpm -bp --with smp kernel-2.4.spec.save3.jkp
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.17123
+ umask 022
+ cd /usr/src/redhat/BUILD
+ echo 'Build SMP - i386'
Build SMP - i386
+ echo 'i386 architecutre - SMP build disabled'
i386 architecutre - SMP build disabled
+ cd /usr/src/redhat/BUILD

and SMP will be enabled (later on down in the spec), but
the target is still i386.  Furthermore, the smp RPM never
shows up (but that's another bug probably).

So, the question is... 

Will %ifarch 686 ever be true?  If not, that .spec file
needs some serious help.  If so, should it not letting
%ifarch 386 be true?

Do I have to use --rebuild on the SRPM to get i686 kernels
(haven't tried that yet since each processor is only 300Mhz 
and kernel rebuilds take quite a while)?  I thought -ba
and --rebuild where just one step away from each other
(i.e. extracting the source and spec).

Comment 1 Arjan van de Ven 2002-04-16 17:46:47 UTC
You seem to have forgotten

rpm -ba --target i686 <filenamesrc.rpm>

eg the default target is i386 not i686

Comment 2 Jack Perdue 2002-04-16 17:54:45 UTC
Thanks Arjan... I guess that was a piece of knowledge I didn't have.

I could swear I've had it rebuild SMP by default on SMP systems
without specifying the target in the past.  I guess not.

Sorry to "bug" you.  I guess I'll go ahead and change 
this to NOTABUG (defective end user).

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