{"id":61,"date":"2011-09-28T01:04:54","date_gmt":"2011-09-28T01:04:54","guid":{"rendered":"http:\/\/info.ffteixeira.net\/2011\/09\/28\/creating-a-light-kernel-configuration\/"},"modified":"2011-09-28T01:04:54","modified_gmt":"2011-09-28T01:04:54","slug":"creating-a-light-kernel-configuration","status":"publish","type":"post","link":"https:\/\/blog.ffteixeira.net\/?p=61","title":{"rendered":"Creating a light kernel configuration"},"content":{"rendered":"<div>Everybody has their own way they make their kernel configurations usually starting with an allnoconfig, defconfig, distribution config etc.<\/div>\n<div>There happens to be a very effective and easier way, thanks to Pappy Mcfae&#8217;s kernel seeds.<\/div>\n<h2>Getting the base configuration file<\/h2>\n<p><!--more--><\/p>\n<div>Everybody has their own way they make their kernel configurations usually starting with an allnoconfig, defconfig, distribution config etc.<\/div>\n<div>There happens to be a very effective and easier way, thanks to Pappy Mcfae&#8217;s kernel seeds.<\/div>\n<h2>Getting the base configuration file<\/h2>\n<p><!--more-->The base configuration that is recommended is what we&#8217;re going to call a a kernel &#8220;seed&#8221;, these are from <a href=\"http:\/\/kernel-seeds.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">kernel-seeds.org<\/a> which are created and maintained by Pappy Mcfae<br \/>\nCurrently there is none specifically for the zen kernel, but a vanilla one will suffice<br \/>\nFirst of all, be in your kernel source directory (if you couldn&#8217;t figure that out yourself you should probably quit the tutorial for now) &#8211; then pick the kernel &#8220;vanilla&#8221; seed by navigation on <a href=\"http:\/\/kernel-seeds.org\/seeds\/\" target=\"_blank\" rel=\"noopener noreferrer\">THIS<\/a> page. (pick 32 or 64-bit, then find the configuration for the most modern\/matching vanilla version)<\/p>\n<p>I&#8217;ll be demonstrating an example with a 2.6.31.6 64_bit configuration for the 2.6.31-zen8 kernel, obviously yours may vary.<\/p>\n<blockquote>\n<pre>cd \/usr\/src\/linux-2.6-zen\nwget http:\/\/kernel-seeds.org\/seeds\/64_bit\/vanilla\/2.6.31.6-x86_64-07.config\n# Move the config file to \".config\"\nmv 2.6.31.6-x86_64-07.config .config<\/pre>\n<\/blockquote>\n<p>Now since the seed isn&#8217;t made for our specific kernel version (it&#8217;s not even made for the zen kernel at all), you want to run a &#8220;make oldconfig&#8221; which will prompt all new options in the kernel version (Some of the code that zen has but 2.6.31.6 doesn&#8217;t in this case)<\/p>\n<blockquote>\n<pre>make oldconfig\n# Answer y\/n\/m\/? to all of the prompt, this isn't required -- just recommended<\/pre>\n<\/blockquote>\n<h2>Choosing some custom options<\/h2>\n<p>The options chosen in the kernel seed are basic, and it doesn&#8217;t include any drivers or file systems generally. There are probably some options you want to customize that are basic, here are some defaults and recommendations for the Zen Kernel if it is being used on a desktop, you can choose any of these if you desire &#8211; they are recommended for best desktop performance<\/p>\n<p>Remember! You can search in menuconfig by typing &#8220;\/&#8221;<\/p>\n<blockquote>\n<pre>CONFIG_CPU_BFS=y # BFS is recommended for every desktop system without 4096 CPUs\nCONFIG_CPU_BFS_AUTOISO=y # Will run X as sched_iso automatically, but not other applications\n# you can run apps as sched_iso with \"schedtool -I appname\"\n# CONFIG_CPU_CFS=n<\/pre>\n<p>CONFIG_NO_HZ=n # set to N on a desktop system, Y on a notebook environment where battery life is important<br \/>\nCONFIG_HZ_1000=y<br \/>\nCONFIG_HZ=1000 # 1000HZ for any desktop system, 100\/250 is sufficient for a server system<\/p>\n<p>CONFIG_IOSCHED_BFQ=y<br \/>\nCONFIG_DEFAULT_BFQ=y<br \/>\nCONFIG_DEFAULT_IOSCHED=&#8221;bfq&#8221; # BFQ has been tested to be the best performer on most file systems and in most scenarios<br \/>\n# I\/O scheduler can be changed at boot time or during run time as well<\/p>\n<p>CONFIG_PREEMPT=y # NOT Voluntary in ANY situation, PREEMPT_NONE on server systems<br \/>\nCONFIG_PREEMPT_RCU # 2.6.31 only, in 2.6.31 CONFIG_PREEMPT_TREE_RCU, and adjust the fanout based on the help option<\/p>\n<p>CONFIG_KERNEL_DEBUG=y<br \/>\nCONFIG_FRAME_POINTER=y # Will provide useful debugging traces if you encounter a bug<br \/>\n# Will make binary sizes slightly bigger, un-measurable speed decrease (you won&#8217;t notice a thing, so ENABLE IT!)<br \/>\n# IF set to N then you will get useless traces that will make debugging impossible<br \/>\n# This should never be enabled when using a Zen kernel or ANY kernel for that matter<\/p><\/blockquote>\n<p>Those are simply general recommendations for the best performance\/results. Frame pointers are criticial if you ever hit a bug, and they won&#8217;t affect your system speed by a measurable margin.<\/p>\n<h2>Configuring CPU Options, Drivers, and File Systems<\/h2>\n<p>Ok, only you can know your CPU options, you need to do a &#8220;cat \/proc\/cpuinfo&#8221; any options here will be found in &#8220;Processor Types and Features&#8221;. Things such as power management, suspend, or tuxonice you should configure\/set up yourself (no explanation is needed because everybody will use different things)<\/p>\n<p>To determine your drivers execute the following:<\/p>\n<blockquote>\n<pre>lspci -n<\/pre>\n<\/blockquote>\n<p>Wait a minute! That gave me junk!<br \/>\nA: No, it&#8217;s useful and should look something like this<\/p>\n<blockquote>\n<pre>00:00.0 0600: 8086:277c (rev c0)\n00:01.0 0604: 8086:277d (rev c0)\n00:1c.0 0604: 8086:27d0 (rev 01)\n00:1c.4 0604: 8086:27e0 (rev 01)\n00:1c.5 0604: 8086:27e2 (rev 01)\n00:1d.0 0c03: 8086:27c8 (rev 01)\n00:1d.1 0c03: 8086:27c9 (rev 01)\n00:1d.2 0c03: 8086:27ca (rev 01)\n00:1d.3 0c03: 8086:27cb (rev 01)\n00:1d.7 0c03: 8086:27cc (rev 01)\n00:1e.0 0604: 8086:244e (rev e1)\n00:1f.0 0601: 8086:27b8 (rev 01)\n00:1f.1 0101: 8086:27df (rev 01)\n00:1f.2 0101: 8086:27c0 (rev 01)\n00:1f.3 0c05: 8086:27da (rev 01)\n01:00.0 0300: 10de:0292 (rev a1)\n03:00.0 0200: 10ec:8168 (rev 01)\n04:00.0 0106: 197b:2360 (rev 02)\n05:00.0 0401: 1102:0008\n05:03.0 0c00: 1106:3044 (rev 80)<\/pre>\n<\/blockquote>\n<p>I should not need to say that yours are different.<\/p>\n<p>Now, head over to the following web page:<br \/>\n<a href=\"http:\/\/kmuto.jp\/debian\/hcl\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/kmuto.jp\/debian\/hcl\/<\/a><\/p>\n<p>Here, you need to paste the OUTPUT of &#8220;lspci -n&#8221;<br \/>\nDo this, and press &#8220;Check&#8221;<\/p>\n<p>Now you will see the Vendor, If it works, the device name, the driver name (which is what you want!) , and a kernel version that it is supported in.<\/p>\n<p>Now you want to look at the driver names and scroll through the config and select what you need\/what they are. Enable things like &#8220;ATAPI Floppy&#8221; or &#8220;ATAPI Disk Support&#8221; too if you have a floppy or ide cd\/dvd\/bd drive (just use common sense basically)<\/p>\n<p>Remember, &#8220;\/&#8221; in menuconfig searches! (type driver name or device name to find location of drivers)<\/p>\n<p>NEXT!<br \/>\nYou need to configure your filesystems, you should know this, if not \/etc\/fstab will tell you of all the ones that you mount (or keep track of mounting)<br \/>\nThese are selected in the &#8220;File Systems&#8221; menu and is very easy to do.<\/p>\n<p>Powered by <a title=\"Light kernel\" href=\"http:\/\/zen-kernel.org\/tutorials\/creating-a-light-kernel-configuration\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/zen-kernel.org\/tutorials\/creating-a-light-kernel-configuration<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Everybody has their own way they make their kernel configurations usually starting with an allnoconfig, defconfig, distribution config etc. There happens to be a very effective and easier way, thanks to Pappy Mcfae&#8217;s kernel seeds. Getting the base configuration file<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-61","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.ffteixeira.net\/index.php?rest_route=\/wp\/v2\/posts\/61","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ffteixeira.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ffteixeira.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ffteixeira.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ffteixeira.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=61"}],"version-history":[{"count":0,"href":"https:\/\/blog.ffteixeira.net\/index.php?rest_route=\/wp\/v2\/posts\/61\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.ffteixeira.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=61"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ffteixeira.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=61"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ffteixeira.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=61"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}