From ArchWiki
Revision as of 19:19, 13 April 2012 by Drcouzelis (Talk | contribs) (Building A Haiku CD Image In Linux: Building section is out of date)

Jump to: navigation, search

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.

Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어

External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

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.

Tango-view-refresh-red.pngThis article or section is out of date.Tango-view-refresh-red.png

Reason: please use the first argument of the template to provide a brief explanation. (Discuss in Talk:Haiku#)

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 us 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 http://svn.haiku-os.org/haiku/buildtools/trunk Haiku/buildtools

Get the source code for Haiku:

 $ svn checkout http://svn.haiku-os.org/haiku/haiku/trunk 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".

Note: Alternatively, you can use Git instead of Subversion.
 $ git clone git://git.haiku-os.org/buildtools.git/ Haiku/buildtools
 $ git clone git://git.haiku-os.org/haiku.git/ Haiku/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 is time to make the build tools.

Note: Or, for Git, instead of "svn update" use "git pull".

Build Tools: The Tools You will 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 is what you are 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 us build the build tools for creating a GCC4 HYBRID GCC2 image.

Warning: --use-xattr does not work on ext2,ext3, or ext4 (see http://www.haiku-os.org/guides/building/configure/use-xattr)
 $ 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 --use-gcc-pipe --use-xattr
 $ 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 --use-gcc-pipe --use-xattr
 $ cd ..

And that is 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 do not 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 do not know what jam is, think of it as a modern GNU "make" command. I do not know if it is better or worse than GNU make, but it certainly works well for Haiku.

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

Build and install jam:

 $ cd buildtools/jam/
 $ make
 # ./jam0 install
 $ cd ../..
Note: The only thing the "./jam0 install" command does is copy the "bin.linuxx86/jam" 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 "UserBuildConfig" file. Create one by copying the example file:

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

When you edit your new "haiku/build/jam/UserBuildConfig" 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 "haiku/build/jam/OptionalPackages". One particularly useful one is "WebPositive" web browser.

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 "haiku-cd.iso"! Burn it to a CD and it is ready for a live boot.

Booting Haiku: Add Haiku To GRUB

But! Before you leave Linux, you may want to add Haiku to your GRUB 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 "/boot/grub/menu.lst" file. Add this section:

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

And reinstall GRUB:

 # 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 "installoptionalpackage" command.

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

Here is the list of the current optional packages.


This section is just to give you a simple idea of "what to do next", after you finish booting into Haiku. All of this software can be installed with the official installoptionalpackage command.

  • Web Browser
    • WebPositive
    • BeZillaBrowser (an old Mozilla build, very stable)
  • Music Player
    • MediaPlayer (includes playlist support)
  • Video Player
    • MediaPlayer
    • VLC
  • IRC
    • Vision (the Haiku developers use #haiku on Freenode)
  • Text Editor
    • Pe (programmer's editor)
    • Vim
  • Bittorrent
    • Transmission
  • Image Editting
    • WonderBrush
  • Scripting
    • The Terminal application uses BASH.
    • Perl
    • Python

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 do not know. Try it out and see if it is not fun.