[haiku-development] Building and Testing Haiku on Ubuntu, Step-by-Step

  • From: "Ryan Leavengood" <leavengood@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sat, 23 Jun 2007 11:56:16 -0400

I received my new Dell with Ubuntu yesterday. In addition to wanting
this machine for future Haiku testing, I wanted to build Haiku on
Linux. With help from an article on our web-site
(http://haiku-os.org/documents/dev/getting_linux_developer_tools) I
got things working pretty fast.

I was also extremely pleased with how fast Haiku compiled on this new
machine. Once I had the cross-tools built, I built the full
haiku.image in about 13 minutes. I was quite shocked actually since
building takes much, much longer on my old Celeron 1.33 GHz which I
run BeOS R5 on.

Though the aforementioned article is pretty good, I wanted to document
the step-by-step instructions on how to get Haiku compiling on a fresh
Ubuntu 7.04 (Feisty Fawn) install.

1. Install the needed packages for building:

sudo apt-get install subversion autoconf automake texinfo flex bison
gawk build-essential

2. Create the Haiku development directories and get the Haiku build
tools source:

mkdir develop
cd develop
mkdir haiku
cd haiku
svn checkout svn://svn.berlios.de/haiku/buildtools/trunk buildtools

3. Build and install the Haiku Jam:

cd  buildtools/jam
make
sudo ./jam0 install
cd ../..

4. Get the Haiku source (this will take a while):

For anonymous check-out:
svn checkout svn://svn.berlios.de/haiku/haiku/trunk haiku

For an existing Haiku developer:
svn checkout svn+ssh://developername@xxxxxxxxxxxxxx/svnroot/repos/haiku/trunk
haiku

If there are any errors when checking out above, just cd in the haiku
directory and type "svn up" to get any missed files. This applies when
updating the code in the future too of course.

5. Build the cross compiler tools:

cd ~/develop/haiku/haiku
./configure --build-cross-tools ../buildtools/

6. Build the Haiku image:

jam haiku-image

That is it! Not too bad. Thanks to Ingo and the various other
contributors for making the Linux compiling so easy.

Now to test an image, there seem to be at least two good options in Linux:

1. qemu. To install in Ubuntu:

sudo apt-get install qemu

Qemu is also needed when converting the default Haiku image to a VMWare image.

To run the Haiku image in qemu, first start in the haiku source directory, then:

cd generated
qemu -hda haiku.image -serial stdio

I found Qemu runs quite a bit faster on this machine than my BeOS box.

2. VMWare Player

In Ubuntu this can be installed with Add/Remove Programs or by using
the command:

sudo apt-get install vmware-player

This also requires accepting a license agreement and other
installation steps. I received some errors about existing files for
the network, but it didn't seem to be a problem in the end.

To use qemu-img to convert the image for use in VMWare:

cd ~/develop/haiku/haiku/generated/
qemu-img convert -f raw haiku.image -O vmdk haiku.vmdk

You will also need this file to run the VM (this should be saved in
and run from the same directory as the vmdk file is in):
http://haikuhost.com/haiku.vmx

There is a third option which I hope we can get working one day. Right
now running Haiku in  it causes a kernel panic:

3. VirtualBox. This is the new open source virtual machine on the
block. Go here to download the right version for your system:

http://www.virtualbox.org/wiki/Downloads

If you install the Debian package in Ubuntu with the graphical
installer, be sure to open the little terminal window in the GUI as
you have to accept a license agreement and do other installation
steps.

You also need to make your Linux user account a member of the vboxusers group.

To convert the default Haiku image into something that can be used in
VirtualBox, you need to download this file:

http://www.virtualbox.org/download/testcase/vditool

I put mine in ~/bin. Then make it executable:

cd ~/bin
chmod +x vditool

To convert the Haiku image:

cd ~/develop/haiku/haiku/generated/
~/bin/vditool DD haiku.vdi haiku.image

You can then use the VirtualBox GUI to do the rest. It is pretty easy
to use. Of course as I said right now Haiku has a kernel panic when
being run in this VM. I don't quite know where to start in debugging
this, but this might be a good tool to get Haiku working with in the
future.

Hope all this helps!

Regards,
Ryan

Other related posts: