This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 63641 - rpm -ba kernel-2.4.spec doesn't produce SMP 2.4.9-31 kernel on i686
rpm -ba kernel-2.4.spec doesn't produce SMP 2.4.9-31 kernel on i686
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: kernel (Show other bugs)
7.2
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Arjan van de Ven
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-04-16 13:43 EDT by Jack Perdue
Modified: 2007-04-18 12:42 EDT (History)
0 users

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


Attachments (Terms of Use)

  None (edit)
Description Jack Perdue 2002-04-16 13:43:05 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.4) Gecko/20011128
Netscape6/6.2.1

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:
Always

Steps to Reproduce:
1. become root on a SMP i686 system
2.rpm -i
ftp://ftp.redhat.com/pub/redhat/linux/updates/7.2/en/os/SRPMS/kernel-2.4.9-31.src.rpm

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
kernel-2.4.9-31.perfctr.i386.rpm
-rw-r--r--    1 root     root      4365290 Apr 15 18:52
kernel-BOOT-2.4.9-31.perfctr.i386.rpm
-rw-r--r--    1 root     root      1663964 Apr 15 18:51
kernel-doc-2.4.9-31.perfctr.i386.rpm
-rw-r--r--    1 root     root      1152130 Apr 15 18:51
kernel-headers-2.4.9-31.perfctr.i386.rpm
-rw-r--r--    1 root     root     25144112 Apr 15 18:51
kernel-source-2.4.9-31.perfctr.i386.rpm

[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
/usr/src/redhat/RPMS/i686

(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"
  RPM_ARCH="i386"

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
%endif

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

If I put this right after %prep:

%prep
# BEGIN PERFCTR
%if %{buildsmp}
echo "Build SMP - %{_arch}"
%else
echo "Don't build SMP"
%endif
%ifarch i386
echo "i386 architecutre - SMP build disabled"
%endif

%ifarch i686
echo "i686 architecture"
%endif
# END PERFCTR

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
[snipped]

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 13:46:47 EDT
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 13:54:45 EDT
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.