<?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>OpenBSD and FreeBSD resources &#187; building</title>
	<atom:link href="http://purebsd.com/tag/building/feed" rel="self" type="application/rss+xml" />
	<link>http://purebsd.com</link>
	<description></description>
	<lastBuildDate>Tue, 01 Jun 2010 06:01:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Building a custom kernel</title>
		<link>http://purebsd.com/building-a-custom-kernel.html</link>
		<comments>http://purebsd.com/building-a-custom-kernel.html#comments</comments>
		<pubDate>Mon, 31 May 2010 23:09:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[OpenBSD]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[building]]></category>
		<category><![CDATA[kernel]]></category>

		<guid isPermaLink="false">http://purebsd.com/?p=10</guid>
		<description><![CDATA[Configuring the kernel Copy these two files to a directory where you have write access as a normal user: cp /usr/src/sys/arch/i386/conf/GENERIC /home/alex/MYCENE/MYCENE cp /usr/src/sys/conf/GENERIC /home/alex/MYCENE/MYCENE-common Edit the line in the new file called MYCENE that reads: include "../../../conf/GENERIC" and replace it by: include "/home/alex/MYCENE/MYCENE-common" The directory /home/alex is my home directory, the directory /home/alex/MYCENE is the name of [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Configuring the kernel</strong></p>
<p>Copy these two files to a directory where you have write access as a normal user:</p>
<p><code> cp /usr/src/sys/arch/i386/conf/GENERIC /home/alex/MYCENE/MYCENE<br />
cp /usr/src/sys/conf/GENERIC /home/alex/MYCENE/MYCENE-common<br />
</code><br />
Edit the line in the new file called <code>MYCENE</code> that reads:</p>
<p><code> include "../../../conf/GENERIC"</code></p>
<p>and replace it by:</p>
<p><code> include "/home/alex/MYCENE/MYCENE-common"</code></p>
<p>The directory <code>/home/alex</code> is my home directory, the directory <code>/home/alex/MYCENE</code> is the name of the machine for which we&#8217;ll build a new kernel. In that directory we just copied the kernel configuration files <code>MYCENE</code> and <code>MYCENE-common</code>. The file <code>MYCENE</code> lists the machine dependend kernel configuration options. In <code>MYCENE-common</code> are some platform independend options. Edit those two files to your own liking and the machine&#8217;s needs.</p>
<p>More info on this follows soon..</p>
<p><strong>Compiling the kernel</strong></p>
<p>Now, in the directory <code>/home/alex/MYCENE/</code>, we create a directory called build for the necessary files to build a working kernel and then we issue the following configuration command to create all the necessary files in the previously created <code>build/</code> directory:</p>
<p><code> config -s /sys -b build MYCENE</code></p>
<p>After that, we change directory to <code>build/</code> and create the <code>.depend</code> files necessary for the success of compilation process:</p>
<p><code> make depend</code></p>
<p>Only then, we can start to compile our neat little kernel and eat some pizza:</p>
<p><code> make</code></p>
<p><strong>Installing the kernel</strong></p>
<p>Now, if we&#8217;re lucky, <code>make</code> has made us a shiny new kernel, located in <code>build/</code> as <code>bsd</code>.<br />
<code>su</code> to root, save <code>/bsd</code> to <code>/bsd-dist</code> if the current <code>/bsd</code> kernel image is the one installed by the installation process. Else save it as <code>/bsd-old</code>. This way we&#8217;ll be able to boot a working kernel if our new one is broken in some way.<br />
Finally, we can safely copy <code>~alex/MYCENE/build/bsd</code> over the old <code>/bsd</code> kernel image and issue a <code>reboot</code> to test it.</p>
<p><code> # su<br />
# cd /<br />
# cp bsd bsd-dist<br />
# cp ~alex/MYCENE/build/bsd .<br />
# reboot</code></p>
]]></content:encoded>
			<wfw:commentRss>http://purebsd.com/building-a-custom-kernel.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

