FreeBSD - how to build for ARM
Just hints, tips and scripts from the mailing lists, forums and other places.
back to operating systems page.
Links
Local links
[cubieboard], Raspberry Pi, Seagate [DockStar],
History
2021-08-13: I re-created this page on my self-hosted web server.
2014-01-05: mailing list freebsd-arm (msg1, msg2): question was "Another thing, how does one set up a build environment that doesn't clobber source builds on the host?"
A lot of folks use the freebsd-crochet script to create images for arm systems. I've never learned to use it myself (and I usualy don't want a ready-to-flash image). I generally have a dozen or so active development "sandboxes" for different boards. For each board/project I'm working on I create a directory, and within it I have a script named "mk" and these subdirectories: config/ nfsroot/ obj/ src/ In config I put a make.conf and src.conf (even if they're empty), and a custom kernel config file if I'm not using one of the stock files. The src directory is a straight svn checkout of head or a stable branch or whatever. nfsroot is my default DESTDIR for installs; for development I tend to use nfs root. The mk script is attached. It basically sets up the usual defaults for whatever the sandbox is (kernel config name and such), then does a cd into the src directory and fires up make with whatever args I put on the command line. I can just type "mk buildworld" or "mk installkernel" or whatever and the mk script supplies the env vars and make options that never change. If I want to install to an sdcard or usb thumb drive instead of nfsroot/ I can just format and mount it and "mk installworld DESTDIR=/mnt". -- Ian
and
Hrm, the attachment got scrubbed, I'll just paste the mk script here: #!/bin/sh # Build beaglebone from source. case "$*" in *DESTDIR* ) insdir="$DESTDIR" ;; * ) insdir="$(pwd)/nfsroot" esac case "$*" in *installworld* | *installkernel* | *distribution* ) SUDO=sudo;; esac set -x kernel="BB" if [ -r "config/${kernel}" ] ; then ln -fs "../../../../config/${kernel}" "src/sys/arm/conf/${kernel}" fi srcconf="$(pwd)/config/src.conf" makeconf="$(pwd)/config/make.conf" objdir="$(pwd)/obj" tobjdir="${objdir}/arm.armv6/$(pwd)/src" kobjdir="${tobjdir}/sys/${kernel}" export MAKEOBJDIRPREFIX="${objdir}" cd ./src && time nice -15 ${SUDO} make -j ${MAX_JOBS:-1} \ "-DNO_CLEAN" \ "TARGET_ARCH=armv6" \ "DESTDIR=${insdir}" \ "__MAKE_CONF=${makeconf}" \ "SRCCONF=${srcconf}" \ "KERNCONF=${kernel}" \ "$@" -- Ian
that's it.
2013-03-23: mailing list freebsd-arm (msg): Cubieboard
A10 SoC support is in HEAD, but in beginning period. As for running FreeBSD, there are some netboot tips for Hackberry (uses same SoC A10 as cubieboard) and some scripts files that should work for cubieboard too. Please check those at: http://kernelnomicon.org/?p=298 FYI, I run my cubieboard loading/booting kernel from SD card. For very quick testing you can grab kernel from: http://people.freebsd.org/~ganbold/cubieboard/kernel and try to boot from net/SD card using files (script, uboot, spl etc) at http://people.freebsd.org/~gonzo/arm/hackberry/ Kernel assumes you have rootfs on usb stick's second partition (like da0s2) There is no SATA driver yet as well as SD and NAND drivers. usb works (2 host usb interfaces), so I only tested mounting rootfs using usb stick. There is no ethernet driver yet too. So basically board support is in beginning stage but in pretty good shape. Also uart related diff is sent for the review. For test however you can use usb connected devices like maybe ethernet, hard disk etc. If you need rootfs I can send you the link off the list, where you can download the image. You can also build your own rootfs using Tim's scripts (https://github.com/kientzle/freebsd-beaglebone, you can build for BeagleBone and use its disk image) hope this helps, Ganbold
2013-02-22: mailing list freebsd-arm (msg): Cubieboard
In a surprise move (not even I did see it coming) I was able to get a Cubieboard (bought it secondhand locally) today. It is the 2012-09-09[2] revision, according to the text on the board itself. Naturally, I want to run FreeBSD on it (well, it is natural for me). - is there a how-to or a writeup somewhere on getting FreeBSD running on the Cubieboard? (everything from install on what? usb stick, microSD, sata hard drive - to which bootloader? - to do you need a serial connection?) - are there ready-made FreeBSD images available somewhere? I tried googling, but didn't get much References: 1) http://cubieboard.org/ 2) http://linux-sunxi.org/Cubieboard