# Building latest pkg on Raspberry Pi fails



## tingo (Jan 30, 2016)

I installed an official snapshot of FreeBSD 10.2-STABLE onto a 4 GB SD card and put it into a Raspberry Pi (original). So it is running:

```
root@rpi-b# uname -a
FreeBSD rpi-b 10.2-STABLE FreeBSD 10.2-STABLE #0 r293242: Thu Jan  7 00:05:43 UTC 2016
  root@releng1.nyi.freebsd.org:/usr/obj/arm.armv6/usr/src/sys/RPI-B  arm
```
Next I put a ports tree on the machine (via `portsnap`) and tried to build ports-mgmt/pkg, but it fails here:

```
root@rpi-b# MAKE_JOBS_UNSAFE=yes make
===>  Building for pkg-1.6.3
/usr/bin/make  all-recursive
Making all in compat
Making all in external
/usr/bin/make  all-recursive
Making all in blake2
  CC  libucl/src/libucl_static_la-ucl_emitter.lo
  CC  libucl/src/libucl_static_la-ucl_emitter_utils.lo
  CC  libucl/src/libucl_static_la-ucl_emitter_streamline.lo
  CC  libucl/src/libucl_static_la-ucl_hash.lo
  CC  libucl/src/libucl_static_la-ucl_parser.lo
  CC  libucl/src/libucl_static_la-ucl_schema.lo
  CC  libucl/src/libucl_static_la-ucl_util.lo
  CC  libucl/src/libucl_static_la-ucl_msgpack.lo
  CC  libucl/src/libucl_static_la-xxhash.lo
  CCLD  libucl_static.la
  CC  sqlite/libsqlite_static_la-sqlite3.lo
sqlite/sqlite3.c:55862:12: warning: unused variable 'pBlock' [-Wunused-variable]
  sqlite3 *pBlock = 0;
  ^
sqlite/sqlite3.c:60268:11: warning: unused variable 'key' [-Wunused-variable]
  u32 key = get4byte(&apNew[NOPARSE][i][/NOPARSE]->aData[8]);
  ^
sqlite/sqlite3.c:8954:26: warning: unused variable 'sqlite3one'
  [-Wunused-const-variable]
SQLITE_PRIVATE const int sqlite3one = 1;
  ^
fatal error: error in backend: IO failure on output stream.
*** Error code 1

Stop.
make[6]: stopped in /usr/ports/ports-mgmt/pkg/work/pkg-1.6.3/external
*** Error code 1

Stop.
make[5]: stopped in /usr/ports/ports-mgmt/pkg/work/pkg-1.6.3/external
*** Error code 1

Stop.
make[4]: stopped in /usr/ports/ports-mgmt/pkg/work/pkg-1.6.3/external
*** Error code 1

Stop.
make[3]: stopped in /usr/ports/ports-mgmt/pkg/work/pkg-1.6.3
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/ports-mgmt/pkg/work/pkg-1.6.3
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/ports-mgmt/pkg
*** Error code 1

Stop.
make: stopped in /usr/ports/ports-mgmt/pkg
```
It doesn't look like this is a problem with free space:

```
root@rpi-b# df -h
Filesystem  Size  Used  Avail Capacity  Mounted on
/dev/ufs/rootfs  3.6G  1.4G  1.9G  41%  /
devfs  1.0K  1.0K  0B  100%  /dev
/dev/msdosfs/MSDOSBOOT  17M  3.8M  13M  23%  /boot/msdos
tmpfs  30M  4.0K  30M  0%  /tmp
```
No clues in logs, and Google didn't lead me to anything. Any hints?


----------



## acheron (Feb 1, 2016)

Can you try again with a larger /tmp.


----------



## tingo (Feb 1, 2016)

OK, I removed the 30M limit from /etc/fstab.
After reboot it looks like this:

```
root@rpi-b# df -h /tmp
Filesystem  Size  Used  Avail Capacity  Mounted on
tmpfs  162M  4.0K  162M  0%  /tmp
```
I got pkg installed, but if I install a random port which has a few dependencies, it will often fail, and have to install a dependent port or two before I can continue installation.
Do I need to set up swap to be able to compile ports the usual way (without all the handholding)?


----------



## acheron (Feb 2, 2016)

I have a swap partition on my imx6 board with 4GB of RAM and sometimes I fill it.


----------



## uzsolt (Feb 6, 2016)

If you don't want compile the ports and want "just use" your RPI maybe can use my repository.


----------



## tingo (Feb 6, 2016)

I have looked at your repository before, and it would have been nice if I could use it. Thanks for creating it. Unfortunately, it only contains a subset (currently 215) of ports available, and many of the ports that I want to explore isn't in there.


----------



## uzsolt (Feb 7, 2016)

What ports do you need? If you miss some (not too big) ports I can improve it but I don't build the whole ports tree


----------

