Seting up an automated (as in scheduled) build of Haiku under Linux

I thought that I would post how I did this as i find it very convenient. Plus it helps document some things i have learned lately… typing stuff out helps me remember.

First off you should know how to build a haiku image if not search for the appropriate forum thread.

Secondly i assume your haiku directory and buildtools are in /root

after you have setup the haiku configuration to build to your preferences in ./haiku/build/jam/UserBuildConfig

make a script ./haiku/build.sh

try the second script as it should be better and easier to configure :slight_smile: if you don’t want to copy the image to HD just comment out the line that starts with the “dd” aka disk druid and also the line that runs makebootable

my current auto build script:

#!/bin/bash
cd /root/haiku
//update the source to the latest
svn update
//the following line is the path to your haiku image
rm …/test.image
//time reports the amount of time the process takes and is usefull IMO
// -q quits if there is an error and -j3 runs three simultaneous compiles
//so it will finish faster on SMP computers just omit it on single core PCs
time jam -q -j3
//dd will copy your image to the HD if=path to image of=path to partition
dd if=…/test.image of=/dev/hda3
//makes the drive you have chosen bootable
jam run “:<build>makebootable” /dev/hda3

untested but better code:

#!/bin/bash
DRIVE=/dev/hda3
IMAGE=/root/haiku/generated/haiku.image
PATH=/root/haiku
cd $PATH
//update the source to the latest
svn update
//delete any previous image
rm $IMAGE
//time reports the amount of time the process takes and is usefull IMO
// -q quits if there is an error and -jn runs n simultaneous compiles
//so it will finish faster on SMP computers just omit -jn on single core PCs
time jam -q -j3
//dd copys the image to your partion or drive of choice
dd if=$image of=$DRIVE
//makes the drive you have chosen bootable
jam run “:<build>makebootable” $DRIVE

Don’t forget to chmod +x the script

now assuming you have the privileges on your system to edit /etc/crontab
add:

00 0 * * * root /root/haiku/build.sh

00 is the minute (0-59) 0 is the hour (0-23) * is the day month (1-31) * is month (1-12) * is day of week (0-7) 0 and 7 are Sunday and last is the command you want to run

more on cron: http://www.redhat.com/docs/manuals/linux/RHL-7.2-Manual/custom-guide/cron-task.html

one more thing!!
if you are just building you buildtools and haiku for the first time don’t run jam with the -jn paremeter as you will get corruted results or so i was told and the 2.95 version is still prefered since it is backwards compatable

Of course I may have made a mistake or there may be a better way to do this feel free to point it out if there is