Bug 757135 - Building a kernel (Fedora way) not using our config file
Summary: Building a kernel (Fedora way) not using our config file
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 16
Hardware: i686
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-25 14:42 UTC by Djam
Modified: 2011-12-06 16:39 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-06 13:57:48 UTC
Type: ---


Attachments (Terms of Use)

Description Djam 2011-11-25 14:42:55 UTC
Description of problem:
Using the Fedora wiki (http://fedoraproject.org/wiki/Building_a_custom_kernel), it takes me about 2/3 hours to compile a new kernel (Fedora way).
I think my kernel config file is not really interpreted by the rpmbuild steps.
The config file is correctly generated with make menuconfig and copied to the right places:
~/rpmbuild/SOURCES/config-`uname -m` and cp .config ~/rpmbuild/SOURCES/config-`uname -m`-generic

Version-Release number of selected component (if applicable):
[root@fedora ~]# cat /etc/redhat-release
Fedora release 16 (Verne)
[root@fedora ~]# uname -a
Linux fedora 3.1.0-7.fc16.i686 #1 SMP Tue Nov 1 21:00:16 UTC 2011 i686 i686 i386 GNU/Linux
[root@fedora ~]# rpmbuild --version
RPM version 4.9.1.2

How reproducible:
Using the Fedora wiki (http://fedoraproject.org/wiki/Building_a_custom_kernel) and generate a minimal kernel config file with 
make allnoconfig.

Steps:
$ cd
$ yum install rpmdevtools yum-utils ncurses-devel 
$ rpmdev-setuptree
$ yumdownloader --source kernel
$ yum-builddep kernel-<version>.src.rpm
$ rpm -Uvh kernel-<version>.src.rpm
$ rpmbuild -bp --target=`uname -m` ~/rpmbuild/SPECS/kernel.spec
$ cd ~/rpmbuild/BUILD/kernel-3.1.fc16/linux-3.1.i686
$ rm .config*
$ make allnoconfig
$ make menuconfig # for checking and enable loadable module support
# add uname -i result (# i386) at the first line of .config
$ cp .config ~/rpmbuild/SOURCES/config-`uname -m`
$ cp .config ~/rpmbuild/SOURCES/config-`uname -m`-generic
# update buildid in ~/rpmbuild/SPECS/kernel.spec 
$ rpmbuild -bb --with baseonly --without debuginfo --target=`uname -m` ~/rpmbuild/SPECS/kernel.spec

Actual results:
Big big kernel, successfuly compiled after several hours with too much things, looks like my kernel config file is not considered.

Expected results:
a smaller kernel, quickly compiled, with only my setup configuration

Additional info:
I think there is something wrong in the ~/rpmbuild/SPECS/kernel.spec file.
By forcing on it the copy of my config file (after all the tasks generating the new one), my config file is correctly used.
~/rpmbuild/SPECS/kernel.spec
1520 ### build
1521 ###
1522 %build
....
1583     make -s mrproper
1584     cp configs/$Config .config       # remplace this command by cp whereismyconfigfile .config

Thanks. Regards,

Comment 1 Ville Skyttä 2011-11-25 17:42:20 UTC
I don't see anything here that looks like an issue in the rpmdevtools package.  I'm not sure what component this should be filed against, but moving to kernel based on the "I think there is something wrong in the ~/rpmbuild/SPECS/kernel.spec file." sentence.

Comment 2 Djam 2011-11-25 20:50:54 UTC
Thanks for your quick reply.
The kernel.spec file is the default one (I don't know which package or action provided it). The only updated parameter is the "buildid" entry.
For sure, there is something wrong in it.

Comment 3 Josh Boyer 2011-11-28 16:04:18 UTC
The wiki steps seem to be slightly out-of-date.

What does `uname -m` return on whatever machine you are running this on?

Comment 4 Chuck Ebbert 2011-11-28 22:01:35 UTC
The config file gets generated from the various bits and pieces (config-*) in the source directory. If you want to override things, just replace the empty config-local file with a set of config options you want to override.

Comment 5 Djam 2011-11-29 14:51:14 UTC
(In reply to comment #3)
> The wiki steps seem to be slightly out-of-date.

I think so.

> What does `uname -m` return on whatever machine you are running this on?

i686

Comment 6 Josh Boyer 2011-12-05 16:42:59 UTC
(In reply to comment #5)
> (In reply to comment #3)
> > The wiki steps seem to be slightly out-of-date.
> 
> I think so.
> 
> > What does `uname -m` return on whatever machine you are running this on?
> 
> i686

That isn't going to work at all.  There are 2 32-bit config files that get sourced during the build.  config-x86-32-generic is the primary one, and config-i686-PAE is the config for a PAE kernel.

I'll update the build steps to remove a bunch of cruft.  As Chuck says in comment #4, small overrides can just go into config-local

Comment 7 Josh Boyer 2011-12-05 16:55:15 UTC
I've updated the steps a bit on the wiki.  Please follow again and see if they clear up the issue.

Comment 8 Djam 2011-12-06 09:06:55 UTC
(In reply to comment #7)
> I've updated the steps a bit on the wiki.  Please follow again and see if they
> clear up the issue.

I have done several tests using config-local and yes, it works perfectly like that
(confirmed by using an empty config file with make allnoconfig and a normal one).

Comment 9 Josh Boyer 2011-12-06 13:57:48 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > I've updated the steps a bit on the wiki.  Please follow again and see if they
> > clear up the issue.
> 
> I have done several tests using config-local and yes, it works perfectly like
> that
> (confirmed by using an empty config file with make allnoconfig and a normal
> one).

Great.  Thanks for pointing out the stale documentation.

Comment 10 Djam 2011-12-06 16:34:33 UTC
(In reply to comment #7)
> I've updated the steps a bit on the wiki.  Please follow again and see if they
> clear up the issue.

I have just checked the wiki: http://fedoraproject.org/wiki/Building_a_custom_kernel
(I have used your advice without reading the wiki...). I do not see your updates, especially this part:

##################################################
Configure Kernel Options 
[...]
6. Copy the config file to ~/rpmbuild/SOURCES/:

cp .config ~/rpmbuild/SOURCES/config-`uname -m` # It has to be cp .config ~/rpmbuild/SOURCES/config-local

##################################################

Comment 11 Djam 2011-12-06 16:39:48 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > (In reply to comment #7)
> > > I've updated the steps a bit on the wiki.  Please follow again and see if they
> > > clear up the issue.
> > 
> > I have done several tests using config-local and yes, it works perfectly like
> > that
> > (confirmed by using an empty config file with make allnoconfig and a normal
> > one).
> 
> Great.  Thanks for pointing out the stale documentation.

Sorry, forgot my last comment.
I have read too quickly, thanks for your help and the wiki update.


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