Akemi Yagi wrote:> On Fri, Mar 25, 2016 at 9:57 AM, Patrick Begou < > Patrick.Begou at legi.grenoble-inp.fr> wrote: > >> I'm very confused on the right step to use to setup a modified kernel in >> centOS6. >> >> As a simple user, I've downloaded the latests sources (I'm runing an old >> kernel version) : >> >> rpm -i >> http://vault.centos.org/6.7/updates/Source/SPackages/kernel-2.6.32-573.22.1.el6.src.rpm >> >> in the spec file ~/rpmbuild/SPECS/kernel.spec I've set: >> %define buildid .numa >> >> Now I want to set *CONFIG_NUMA_EMU=y* >> before runing: >> rpmbuild -bb --without xen --without debug --without debuginfo >> --target=x86_64 ./SPECS/kernel.spec >> >> But where shoud I set this CONFIG_NUMA_EMU option ? >> I've tested several config files where this options was specified (using >> grep as a last solution) but each build reset my choice and it is not >> available in the final kernel. >> >> And google is a little bit confusing for me with many and many diverging >> informations. >> >> Thank to kernel gourous for their advices. >> >> Patrick >> > 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 > _______________________________________________ > CentOS mailing list > CentOS at centos.org > https://lists.centos.org/mailman/listinfo/centos >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 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. Today I've founded the "Howto Rebuild Centos 6.0 Linux Kernel" page of Vaidas Jablonskis (https://jablonskis.org/2011/howto-rebuild-centos-6-0-linux-kernel/index.html) rpm -i http://vault.centos.org/6.7/updates/Source/SPackages/kernel-2.6.32-573.22.1.el6.src.rpm edit ~/rpmbuild/SPECS/kernel.spec to set the buildid rpmbuild -bp ~/rpmbuild/SPECS/kernel.spec cd ~/rpmbuild/BUILD/kernel-2.6.32-573.22.1.el6/linux-2.6.32-573.22.1.el6.numa.x86_64/ edit .config or make menuconfig to set CONFIG_NUMA_EMU=y make rpm But compilation fails with arch/x86/mm/srat_64.c: In function 'acpi_fake_nodes': arch/x86/mm/srat_64.c:469: error: implicit declaration of function '__acpi_map_pxm_to_node' An error i've met some years ago and the only work arround found was to use an older kernel source package. Patrick || -- ==================================================================| Equipe M.O.S.T. | | | Patrick BEGOU | mailto:Patrick.Begou at grenoble-inp.fr | | LEGI | | | BP 53 X | Tel 04 76 82 51 35 | | 38041 GRENOBLE CEDEX | Fax 04 76 82 52 71 | ===================================================================
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
Dear Akemi, I'm really ashamed, in "https://wiki.centos.org/HowTos/I_need_the_Kernel_Source" I've missed the last 5 lines following the CentOS5 section. All is now clear for me on the process to follow to build a new kernel from source rpm and the CONFIG_NUMA_EMU option is active. I've set it with make menuconfig to avoid some additional mistakes in the config file. However, with this CONFIG_NUMA_EMU option , the compiler returns an error and compilation fails. arch/x86/mm/srat_64.c: In function 'acpi_fake_nodes': arch/x86/mm/srat_64.c:469: error: implicit declaration of function '__acpi_map_pxm_to_node' make[2]: *** [arch/x86/mm/srat_64.o] Error 1 make[1]: *** [arch/x86/mm] Error 2 make: *** [arch/x86] Error 2 make: *** Waiting for unfinished jobs.... error: Bad exit status from /var/tmp/rpm-tmp.VkJ805 (%build) Bad exit status from /var/tmp/rpm-tmp.VkJ805 (%build) Without CONFIG_NUMA_EMU option, compilation is successfull. It is the CentOSplus kernel from kernel-2.6.32-573.el6.centos.plus.src.rpm as yous suggested. Thank for your patience Patrick Akemi Yagi wrote:> 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 > _______________________________________________ > CentOS mailing list > CentOS at centos.org > https://lists.centos.org/mailman/listinfo/centos >-- ==================================================================| Equipe M.O.S.T. | | | Patrick BEGOU | mailto:Patrick.Begou at grenoble-inp.fr | | LEGI | | | BP 53 X | Tel 04 76 82 51 35 | | 38041 GRENOBLE CEDEX | Fax 04 76 82 52 71 | ===================================================================