<?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>BruceTonge.Info &#187; Linux</title>
	<atom:link href="http://www.brucetonge.info/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brucetonge.info</link>
	<description>It&#039;s not difficult really...</description>
	<lastBuildDate>Wed, 23 Jun 2010 15:25:16 +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>Altiris Linux PXE Kernel Update</title>
		<link>http://www.brucetonge.info/2009/08/20/altiris-linux-pxe-kernel-update/</link>
		<comments>http://www.brucetonge.info/2009/08/20/altiris-linux-pxe-kernel-update/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 16:30:22 +0000</pubDate>
		<dc:creator>OKButton</dc:creator>
				<category><![CDATA[Altiris]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[PXE]]></category>

		<guid isPermaLink="false">http://www.brucetonge.info/?p=83&#038;iphone=true</guid>
		<description><![CDATA[I have been working on producing a method to update the kernel within the altiris DS PXE. Here is my how to for compiling a new kernel and integrating it into bootwiz. How to build a kernel First of all I built a virtual machine on my desktop using vmware server. I then installed Debian [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working on producing a method to update the kernel within the altiris DS PXE. Here is my how to for compiling a new kernel and integrating it into bootwiz.</p>
<p><span id="more-83"></span></p>
<h3>How to build a kernel</h3>
<p>First of all I built a virtual machine on my desktop using vmware server. I then installed Debian 5 on it using the net install ISO to make a minimal install. I didn&#8217;t set it up with any roles i.e. desktop.<br />
Once booted install SSH. Logging on as root and enter:</p>
<p><code>apt-get install ssh</code></p>
<p>After this point you can access the vm with putty and copy files to and from the vm with Winscp. You could install a samba server of ftp but I am not going to cover this here.</p>
<p>Now we need to install all the software needed to allow us to compile kernel sources. This is done using the following command:</p>
<p><code>apt-get install gcc-4.3 make wget bzip2 build-essential</code></p>
<p>These tools are as follows:</p>
<ul>
<li> gcc-4.3 the GNU C Compiler</li>
<li> make the tool that runs the compile script</li>
<li> wget a tool to download files from http servers</li>
<li> bzip2 a compression tool</li>
<li> build-essentials tools and libraries used to compile</li>
</ul>
<p>Once this is complete you have a system that is setup to compile kernels and driver modules.<br />
We now need to get some files from the altiris system.<br />
First we need the config file from the altiris Linux boot environment. The config file holds all the settings that were used to build the kernel that is used in the current build and is a good starting place for a new kernel.<br />
To get it we need to send a job down to a machine to boot the Linux environment and run the following script:</p>
<p><code>cp /proc/config.gz /mnt/ds<br />
gzip -d /mnt/ds/config.gz</code></p>
<p>This will copy the config file from the boot environment and put it into the root of your deployment share.</p>
<p>Now we also need the rootfs file. This file is like a virtual disk that holds the file system for the Linux been environment we may need to add some files to this or delete as needed. This file is located at \bootwiz\platforms\linux\x86\base\rootfs.</p>
<p>Now you have these files copy them over to the vm using Winscp and place them in the /root directory.</p>
<p>Now we need to get hold of the source code for the kernel that we want to use. If you just want to make new driver modules you need the same version as is used in your existing build (currently 2.6.18.8).<br />
you can download the kernel from <a href="http://www.kernel.org/pub/linux/kernel/v2.6/" target="_blank">here</a> you need a kernel that follows the name linux-2.6.**.*.tar.bz2 it should be about 40mb + in size. I have had good results with 2.6.24.7. Once you have selected the kernel you need right click on it and copy the link location. Then go to your putty and enter the following commands:</p>
<p><code>cd /usr/src<br />
wget http://url to file</code></p>
<p>Instead of having the type &#8220;http://url to file your can right click and your copied location will be pasted in saving your figures. press enter and your kernel will be downloaded.<br />
Once finished you need to extract the kernel from the archive as bellow:</p>
<p><code>tar -jxf linux-2.6.**.*.tar.bz2</code></p>
<p>This will extract the source to a folder of the same name.<br />
To make life easier I would delete the archive now but its up to you.<br />
Now we need to move the kernel source to a folder called linux this is for compatibility with making new drivers.</p>
<p><code>mv linux-2.6.**.*/ linux/</code></p>
<p>Now we copy the config file into the kernel source folder and make it hidden (this is how the compiler likes it).</p>
<p><code>cp /root/config /usr/src/linux/.config</code><strong> </strong></p>
<p><strong>Dont forget the . in .config.</strong></p>
<p>Ok you now have the same conditions that the altiris developers had before they made there kernel. But we want more in our kernel so its time to make some changes.</p>
<p><code>cd linux<br />
make menuconfig</code></p>
<p>Now you need to go to the bottom of the menu and select load config it should already be filled with .config so select ok.<br />
Now you can go through the menu making the changes you require. you probably want to add support for a new chip set of SATA controller so have a look in the drivers section for what you require. I recommend compiling in your options a posed to making modules as this takes up space in the rootfs later on which has a fixed max size. So set your options to have a * a posed to a M if possible.<br />
When finished exit out and save your config.<br />
Now you can compile your kernel enter the following:</p>
<p><code>make<br />
make modules_install<br />
</code></p>
<p>That&#8217;s it, watch the screen go flying by for a while and eventually it will finish if it ends with lines with ERROR: in them something has gone wrong. But hopefully this wont happen.<br />
Your new kernel will be waiting for you in the folder /usr/src/linux/arch/x86/boot/ the kernel file is the one called bzImage.<br />
Copy this out to a safe place and rename to &#8220;linux&#8221; all lower case.<br />
Now we need to mount the rootfs file to make some changes.</p>
<p><code>mkdir /mnt/rootfs<br />
mount -o loop /root/rootfs /mnt/rootfs<br />
cd /mnt/rootfs</code></p>
<p>you are now inside the rootfs file. We now need to update the modules for the kernel:</p>
<p><code>cd lib/modules<br />
rm -r 2.6.18.8  (or what ever folder is there)<br />
cp -r /lib/modules/2.6.**.* /mnt/rootfs/lib/modules/2.6.**.*</code></p>
<p>You will probably also want to update your pci detection list. to do this enter:</p>
<p><code>update-pciids<br />
cp /usr/share/misc/pci.ids /mnt/rootfs/usr/share/pci.ids<br />
cp /usr/share/misc/pci.ids /mnt/rootfs/usr/local/share/pci.ids</code></p>
<p>You can make more changes if needed. When finished unmount the rootfs:</p>
<p><code>umount /mnt/rootfs</code></p>
<p>now copy your /root/rootfs file out to some ware safe.<br />
Thats it a new kernel is compiled.<br />
To use this kernel and root fs over right the linux and rootfs files in the \bootwiz\platforms\linux\x86\base\ folder with the onse you have just made.<br />
Then make a new Linux PXE option or edit an existing one to force a rebuild. Using the regenerate images doesn&#8217;t work at least in 6.9 sp2 of the DS.<br />
Now boot your kernel and see how it goes.<br />
If you want to see your kernel boot and get a bit more debug info from it you can remove the quiet commend from the pxeconfig file located in \bootwiz\platforms\linux\x86\misc\ you also need to rebuild the image after this as above.</p>
<h3>How to build a driver module</h3>
<p>Now you have built a kernel you can build driver modules for that kernel (important)<br />
when you have found your driver source files copy them and extract them to a folder I use /usr/scr/drivers/<br />
then cd in to the driver directory you might find another folder in that named src if so cd into there as well. you should now be in a folder with files with extensions of .c and .h. enter the following commands:</p>
<p><code>make -C /usr/src/linux SUBDIRS=$(pwd) modules</code></p>
<p>You will now have a .ko file that was not there before this is your driver and it needs to be copied to your bootwiz folder to the following directory string.<br />
&#8220;.\Boozwiz\platforms\Linux\x86\Drivers\CUSTOM\lib\modules\_ver_\kernel\opt\bdc&#8221;<br />
You will need to make all those folder if they are not already there. Then recreate your PXE image as before.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.brucetonge.info/2009/08/20/altiris-linux-pxe-kernel-update/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.brucetonge.info/2009/08/20/altiris-linux-pxe-kernel-update/&amp;title=Altiris+Linux+PXE+Kernel+Update" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.brucetonge.info/2009/08/20/altiris-linux-pxe-kernel-update/&amp;title=Altiris+Linux+PXE+Kernel+Update" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.brucetonge.info/2009/08/20/altiris-linux-pxe-kernel-update/&amp;title=Altiris+Linux+PXE+Kernel+Update&amp;desc=I%20have%20been%20working%20on%20producing%20a%20method%20to%20update%20the%20kernel%20within%20the%20altiris%20DS%20PXE.%20Here%20is%20my%20how%20to%20for%20compiling%20a%20new%20kernel%20and%20integrating%20it%20into%20bootwiz.%0D%0A%0D%0A%0D%0AHow%20to%20build%20a%20kernel%0D%0AFirst%20of%20all%20I%20built%20a%20virtual%20machine%20on%20my%20desktop%20using%20vmware%20server.%20I%20then%20installed%20Debian%205%20on%20i" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.brucetonge.info/2009/08/20/altiris-linux-pxe-kernel-update/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.brucetonge.info/2009/08/20/altiris-linux-pxe-kernel-update/&amp;bm_description=Altiris+Linux+PXE+Kernel+Update&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.brucetonge.info/2009/08/20/altiris-linux-pxe-kernel-update/&amp;title=Altiris+Linux+PXE+Kernel+Update" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.brucetonge.info/2009/08/20/altiris-linux-pxe-kernel-update/&amp;title=Altiris+Linux+PXE+Kernel+Update" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.brucetonge.info/2009/08/20/altiris-linux-pxe-kernel-update/&amp;title=Altiris+Linux+PXE+Kernel+Update" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.brucetonge.info/2009/08/20/altiris-linux-pxe-kernel-update/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Altiris+Linux+PXE+Kernel+Update+-+http://b2l.me/qc64j&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.brucetonge.info/2009/08/20/altiris-linux-pxe-kernel-update/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
