Support #688
Updated by Daniel Curtis about 9 years ago
This is a guide on how I set up the crochet build tool to compile an image for the Raspberry Pi 2.
h2. Prepare the Environment
* Make sure the system is up to date:
<pre>
pkg update && pkg upgrade
</pre>
* Install a couple dependencies:
<pre>
pkg install subversion git u-boot-rpi2
</pre>
* Checkout the FreeBSD 11-CURRENT kernel sources:
<pre>
svn co svn://svn0.us-west.freebsd.org/base/head /usr/src
</pre>
h2. Install Crochet
* Clone the latest crochet from GitHub:
<pre>
mkdir /usr/local/src && cd /usr/local/src
git clone https://github.com/freebsd/crochet.git
cd crochet
</pre>
* Create config file from the sample config provided:
<pre>
cp config.sh.sample config.sh
</pre>
* Edit the crochet config file:
<pre>
vi config.sh
</pre>
#* And modify the script to use the Raspberry Pi 2, and any additional parameters:
<pre>
board_setup RaspberryPi2
option ImageSize 1950mb
option Growfs
option User pi
option SwapFile 1024mb
</pre>
* Build the image:
<pre>
sh crochet.sh -c config.sh
</pre>
h2. Write the Image
* Write the FreeBSD image to a micro SD card:
<pre>
dd if=/usr/local/src/crochet/work/FreeBSD-armv6-11.0-RPI2-290209.img of=/dev/da0 bs=1m
</pre>
* Now insert the micro SD card into the Raspberry Pi 2, plug in power, and log in using the user created during the image creation; username is pi, password is pi.
h2. Post Install
* Since the Pi does not have an on board clock, ntp must be used to keep the time correct. Start and enable ntpd at boot:
<pre>
echo 'ntpd_enable="YES"' >> /etc/rc.conf
service ntpd start
</pre>
h2. Resources
* https://github.com/freebsd/crochet
* https://github.com/freebsd/crochet/wiki/How-to-Build-a-Disk-Image