{"id":264,"date":"2009-06-07T04:55:14","date_gmt":"2009-06-07T04:55:14","guid":{"rendered":"http:\/\/g33kinfo.com\/info\/index.php\/?p=264"},"modified":"2009-06-07T04:55:14","modified_gmt":"2009-06-07T04:55:14","slug":"compile-an-ubuntu-904-kernel","status":"publish","type":"post","link":"https:\/\/g33kinfo.com\/info\/compile-an-ubuntu-904-kernel\/","title":{"rendered":"Compile an Ubuntu  9.04 Kernel"},"content":{"rendered":"<p>Compile an Ubuntu  9.04 Kernel<\/p>\n<p>The purpose of this tutorial is to show you how to set up a kernel that is highly tuned for your CPU, in this case a Pentium 4 with hyperthreading for a workstation.<\/p>\n<p>Caution: If you do something wrong..it happens\u2026be sure to reboot and select an alternative kernel. You should always have several kernels in case of trouble.  DO THIS ON A TEST MACHINE or make sure you have a good backup.<\/p>\n<p>Step #1: Download and install the necessary tools.<br \/>\nDownload the necessary tools so that you have everything ready.<\/p>\n<p><code># apt-get install kernel-package libncurses5-dev fakeroot wget bzip2<\/code><\/p>\n<p>You must have the source available to create a new kernel.<\/p>\n<p><code># apt-get install linux-source<\/code><\/p>\n<p>You must be in the \/usr\/src directory to work or copy the source,<br \/>\nlinux-source-2.6.28.tar.bz2, to the directory you want to work in. Either move into the \/usr\/src directory to work or into the alternative directory you will make the build in.<\/p>\n<p><code># cd \/usr\/src<\/code><\/p>\n<p>This directory will contain the necessary headers to build the kernel. These are the source files.<\/p>\n<p>You need to unpack the source that was downloaded.<\/p>\n<p><code># bzip2 -d linux-source-2.6.28.tar.bz2<\/code><br \/>\n<code># tar xvf linux-source-2.6.28.tar<\/code><\/p>\n<p>Now you should have a directory that looks like this:<\/p>\n<p>linux-source-2.6.28<\/p>\n<p>Create a symbolic link to this source directory and name it linux.<\/p>\n<p><code># ln -s linux-source-2.6.28 linux<\/code><\/p>\n<p>Move into the directory, you can use the term linux as it is now a link to that folder.<\/p>\n<p><code># cd linux<\/code><\/p>\n<p>The config file is a hidden file that has the configuration from the kernel that is installed. You will need to copy that because it has already determined your hardware devices.<\/p>\n<p><code># cp \/boot\/config-`uname -r` .\/.config<\/code><\/p>\n<p>When you copy this config file over, it is a file represents the hardware that the kernel discovered at boot and set up. It also reflects many default settings.<\/p>\n<p>Step #2: Now the fun begins\u2026.<\/p>\n<p>You are ready to start menuconfig which will allow you to choose your kernel specifics.<\/p>\n<p><code>make menuconfig<\/code><\/p>\n<p>This opens the menu to start configuration.<\/p>\n<p>k11<\/p>\n<p>Here you see it detected the .config file.<\/p>\n<p>Now work your way through the menus and make the selections that you want to add or subtract. For example, here KVM is changed from being a module to load to actually being made a part of the kernel. It has been unchecked so modular support will not be available, thus saving space in your kernel. The \u201c*\u201d indicates that it will be loaded into the kernel and an empty option means that no support for that option will be placed in the kernel.<\/p>\n<p>If you know about your hardware you can increase your speed by making the kernel smaller by removing those modules that you do not need.  It is important that you make changes slowly so that if you have problems you have fewer places to troubleshoot.<\/p>\n<p>Once you have all of your modifications complete save the new .config file.<\/p>\n<p>Run this command to clean up.<\/p>\n<p><code># make-kpkg clean<\/code><\/p>\n<p>The next thing you want to do is create a kernel extension so that as you make kernels you are able to tell the versions apart. What I usually do is place my initials and a number so that I can keep track.<\/p>\n<p><code># fakeroot make-kpkg  - -initrd - -append-to-version=-mw4 kernel_image kernel_headers<\/code><\/p>\n<p>After \u2013append-to-version= you write a string that will help you keep track of your kernel changes, it must begin with a minus (-) and must not contain whitespace.<\/p>\n<p>This will take awhile.  This can take 3-6 hours depending on your CPU and memory.<\/p>\n<p>After the successful kernel build, you can find two .deb packages in the directory you built the kernel in. If you were located in the linux directory, look in the directory above for the two .deb packages.<\/p>\n<p>Now you can install and create .deb files so you can take your kernel to another machine with similar hardware. Run these commands as root in order to install them into the boot directory and modify your \/boot\/grub\/menu.lst.<\/p>\n<p><code># dpkg -i linux-image-2.6.28.9mw4_2.6.28.9mw4-10.00.Custom_i386.deb<\/code><\/p>\n<p><code># dpkg -i linux-headers-2.6.28.9mw4_2.6.28.9mw4-10.00.Custom_i386.deb<\/code><\/p>\n<p>You should now be able to select and test the new kernel when you reboot.<\/p>\n<p>Now when I look in \/boot\/grub\/menu.lst I see listed my new kernel:<\/p>\n<p>## ## End Default Options ##<\/p>\n<p>title           Ubuntu 9.04, kernel 2.6.28.9mw4<br \/>\nuuid            10517256-c276-4517-821a-4986d477bb86<br \/>\nkernel          \/boot\/vmlinuz-2.6.28.9mw4 root=UUID=10517256-c276-4517-821a-4986d477bb86 ro quiet splash<br \/>\nquiet<\/p>\n<p>title           Ubuntu 9.04, kernel 2.6.28.9mw4 (recovery mode)<br \/>\nuuid            10517256-c276-4517-821a-4986d477bb86<br \/>\nkernel          \/boot\/vmlinuz-2.6.28.9mw4 root=UUID=10517256-c276-4517-821a-4986d477bb86 ro  single<\/p>\n<p>title           Ubuntu 9.04, kernel 2.6.28-11-generic<br \/>\nuuid            10517256-c276-4517-821a-4986d477bb86<br \/>\nkernel          \/boot\/vmlinuz-2.6.28-11-generic root=UUID=10517256-c276-4517-821a-4986d477bb86 ro quiet splash<br \/>\ninitrd          \/boot\/initrd.img-2.6.28-11-generic<br \/>\nquiet<\/p>\n<p>title           Ubuntu 9.04, kernel 2.6.28-11-generic (recovery mode)<br \/>\nuuid            10517256-c276-4517-821a-4986d477bb86<br \/>\nCaution: You will need space in the \/boot directory to save kernels as you build them. I typically build my \/boot directory with 500 MBs of space.<\/p>\n<p>Tip:<\/p>\n<p>Edit your timeout in the \/boot\/grub\/menu.lst and increase it when you are building and trying kernels. That way it will not fly by so fast.<\/p>\n<p>## timeout sec<br \/>\n# Set a timeout, in SEC seconds, before automatically booting the default entry<br \/>\n# (normally the first entry defined).<br \/>\ntimeout 8<\/p>\n<p>Tip:<\/p>\n<p>Comment out the hiddenmenu so that you will see the menu on boot.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Compile an Ubuntu 9.04 Kernel The purpose of this tutorial is to show you how to set up a kernel that is highly tuned for your CPU, in this case a Pentium 4 with hyperthreading for a workstation. Caution: If you do something wrong..it happens\u2026be sure to reboot and select an alternative kernel. You should&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/g33kinfo.com\/info\/compile-an-ubuntu-904-kernel\/\">Read More<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-264","post","type-post","status-publish","format-standard","hentry","category-info"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Compile an Ubuntu 9.04 Kernel - Linux Shtuff<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/g33kinfo.com\/info\/compile-an-ubuntu-904-kernel\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Compile an Ubuntu 9.04 Kernel - Linux Shtuff\" \/>\n<meta property=\"og:description\" content=\"Compile an Ubuntu 9.04 Kernel The purpose of this tutorial is to show you how to set up a kernel that is highly tuned for your CPU, in this case a Pentium 4 with hyperthreading for a workstation. Caution: If you do something wrong..it happens\u2026be sure to reboot and select an alternative kernel. You should... Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/g33kinfo.com\/info\/compile-an-ubuntu-904-kernel\/\" \/>\n<meta property=\"og:site_name\" content=\"Linux Shtuff\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:author\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:published_time\" content=\"2009-06-07T04:55:14+00:00\" \/>\n<meta name=\"author\" content=\"g33kadmin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/drsinger1111\" \/>\n<meta name=\"twitter:site\" content=\"@drsinger1111\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/compile-an-ubuntu-904-kernel\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/compile-an-ubuntu-904-kernel\\\/\"},\"author\":{\"name\":\"g33kadmin\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"headline\":\"Compile an Ubuntu 9.04 Kernel\",\"datePublished\":\"2009-06-07T04:55:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/compile-an-ubuntu-904-kernel\\\/\"},\"wordCount\":853,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"articleSection\":[\"General Info\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/g33kinfo.com\\\/info\\\/compile-an-ubuntu-904-kernel\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/compile-an-ubuntu-904-kernel\\\/\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/compile-an-ubuntu-904-kernel\\\/\",\"name\":\"Compile an Ubuntu 9.04 Kernel - Linux Shtuff\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\"},\"datePublished\":\"2009-06-07T04:55:14+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/compile-an-ubuntu-904-kernel\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/g33kinfo.com\\\/info\\\/compile-an-ubuntu-904-kernel\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/compile-an-ubuntu-904-kernel\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Compile an Ubuntu 9.04 Kernel\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\",\"name\":\"Linux Shtuff\",\"description\":\"Because I have CRS Syndrome...\",\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\",\"name\":\"g33kadmin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"contentUrl\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"width\":512,\"height\":512,\"caption\":\"g33kadmin\"},\"logo\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\"},\"description\":\"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\\\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....\",\"sameAs\":[\"https:\\\/\\\/thelinuxreport.com\",\"https:\\\/\\\/fb.me\\\/g33kinf0\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/drsinger1111\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Compile an Ubuntu 9.04 Kernel - Linux Shtuff","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/g33kinfo.com\/info\/compile-an-ubuntu-904-kernel\/","og_locale":"en_US","og_type":"article","og_title":"Compile an Ubuntu 9.04 Kernel - Linux Shtuff","og_description":"Compile an Ubuntu 9.04 Kernel The purpose of this tutorial is to show you how to set up a kernel that is highly tuned for your CPU, in this case a Pentium 4 with hyperthreading for a workstation. Caution: If you do something wrong..it happens\u2026be sure to reboot and select an alternative kernel. You should... Read More","og_url":"https:\/\/g33kinfo.com\/info\/compile-an-ubuntu-904-kernel\/","og_site_name":"Linux Shtuff","article_publisher":"https:\/\/fb.me\/g33kinf0","article_author":"https:\/\/fb.me\/g33kinf0","article_published_time":"2009-06-07T04:55:14+00:00","author":"g33kadmin","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/drsinger1111","twitter_site":"@drsinger1111","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/g33kinfo.com\/info\/compile-an-ubuntu-904-kernel\/#article","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/compile-an-ubuntu-904-kernel\/"},"author":{"name":"g33kadmin","@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"headline":"Compile an Ubuntu 9.04 Kernel","datePublished":"2009-06-07T04:55:14+00:00","mainEntityOfPage":{"@id":"https:\/\/g33kinfo.com\/info\/compile-an-ubuntu-904-kernel\/"},"wordCount":853,"commentCount":0,"publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"articleSection":["General Info"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/g33kinfo.com\/info\/compile-an-ubuntu-904-kernel\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/g33kinfo.com\/info\/compile-an-ubuntu-904-kernel\/","url":"https:\/\/g33kinfo.com\/info\/compile-an-ubuntu-904-kernel\/","name":"Compile an Ubuntu 9.04 Kernel - Linux Shtuff","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/#website"},"datePublished":"2009-06-07T04:55:14+00:00","breadcrumb":{"@id":"https:\/\/g33kinfo.com\/info\/compile-an-ubuntu-904-kernel\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/g33kinfo.com\/info\/compile-an-ubuntu-904-kernel\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/g33kinfo.com\/info\/compile-an-ubuntu-904-kernel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/g33kinfo.com\/info\/"},{"@type":"ListItem","position":2,"name":"Compile an Ubuntu 9.04 Kernel"}]},{"@type":"WebSite","@id":"https:\/\/g33kinfo.com\/info\/#website","url":"https:\/\/g33kinfo.com\/info\/","name":"Linux Shtuff","description":"Because I have CRS Syndrome...","publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/g33kinfo.com\/info\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547","name":"g33kadmin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","url":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","contentUrl":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","width":512,"height":512,"caption":"g33kadmin"},"logo":{"@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif"},"description":"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....","sameAs":["https:\/\/thelinuxreport.com","https:\/\/fb.me\/g33kinf0","https:\/\/x.com\/https:\/\/twitter.com\/drsinger1111"]}]}},"_links":{"self":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/264","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/comments?post=264"}],"version-history":[{"count":0,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/264\/revisions"}],"wp:attachment":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/media?parent=264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/categories?post=264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/tags?post=264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}