Table of Contents

Pkgsrc on ARM

Overview

Right now, no pkgsrc packages are available on the ARM port for MINIX3. Of course we would love to have pkgsrc on ARM - in fact, it will be a necessity for many real-world uses of MINIX3 on the Beagle platforms. However, current technical shortcomings prevent this.

Ideally, pkgsrc would be crosscompiled with MINIX3-on-ARM as target, just like MINIX3 itself needs to be crosscompiled for ARM. However, the main problem with this approach is that crosscompiling pkgsrc is not yet supported properly by pkgsrc itself. This is a larger problem that would have to be, and hopefully eventually will be, addressed by the NetBSD/pkgsrc community. It is unlikely that we can pull this off ourselves.

Crosscompiling is necessary not only to compile the packages for the ARM platform, but also to compile them for MINIX3; thus, compiling from Linux on ARM as host platform would still require crosscompilation. This means that the only way to avoid having to crosscompile at all, is to compile the pkgsrc packages natively from the MINIX3-on-ARM platform itself (as is done for MINIX3-on-x86 as well). With the current situation, this gives us two options.

The first option is to compile the packages from the beagle* hardware itself. This would probably have to involve an external (USB) hard disk connected to the BeagleBone Black/White, formatted with ext2 to allow for long file names, to host the entire pkgsrc environment. We currently do have a USB stack and mass storage driver for the BBB/BBW, so doing so should not require extensions to the current system. However, it is possible that the beagle* hardware is too weak to pull this off in any reasonable time frame (if at all, due to, say, too little RAM); we simply don't know, and won't know until somebody actually tries.

The second option is to use the Linaro QEMU emulator with its BeagleXM support. This would potentially be much faster than on real hardware. However, it would be difficult (even though not necessarily impossible) to do this without networking support: pkgsrc generally downloads whatever it needs on the fly from its sources, and without networking support, one would have to make sure that all needed components are available on the local storage in the emulator already. MINIX3 currently does not support the emulator's USB host controller, nor its USB network device. It should be possible to implement those. It may also be possible to find another way to get networking to work, e.g., by somehow enabling virtio-net for the emulator.

In both cases, it is likely that many problems will have to be solved for the actual pkgsrc compilation process, both for bootstrapping pkgsrc itself and for building packages. After all, none of this has ever been tested. Any progress in any direction would be highly welcome though, and we encourage anyone who takes a shot at this to publish their results, even if partial and ending in problems only.

Getting started

Quoting sambuc on IRC (2016-02-09):

I would first look to bootstrap pkgsrc on minix/arm. You can take a look at https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng/blob/3.3.0/minix/pbulk-ng.sh to see the exact way we bootstrap on minix/x86
the first step is to do what is within the lines 270-332
then you will be able to use bmake to compile anything you want from pkgsrc
you don't need to build the chroot for now. This is mainly a safety net to ensure a clean environment on minix/x86
and as those steps take a couple of hours already, even on intel, we copy the chroot, to be able to restart from the step n-1 when needed
iirc, the strict minimum to do to get bmake & pkgsrc working is line 273-297, then you have bmake available