<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>linuxbuddies.com &#187; kernel compilation</title>
	<atom:link href="http://linuxbuddies.com/tag/kernel-compilation/feed/" rel="self" type="application/rss+xml" />
	<link>http://linuxbuddies.com</link>
	<description>For linux documentations.</description>
	<lastBuildDate>Fri, 11 Sep 2009 10:11:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>kernel compilation</title>
		<link>http://linuxbuddies.com/2009/01/20/kernel-compilation/</link>
		<comments>http://linuxbuddies.com/2009/01/20/kernel-compilation/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 19:10:44 +0000</pubDate>
		<dc:creator>Riyesh</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[server tweak]]></category>
		<category><![CDATA[compilation]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[kernel compilation]]></category>
		<category><![CDATA[updating]]></category>

		<guid isPermaLink="false">http://linuxbuddies.com/?p=307</guid>
		<description><![CDATA[Kernel 
 It makes sure that all processes in the system works fine
Rebuilding

It is done to optimize the kernel to suit our requirements as well as make it more secure from internet attacks
 Steps

1. Determining the current hardware 
 This is required during configuration process to enable hardwares that our new kernel has to support.
Commands ...]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-thumbnail wp-image-309" title="kernel" src="http://linuxbuddies.com/wp-content/uploads/2009/01/kernel-150x150.gif" alt="kernel" width="150" height="150" /><strong>Kernel </strong></p>
<p><strong><span style="font-weight: normal;"> It makes sure that all processes in the system works fine</span></strong></p>
<p><strong><span style="font-weight: normal;"><span>Rebuilding</span><br />
</span></strong></p>
<p><strong><span style="font-weight: normal;">It is done to optimize the kernel to suit our requirements as well as make it more secure from internet attacks</span></strong></p>
<p><span><strong> Steps</strong></span></p>
<p><span><strong></strong></span><br />
<span>1. Determining the current hardware </span><br />
 This is required during configuration process to enable hardwares that our new kernel has to support.<br />
Commands used for the same are:</p>
<p> </p>
<p> </p>
<div class="codetitle" style="padding-left: 30px; "><strong><br />
</strong></div>
<div class="codecontent" style="padding-left: 30px; ">/sbin/lspci </div>
<div class="codecontent" style="padding-left: 30px; ">cat /proc/cpuinfo</div>
<div class="codecontent" style="padding-left: 30px; "></div>
<p><span>2. Download the Source</span><br />
latest sources and its corresponding patches are always available from<a class="postlink" href="http://www.kernel.org/pub/linux/kernel/">http://www.kernel.org/pub/linux/kernel/</a><br />
 As of today (Oct 21, 2008) the latest available source is <a class="postlink" href="http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.27.2.tar.gz">linux-2.6.27.2.tar.gz</a> and the patch is <a class="postlink" href="http://www.kernel.org/pub/linux/kernel/v2.6/patch-2.6.27.2.gz">patch-2.6.27.2.gz</a></p>
<p><span>Apply the patches</span></p>
<p>Extract the source using tar -zxvf and patch using gunzip to /usr/src/ folder.</p>
<p>Now cd to linux-2.6.27.2 and apply the patch as shown below:</p>
<div class="codetitle"><strong><br />
</strong></div>
<div class="codecontent" style="padding-left: 30px; "> patch -p1 &lt;../patch-2.6.27.2</div>
<div class="codecontent" style="padding-left: 30px; "></div>
<p><span>4. Configuration</span><br />
 You may copy the current configuration by copying the file .config.</p>
<p> </p>
<p style="padding-left: 30px; ">cp ../linux/.config config.old</p>
<p> Begin the configuration by wiping out all previous configurations and resetting the source directory to a pristine state:</p>
<p> </p>
<div class="codetitle"><strong> </strong></div>
<div class="codecontent" style="padding-left: 30px; ">$ make mrproper</div>
<p> </p>
<p>Run the configuration utility. Either of the below step can be used to run the configuration utility:</p>
<p> </p>
<div class="codetitle" style="padding-left: 30px; "><strong> </strong> make config &#8211; least friendly tool</div>
<div class="codetitle" style="padding-left: 30px; "></div>
<div class="codecontent" style="padding-left: 30px; ">  make oldconfig         (- will read the defaults from the existing .config file. Note that oldconfig will only work within the same major version of the kernel. You cannot, for example, use a 2.4.x .config with the 2.6.x kernel.)</div>
<div class="codecontent" style="padding-left: 30px; "></div>
<div class="codecontent" style="padding-left: 30px; "> make menuconfig      (- Most commonly and recommended method. Gives you a graphical front end to select your options)</div>
<p><span>5. Start Build</span><br />
Clean before the build:</p>
<p> </p>
<div class="codetitle"><strong> </strong></div>
<div class="codecontent" style="padding-left: 30px; "> make clean</div>
<div class="codecontent" style="padding-left: 30px; "></div>
<p> Start the build after cleaning process:</p>
<p> </p>
<div class="codetitle" style="padding-left: 30px; ">make bzImage</div>
<p><span>6. Build and install all the loadable modules</span></p>
<div class="codetitle"><strong> </strong></div>
<div class="codecontent" style="padding-left: 30px; ">  make modules<br />
 make modules_install</div>
<div class="codecontent" style="padding-left: 30px; "></div>
<p><span>7. Copy the required files and generate initrd</span><br />
 Copy the files over for the kernel itself</p>
<div class="codetitle"><strong> </strong></div>
<div class="codecontent" style="padding-left: 30px; "> cp .config /boot/config-2.6.27.2<br />
 cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.27.2<br />
 cp System.map /boot/System.map-2.6.27.2<br />
 mkinitrd /boot/initrd-2.6.27.2.img 2.6.27.2</div>
<p> If you come across an error like: &#8220;/dev/mapper/control: open failed: No such file or directory&#8221; , Run the following commands:</p>
<div class="codetitle"><strong> </strong></div>
<div class="codecontent" style="padding-left: 30px; ">  rm -rf /boot/initrd-2.6.27.2.img<br />
  mkinitrd &#8211;omit-lvm-modules /boot/initrd-2.6.27.2.img 2.6.27.2</div>
<p><span>8. Configure Grub &amp; enable failsafe</span><br />
  Open grub.conf file<br />
  Add the below code to the top of the kernel list:</p>
<p> </p>
<div class="codecontent" style="padding-left: 30px; ">title Red Hat Linux (2.6.27.2)<br />
root (hd0,0)<br />
kernel /vmlinuz-2.6.27.2 ro root=LABEL=/<br />
initrd /initrd-2.6.27.2.img</div>
<div class="codecontent" style="padding-left: 30px; "></div>
<p>  Set the default value to your working kernel. (NOTE: NOT NEW KERNEL)<br />
  Now save and exit from grub.conf file and enter into grub mode by typing &#8220;grub&#8221; from bash prompt<br />
  And set to boot from newly compiled kernel during next reboot:</p>
<p> </p>
<div class="codetitle" style="padding-left: 30px; "><strong> </strong> savedefault &#8211;default=0 &#8211;once</div>
<div class="codetitle" style="padding-left: 30px; "></div>
<p> If your server is up, you are done with your new kernel. Open the file grub.conf and change the value of default to &#8220;0&#8243;</p>
<p><span><span><strong>Congratulations! You are done with your new kernel.</strong></span></span></p>
<p> </p>
<p><strong><span style="font-weight: normal;"><br />
</span></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://linuxbuddies.com/2009/01/20/kernel-compilation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
