Hide Forgot
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,
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.
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.
The wiki steps seem to be slightly out-of-date. What does `uname -m` return on whatever machine you are running this on?
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.
(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
(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
I've updated the steps a bit on the wiki. Please follow again and see if they clear up the issue.
(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).
(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.
(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 ##################################################
(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.