Back to <ahref="../installation.html">Installing Haiku</a>
</p>
</div>
<divclass="content">
<p>The following will show you step by step how to get Haiku's source code and build tools, how to compile it all and how to generate either a VMWare image or directly install onto a partition or USB drive. You'll also learn how to exchange data with an image or an installation on it's partition.</p>
<p><b>Note:</b><i>This guide is based on Ubuntu 8.10, but should generally work the same way on all other Linux distributions. Some changes may apply.</i></p>
<h1>Downloading the tools and the Haiku source</h1>
<p>If there are any errors while checking out the source, just cd into the trunk directory and type <spanclass="cli">svn update</span> to get any missed files.<br/>
<p>Now you could already start to build RAW or VMWare images. Before we come to that, however, let's have a look at the <spanclass="cli">UserBuildConfig</span> that can be used to customize and automate some things.</p>
<p>In <spanclass="path">trunk/haiku/build/jam/</span> there's a <spanclass="cli">UserBuildConfig.ReadMe</span> that explains various options. <b>Don't</b> simply rename it and use it as <spanclass="cli">UserBuildConfig</span>!</p>
<p>You start by duplicating the <spanclass="cli">UserBuildConfig.sample</span> and the remove the<spanclass="cli">.sample</span> suffix to get your <spanclass="cli">UserBuildConfig</span>. From the <spanclass="cli">.ReadMe</span> you can copy interesting parts into your config and customize them there.</p>
<li><p>There are several optional software packages available, that are dowloaded at build time if they haven't been so already. For a list of all available packages, see <spanclass="path">haiku/trunk/build/jam/OptionalPackages</span>. Here's an example:</p>
<li><p>The build process can be fine tuned until it fits your needs. You could create your own folder <spanclass="path">haiku/trunk/user_data/</span> and put files there that are then copied or unzipped into the image. Zipping is important when dealing with Haiku files with their attributes, because zipping them up will preserve them on non-BFS partitions.<br/>
<p>The first line defines the location in the image where the archive will be unzipped (here: <spanclass="path">/boot/home/</span>). Deeper hierarchies are separated with a blank instead of the usual "<spanclass="path">/</span>" (see the setting of the timezone above).<br/>
The second line is the location of the zip file. <tt>$(HAIKU_TOP)</tt> is the lowest level of the checked out source tree, normally <spanclass="path">haiku/trunk/</span>.</p>
<p>In the same way, you use <tt>CopyDirectoryToHaikuImage</tt> and <tt>AddFilesToHaikuImage</tt> to copy whole directories or single files into the image.</p></li>
<li><p>The above commands are executed when building any kind of image. "Build Profiles" provide the means to set commands specifically for different configurations.<br/>
These are two profiles, one for building and installing an image directly onto a partition and the other to generate a VMWare image:</p>
<p>Before you use this profile, you should make sure that it's really the correct partition on the right harddisk or USB-stick, for example by using Ubuntu's partition editor <spanclass="app">GParted</span>.</p></li>
<p><b>Note:</b><i>when building an a USB memory stick, you wouldn't specify the partition number in the disk entry (ex. </i><spanclass="path">/dev/sdb</span><i> instead of </i><spanclass="path">/dev/sdb1</span><i>). This will erase your whole flash drive and it's partitions, so be cautious to use the correct drive name!</i></p>
<p>Besides these user build profiles, there are also official release profiles, see <spanclass="cli">ReleaseBuildProfiles</span> in the same folder. The profiles <i>alpha-raw</i> and <i>alpha-vmware</i> will build all officially planned components for the alpha release. They are invoked just like the user profiles, see <ahref="#build_vmimage">Building a VMWare Image</a> a bit further down.
<p>Just replace the <tt>{components}</tt> with the program/component to be updated, e.g. <tt>kernel</tt>, <tt>StyledEdit</tt> or <tt>libmedia.so</tt> or more than one, separated with blanks. <spanclass="path">haiku/build/jam/HaikuImage</span> lists all possible "targets".</p>
<p>The resulting image can be run in VMPlayer with an associated <ahref="http://haiku-files.org/files/haiku.vmx">.vmx</a> file (There's also a <spanclass="cli">.vmx</span> file in <spanclass="path">haiku/3rdparty/vmware/</span>).</p>
<p>If you installed Haiku directly onto a USB-stick, you just have to make sure the boot order in the BIOS looks first for USB devices to have Haiku boot right up from the stick.</p>
<p>Using build profiles has another advantage: You can mount a VMWare image or the partition of a Haiku installation to transfer data. Navigate to <spanclass="path">haiku/trunk/</span> and simply enter:</p>