{"id":457,"date":"2013-04-24T12:04:19","date_gmt":"2013-04-24T10:04:19","guid":{"rendered":"http:\/\/songoku.homelinux.com\/wordpress\/?p=457"},"modified":"2013-04-24T12:04:19","modified_gmt":"2013-04-24T10:04:19","slug":"recompile-x86_64-kernel-for-centos-6-4","status":"publish","type":"post","link":"https:\/\/ndk.sytes.net\/wordpress\/?p=457","title":{"rendered":"Recompile x86_64 kernel for CentOS 6.4"},"content":{"rendered":"<p>\n\tHi, due to some changes in the official CentOS 6 kernel like the integration of IPMI into the kernel (boot hanging bug) and the preemptive scheduling to &quot;desktop&quot; instead of &quot;server&quot; (which resulted in poorer performance)&nbsp;i decided to recompile the kernel.\n<\/p>\n<p>\n\tHere is a small howto if you want to recompile your centos stock kernel with other options:\n<\/p>\n<ol>\n<li>\n\t\t<strong>create building tree as non-root user<\/strong><br \/>\n\t\t<em># su &lt;user&gt;<br \/>\n\t\t<user><em># mkdir -p ~\/rpmbuild\/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}<\/em><br \/>\n\t\t<em># echo &#39;%_topdir %(echo $HOME)\/rpmbuild&#39; &gt; ~\/.rpmmacros<\/em><br \/>\n\t\t<em># exit<\/em> <\/user><\/em>\n\t<\/li>\n<li>\n\t\t<strong>install needed packages:<\/strong><br \/>\n\t\t<em><em># yum groupinstall &quot;Development Tools&quot;<br \/>\n\t\t# yum install hmaccalc zlib-devel binutils-devel elfutils-libelf-devel<br \/>\n\t\t# yum install rpm-build redhat-rpm-config asciidoc hmaccalc<br \/>\n\t\t# yum install binutils-devel elfutils-libelf-devel newt-devel zlib-devel ncurses-devel<br \/>\n\t\t# yum install xmlto python-devel<\/em> <\/em>\n\t<\/li>\n<li>\n\t\t<strong>change user (NEVER RECOMPILE AS ROOT):<\/strong><br \/>\n\t\t<em><em># su &lt;user&gt;<\/em> <\/em>\n\t<\/li>\n<li>\n\t\t<strong>install source rpm:<\/strong><br \/>\n\t\t<em># rpm -ivh http:\/\/vault.centos.org\/6.4\/updates\/Source\/SPackages\/kernel-2.6.32-358.2.1.el6.src.rpm<br \/>\n\t\t\u200b<\/em><em>(6.4 -&gt; centos version, kernel-2.6.32-358.2.1.el6.src.rpm -&gt; kernel version)<\/em>\n\t<\/li>\n<li>\n\t\t<strong>prepare source build tree<\/strong><br \/>\n\t\t<em># cd&nbsp;~\/rpmbuild\/SPECS<br \/>\n\t\t# rpmbuild -bp &#8211;target=&quot;x86_64&quot; kernel.spec<\/em>\n\t<\/li>\n<li>\n\t\t<strong>edit rpmbuild\/SPECS\/kernel.spec and replace line 18 with your custom build id:<\/strong><br \/>\n\t\t<em># %define buildid .custom.NOIPMI.SERVER<br \/>\n\t\t(-&gt; kernel-2.6.32.358.2.1.custom.NOIPMI.SERVER.x86_64.rpm) <\/em>\n\t<\/li>\n<li>\n\t\t<strong>copy over old kernel config:<\/strong><br \/>\n\t\t<em># cd ~\/rpmbuild\/BUILD\/kernel-2.6.32-358.2.1.el6\/linux-2.6.32-358.2.1.el6.x86_64<\/em><br \/>\n\t\t<em># cp \/boot\/config-2.6.32-358.2.1.el6.x86_64 .config<\/em>\n\t<\/li>\n<li>\n\t\t<strong>now chane the kernel config to your desires:<\/strong><br \/>\n\t\t<em># make clean<br \/>\n\t\t# make menuconfig<\/em>\n\t<\/li>\n<li>\n\t\t<strong>then copy the config file to your SOURCE directory:<\/strong><br \/>\n\t\t<em># cp .config configs\/kernel-2.6.32-x86_64.config<br \/>\n\t\t# cp configs\/*&nbsp;~\/rpmbuild\/SOURCES<\/em>\n\t<\/li>\n<li>\n\t\t<strong>launch the compile process:<\/strong><br \/>\n\t\t<em># cd ~\/rpmbuild\/SPECS<\/em><br \/>\n\t\t<em># rpmbuild -bb &#8211;with baseonly &#8211;without debug &#8211;without debuginfo &#8211;target=&quot;x86_64&quot; kernel.specs<\/em>\n\t<\/li>\n<\/ol>\n<p>\n\t\u200bNow there should be some cryptic output to the screen. Lean back and have a coffee, the compilation process can take some time. Depending on your hardware this can take between 30 min and 3 hours (apparemtly up to 9 hours on a PentiumIII).\n<\/p>\n<p>\n\tThe compiled kernel can be found in&nbsp;the&nbsp;RPMS folder.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, due to some changes in the official CentOS 6 kernel like the integration of IPMI into the kernel (boot hanging bug) and the preemptive scheduling to &quot;desktop&quot; instead of &quot;server&quot; (which resulted in poorer performance)&nbsp;i decided to recompile the kernel. Here is a small howto if you want to recompile your centos stock kernel [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,7],"tags":[],"class_list":["post-457","post","type-post","status-publish","format-standard","hentry","category-linuxunix","category-servers"],"_links":{"self":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/457","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=457"}],"version-history":[{"count":0,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/457\/revisions"}],"wp:attachment":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=457"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=457"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}