[CentOS] CentOS6: Building a modified kernel rpm

Akemi Yagi amyagi at gmail.com
Tue Mar 29 22:16:34 UTC 2016


On Tue, Mar 29, 2016 at 2:27 AM, Patrick Begou <
Patrick.Begou at legi.grenoble-inp.fr> wrote:

> Akemi Yagi wrote:
>
>> I recommend you follows the instructions in this CentOS wiki article:
>>
>> https://wiki.centos.org/HowTos/Custom_Kernel
>>
>> If you encounter any issue, please let us know here.
>>
>> Akemi
>>
>> Thanks for answering Akemi . Indeed I tried using this howto before
> posting but something is wrong in this tutorial.
>
> I installed the prerequisites and downloaded the kernel sources as
> detailed in section 2 of
> https://wiki.centos.org/HowTos/I_need_the_Kernel_Source.
>
> But on https://wiki.centos.org/HowTos/Custom_Kernel, section 2, all goes
> wrong!
> My ~/rpmbuild/BUILD directory is empty!
> No configs directory too.
> No ~/rpmbuild/BUILD/kernel-*/linux-*/ available, all configs files are in
> ~/rpmbuild/SOURCES
>

The referenced wiki article should work for building CentOS-6 kernels (not
quite ready for CentOS-7). You really have to dot the i's and cross the
t's. If you miss a step or command in there, chances are it will fail.


> Since this I try to modify ~/rpmbuild/SOURCES/config-x86-generic because
> it was the only file containing the CONFIG_ACPI_NUMA flag. No success, the
> build does not take account of my changes as the
> ~/rpmbuild/BUILD/kernel-2.6.32-573.22.1.el6/linux-2.6.32-573.22.1.el6.numa.x86_64/.config
> created file with:
> rpmbuild -bb --without xen --without debug --without debuginfo
> --target=x86_64 ./SPECS/kernel.spec
> says "# CONFIG_NUMA_EMU is not set"
>
> So I change this file with an editor and rebuild the rpm package of the
> kernel with the same command. The .config file is overwriten.
>

As you found out, editing the existing config-x86-generic file would not
work because the final config file is created on the fly. This is why the
wiki instructions tell you to create your customized config file and show
you how to get that config file to be used during the build process.

I have another suggestion for you. Get the srpm for the CentOSPlus kernel
instead of the distro kernel. The plus kernel is a customized kernel. It
has kernel-xx-config files that you can directly edit. They will not be
overwritten. Perhaps this method is easier.

But if you wish to go for the original method, just be extremely precise
not to skip any step.

Hope this helps,

Akemi



More information about the CentOS mailing list