On 01/05/2011 06:29 PM, Don Zickus wrote:
On Wed, Jan 05, 2011 at 11:36:40PM +0000, Mr Dash Four wrote:
>>> vi .config (this is to add the magic "# x86_64" at the top)
>> I don't understand why you need a commented line???
>> What's the magic about it? A comment is ignored.
> See the "Fedora Wiki" ( :-D ) for building the kernel - the target arch
> needs to be added as a comment on the first line of that .config file
> (that is particularly important if I do cross-compilation of the kernel
> - I add "# i386" for i686 targets for example). If that is not present
> all hell breaks loose!
I think we use it during the 'make nonint_oldconfig' stage, ala
for i in $config_list
ARCH=`cat $i|head -1|sed 's/# //'`
cp $i .config
make ARCH=$ARCH nonint_oldconfig
cp .config configs/$i
without the #$arch thing, we wouldn't know what arch to pass into the
kernel Makefile system to get the right config options.
>>> cp .config ~/rpmbuild/SOURCES/config-x86_64-generic
Yeah that won't work (explained below)
>> This will not guarantee that the config file will not be modified.
>> I have done this numerous times, and I can tell you unequivocally,
>> it will not keep all the options you want, nor will it exclude all the
>> options you do NOT want.
>> What it will give you is a beast that is niether what you want nor
>> what you do not want.
>> This is the wierdness of the .spec file operations and the Makefile
>> script in ...SOURCES/Makefile.config
> What would you advice me to do then?! I need to end up with 3
> kernel-*.rpm files plus one perf*.rpm, which I can distribute to all my
> machines. The above set of instructions is what "Fedora Wiki" ( :-D )
> advices on building the kernel...
>> The fedora release people have not provided us with a mechanism
>> that will let us build a kernel EXACTLY as the config file we save in
>> the SOURCES directory.
> What do they actually change - after I build and install the kernel and
> then check the corresponding .config file in the /boot
> partition/directory it is the same as the one I have copied as
> config-x86_64-generic, so, naturally, I assume that nothing has been
> modified/changed. Is that not the case?
The way the config options work is basically a bunch of templates that
override each other as they get stacked on top. So
config-generic is usually the base config that all arches start with
config-$ARCH-generic is merged onto config-generic and overrides those
config-$ARCH-$VARIANT is merged onto that with more overrides
the result config blob is full of stuff that may or may not be relevant to
the particular type of kernel we are building, therefore we use the
for-loop (from earlier in the email), to filter out that cruft. The magic
is 'make ARCH=$ARCH nonint_oldconfig' (think make oldconfig without the
The output files are kernel-$version-$arch.config. If you want to copy
.config files somewhere, it really should be the kernel-*.config files.
But I don't have the .spec file handy to know if those get repeatedly
overwritten on a rpmbuild.
The way the kernel maintainers set the options is to modify the
config-$pickone-generic file with the option you care about to on/off.
But as explained in other threads, we never supported custom configs so no
one really designed a process to make it easy.
Thank you for the elucidation, Don. I find it very useful,
as I have struggled with this issue for a long time.
So, for a sysadmin, who needs a custom configured kernel
for multiple machines, and wants to produce the custom
binaries for these machines that have same architecture and
devices, to enable features and drivers that are not by
default enabled in the vanilla fedora binary rpm: what is the
sysadmin to do?
It seems to me that the rpm packagers need to provide a way
for the admin to use an existing config file which has enabled
all that is needed, as a base config file. Thus running rpmbuild
should somehow use this base config file, and add to it if necessary,
but at least keep the features/drivers that are enabled in the
base config file, enabled for the actual build.
To date, I have not succeeded in producing a kernel with my drivers
enabled as per an existing config file, using the rpmbuild method.
PS: my needed drivers are in staging, and they work. But I do not
seem to be able to use my current .config file
as a base config file (such as ~/rpmbuild/SOURCES/config-x86-generic
(my arch is i686), when building from a new source rpm release.
It never yielded a kernel with my drivers enabled.
I did follow the instructions at
very very closely, to no avail.
Maybe I AM doing someting wrong, but I have no idea what that might be.
So, what do I do? I simply prep from source
(rpmbuild -bp kernel.spec)
and then cd to ~/rpmbuild/BUILD/kernel-184.108.40.206-74/linux-2.6.35.i686,
copy my current kernel's config file to .config, run
make oldconfig and
and that does it.
The new config file inherits my enabled drivers selections.