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: 
http://random-notes-of-a-sysadmin.blogspot.be/2016/04/howto-install-freebsd-103-on-vmware.html

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.

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

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

u-boot-rpi
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