From ArchWiki
Jump to navigation Jump to search

Template:Article summary start Template:Article summary text Template:Article summary end


Haiku is a free and open source operating system compatible with BeOS. It is in active development and there are daily updates.

Building A Haiku CD Image In Linux

A Haiku CD image can be used to live boot Haiku (run it without affecting your drive) or to install it.

Why would you download and build your own image of Haiku when there are nightly CD images available on the Haiku website? There are some great reasons to build an image yourself. I find downloading only the updates and building what has changed to be much faster than downloading an entire CD image. Also, by building the image yourself, you will be able to include any extra software that you plan on using (for example, a web browser) right in the CD image. The nightly images only include the Haiku operating system.

Most of the information here is based on the Haiku guides. The difference between those guides and this page is that this page is specifically about setting up a Haiku build area in Arch Linux.

Let's get started!

There are two "collections" of source code needed to build Haiku in Linux: the source code for the build tools used to build Haiku, and the source code for Haiku itself.

Prerequisite: Linux Software Needed To Create The Haiku Build Tools

The first thing you will need to do is install the necessary Linux software. Please understand that this is not what you will be using to compile Haiku. Instead, this is what you will be using to compile the build tools used to compile Haiku.

 # pacman -S subversion yasm autoconf automake texinfo flex bison gawk base-devel
Note: For other Linux distributions, please see here.

Download: Get The Haiku Source Code

Download the source code for the build tools and for Haiku. Both of them can be easily downloaded by using Subversion.

Get the source code for the build tools:

 $ svn checkout Haiku/buildtools

Get the source code for Haiku:

 $ svn checkout Haiku/haiku

These two commands will create a new directory called "Haiku". We will spend pretty much the rest of the time inside this directory.

 $ cd Haiku/

You will notice it has two sub-directories: "buildtools" and "haiku".

Updating: Get The Absolute Latest Copy of Haiku

You can update all of the Haiku source code at any time. Of course, if you just finished downloading the Haiku source code then there is no need to do this; you already have the latest updates! But for future reference, here is how you do it. The Haiku source code is updated daily. In contrast, the build tools source code is hardly ever updated, which makes sense since all they do is build Haiku.

Note: In my first three months of getting Haiku updates, I have only had to update the build tools once.
 $ cd haiku/
 $ svn update # Update the Haiku source code
 $ cd ..
 $ cd buildtools
 $ svn update # The build tools are not updated very often
 $ cd ..

Now that you have finished downloading the source code, it's time to make the build tools.

Build Tools: The Tools You'll Need To Build Haiku

Build the Haiku build tools. These commands may look strange because you are building the build tools from inside the "haiku" directory, but that's what you're supposed to be doing.

Now, I think a little explanation is needed: there are four different "types" of Haiku images you can build. They are:

  • GCC2
  • GCC4

What do they mean? Well, one of the original goals of Haiku was to create a modern operating system that could run original BeOS software. But, the developers ran into a problem: to put it simply, the most modern version of GCC is version 4, but original BeOS software only worked if Haiku was built using GCC version 2. To solve this, they created a "hybrid" build which included the libraries needed to run software from both GCC 2 and GCC 4. Genius!

I personally think the GCC4 HYBRID GCC2 build is the most convenient, so I will focus on that one, but I will include some UNTESTED commands to build the other three types.

Now, let's build the build tools for creating a GCC4 HYBRID GCC2 image.

 $ cd haiku/
 $ mkdir generated.x86gcc2 # Used to create the GCC2 libraries
 $ mkdir generated.x86gcc4hybrid # Used to create the GCC4 libraries
 $ cd generated.x86gcc2/ # Create the GCC2 libraries first
 $ linux32 bash # NOTE: ONLY NEEDED ON 64 BIT LINUX
 $ ../configure --build-cross-tools ../../buildtools/ --include-patented-code
 $ cd ..
 $ cd generated.x86gcc4hybrid/ # Time to create the GCC4 libraries
 $ ../configure --build-cross-tools-gcc4 x86 ../../buildtools/ --alternative-gcc-output-dir ../generated.x86gcc2/ --include-patented-code
 $ cd ..

And that's it! The build tools should compile without a problem and are ready to be used. Please move on to the next section #Jam: Bringing It All Together.

Warning: These steps are optional. You do not need to do them if you already built build tools for a GCC4 HYBRID GCC2 build.
Warning: I have not tested these commands.

If you are interested in making a different kind of Haiku build, here are some commands to try. I HAVE NOT TESTED THEM, so I don't know if they will work.

For a GCC2 build:

 $ cd haiku/
 $ ./configure --build-cross-tools ../buildtools/ --include-patented-code

