# Crochet notes



## balanga (Nov 10, 2017)

I'm trying to put together a build script for using crochet to build an RPi image, although I guess it could be adapted for other devices... 

Here is what I've got so far:-

```
echo y | pkg install git subversion sqlite3 u-boot-rpi2
svn co https://svn0.us-west.freebsd.org/base/head /usr/src
git clone --non-interactive --trust-server-cert https://github.com/freebsd/crochet.git
cd ~/crochet
sed "s/#board_setup RaspberryPi2/board_setup RaspberryPi2/" config.sh.sample > config.conf
./crochet.sh -c config.conf
```

The sed script needs changing and maybe one or two other things but that is basically it.

I'm posting it here in case I forget how to use crochet . Others may find it useful too...


----------



## SirDice (Nov 10, 2017)

```
echo y | pkg install git subversion sqlite3 u-boot-rpi2
```
Use this instead:

```
env ASSUME_ALWAYS_YES=yes pkg install -y git subversion sqlite3 u-boot-rpi2
```


----------



## balanga (Nov 10, 2017)

Thanks for the advice...

I also need the `sed` script to remove '#' from the lines containing "#board_setup RaspberryPi2" and "#option ImageSize 3900mb" ,but can't get the syntax right... I know, it should be straightforward, but I can't figure it out.


----------



## SirDice (Nov 10, 2017)

Yeah, sed(1) can be a bit of pain. I usually struggle with it too.


----------



## balanga (Nov 10, 2017)

sed script:-

```
sed  -e 's/#board_setup RaspberryPi2/board_setup RaspberrPi2/'  -e 's/#option ImageSize 3900mb/option ImageSize 3900mb/' config.sh.sample >config.conf
```

RPi build script:-

```
env ASSUME_ALWAYS_YES=yes pkg install git subversion sqlite3 u-boot-rpi2
svn co svn://svn0.us-west.freebsd.org/base/head /usr/src
git clone --non-interactive --trust-server-cert https://github.com/freebsd/crochet.git
cd ~/crochet
sed  -e 's/#board_setup RaspberryPi2/board_setup RaspberrPi2/'  -e 's/#option ImageSize 3900mb/option ImageSize 3900mb/' config.sh.sample >config.conf
./crochet.sh -c config.conf
```


----------

