Skip to content

Latest commit

 

History

History
162 lines (121 loc) · 3.52 KB

poudriere-armv6-howto.md

File metadata and controls

162 lines (121 loc) · 3.52 KB

Poudriere ARMv6 Cross-Building Package Server How-to

The official binary packages for ARMv6 platforms (Raspberry Pi 1/2, etc.) are often out of date and some packages are not available at all. What's more, some packages refuse to compile without the system sources or won't compile at all. Here's how to supply your machines with fresh packages, configured to your needs.

The Long Way

Install

pkg install subversion qemu-user-static ccache poudriere

Configure Poudriere

Change in /usr/local/etc/poudriere.conf:

ZPOOL=zroot
ZROOTFS=/poudriere
FREEBSD_HOST=http://download.FreeBSD.org
BASEFS=/usr/local/poudriere
POUDRIERE_DATA=${BASEFS}/data
NOLINUX=yes
USE_COLORS=yes
PRESERVE_TIMESTAMP=yes
BUILDER_HOSTNAME=build
WRKDIR_ARCHIVE_FORMAT=txz

Configure QEMU

binmiscctl add armv6 \
    --interpreter "/usr/local/bin/qemu-arm-static" \
    --magic "\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00" \
    --mask "\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff" \
    --size 20 \
    --set-enabled

Create Jail

poudriere jail -c -j 11armv6 -m svn -a arm.armv6 -v release/11.0.1

Install Default Ports Tree

poudriere ports -c

Create Package List

/usr/local/etc/poudriere.d/pkglist.txt:

sysutils/ezjail
www/nginx
[...]

Provision Package Options (Optional)

poudriere options -cf /usr/local/etc/poudriere.d/pkglist.txt

Build

poudriere bulk -j 11armv6 -f /usr/local/etc/poudriere.d/pkglist.txt

Create Repository Server

pkg install nginx
sysrc enable_nginx=YES

Add to /usr/local/etc/nginx/nginx.conf:

server {
    listen       1.2.3.4:80;
    server_name  pkg.example.com;
    root         /usr/local/share/poudriere/html;

    # Allow caching static resources
    location ~* ^.+\.(jpg|jpeg|gif|png|ico|svg|woff|css|js|html)$ {
        add_header Cache-Control "public";
        expires 2d;
    }

    location /data {
        alias /usr/local/poudriere/data/logs/bulk;

        # Allow caching dynamic files but ensure they get rechecked
        location ~* ^.+\.(log|txz|tbz|bz2|gz)$ {
            add_header Cache-Control "public, must-revalidate, proxy-revalidate";
        }

        # Don't log json requests as they come in frequently and ensure
        # caching works as expected
        location ~* ^.+\.(json)$ {
            add_header Cache-Control "public, must-revalidate, proxy-revalidate";
            access_log off;
            log_not_found off;
        }

        # Allow indexing only in log dirs
        location ~ /data/?.*/(logs|latest-per-pkg)/ {
            autoindex on;
        }

        break;
    }

    location /repo {
        alias /usr/local/poudriere/data/packages;
    }
}
service nginx start

Configure Clients to Use the Repository

mkdir -p /usr/local/etc/pkg/repos/

/usr/local/etc/pkg/repos/Poudriere.conf:

Poudriere: {
    url: "http://pkg.example.com/repo/11armv6-default",
    enabled: yes,
}
pkg update -f

Update the Poudriere Ports Tree and Build Changes

poudriere ports -u
poudriere bulk -j 11armv6 -f /usr/local/etc/poudriere.d/pkglist.txt

References