For a GCC4 build:

 $ cd haiku/
 $ ./configure --build-cross-tools-gcc4 x86 ../buildtools/ --include-patented-code

For a GCC2 hybrid build:

 $ cd haiku/
 $ mkdir generated.x86gcc4
 $ mkdir generated.x86gcc2hybrid
 $ cd generated.x86gcc4/
 $ ../configure --build-cross-tools-gcc4 x86 ../../buildtools/ --include-patented-code
 $ cd ..
 $ cd generated.x86gcc2hybrid/
 $ linux32 bash
 $ ../configure --build-cross-tools ../../buildtools/ --alternative-gcc-output-dir ../generated.x86gcc4/ --include-patented-code
 $ exit
 $ cd ..
Note: This is the end of the "Warning" section. Continue here.

Jam: Bringing It All Together

Ok, I sort of lied. You will also need the jam tool to build Haiku. If you don't know what jam is, think of it as a modern GNU Template:Codeline command. I don't know if it's better or worse than GNU make, but it certainly works well for Haiku.

You can't use the version of jam that is provided by your Linux distribution. Haiku needs a special version of jam.

In addition to building this special version of jam, I personally had to make another change to get Haiku to compile. (as of March 2010) You may want to go ahead and make the change yourself right now. It won't hurt anything.

  • Edit the file: Template:Filename
  • Change the "MAXSIZE" from "40960" to "81920".
  • That's it!

Build and install jam:

 $ cd buildtools/jam/
 $ make
 # ./jam0 install
 $ cd ../..
Note: The only thing the Template:Codeline command does is copy the Template:Filename file to "/usr/local/bin/". If you want, you can copy it manually to whereever you want.

Of course, you can install your new jam anywhere, but please confirm you are using the right one with this command:

 $ which jam

Optional Packages: Which Software To Include In The CD Image

I think this is the fun part. You can choose which optional packages will be included in your Haiku CD image. You do this by editing the Template:Filename file. Create one by copying the example file:

 $ cp haiku/build/jam/UserBuildConfig.sample haiku/build/jam/UserBuildConfig

When you edit your new Template:Filename file, you will notice the section at the bottom that is commented out that says "Add optional packages to the image". Put your "AddOptionalHaikuImagePackages" commands here.

You can see a list of available packages in the file Template:Filename. One particularly useful one is the "BeZillaBrowser". It's an older but very functional version of Firefox.

Build Haiku: Create A Haiku CD Image

This final step is the easiest. Use the new jam command to build your GCC4 HYBRID GCC2 Haiku CD image.

 $ cd generated.x86gcc4hybrid/
 $ jam -q haiku-cd

When in finishes compiling correctly, you will have a bootable Template:Filename! Burn it to a CD and it is ready for a live boot.

Booting Haiku: Add Haiku To GRUB2

But! Before you leave Linux, you may want to add Haiku to your GRUB2 boot menu. You only need to do this if you have an empty partition and if you are going to install Haiku on it. If you only plan on running Haiku as a live CD then you can skip this.

In Linux, edit the Template:Filename file. Add this section:

 title        Haiku
 rootnoverify (hd0,0)  # WARNING: Replace these numbers with your own drive and partition numbers
 chainloader  +1

And reinstall GRUB2:

 # grub-install /dev/sda  # WARNING: Replace "/dev/sda" with your own primary drive name

Sharing Files

Haiku can mount and read EXT3 file systems. Click on the deskbar "leaf" menu and select "Mount".

Arch Linux can mount the Be File System.

 # mount -t befs /dev/sda1 /mnt # Replace the drive name and number with your BFS drive
Note: Linux refers to the BFS as "befs" to avoid confusion with the UnixWare Boot File System.

Optional Packages

Optional packages are packages that are packaged by the Haiku developers but are not maintained by them. You have the option to add optional packages to the Haiku CD image (see #Optional Packages: Which Software To Include In The CD Image), or you can install them inside Haiku with the Template:Codeline command.

$ installoptionalpackage -l # List optional packages
$ installoptionalpackage -a pkgname # Install a package


You can download the latest copy of the Haiku native WebKit-based web browser "WebPositive".

To use it, you will need the Haiku optional packages (I think these are the right ones):

  • Curl
  • ICU-devel
  • LibIconv
  • LibXML2
  • OpenSSL
  • SQLite

Haiku Ports

"Haiku Ports" is an effort to port software from the BSD ports tree to Haiku. It is very easy to install and use. Installation instructions are here:

And a list of packages can be found here:


Have Fun

Have fun using Haiku. What makes using Haiku fun? I don't know. Try it out and see if it isn't fun.