Tuesday, April 26, 2016

HOWTO - Build a FreeBSD image for usage on the Raspberry Pi

There are build tools available for FreeBSD which enables us to compile the FreeBSD OS for usage on a variety of platforms.
Crochet, hosted on Github, is an available tool which allows us to build FreeBSD for the smaller embedded type of computers, we will use this tool to build our own image with FreeBSD for the Raspberry Pi.

You should have a FreeBSD computer available to build the image with.  If you don't have one, check out my blog article outlining how to install one: 

Before we can start building our FreeBSD image with the crochet tool, we will need to install some dependencies on our FreeBSD machine.
To get the dependencies installed, we will be compiling them ourself from the ports installed on our FreeBSD system.

cd /usr/ports/devel/git
make;make install;make clean

cd /usr/ports/lang/python35
make;make install;make clean
ln -s /usr/local/bin/python3.5 /usr/local/bin/python

cd /usr/ports/sysutils/u-boot-rpi
make -DBATCH all install

After installation of our prerequisites we can now grab a copy of the crochet build tools hosted on github and start building our Raspberry Pi FreeBSD image.

git clone https://github.com/freebsd/crochet.git
cd crochet

Copy the default config file:
cp config.sh.sample config.sh

And modify it for our needs:
Edit the file with your favorite editor and uncomment:
# board_setup RaspberryPi
# option Growfs
# option User myuser

Now start crochet to build our FreeBSD image:
sh crochet.sh -c config.sh

No comments:

Post a Comment