Thanks, that definitely sounds like the right way to do it.
As a workaround, I’ve managed to rebuild the package in docker (via qemu). In case anyone hits the same problem, here are the steps I used:
git clone https://github.com/dnephin/docker-apk-build.git
Edit builder/Dockerfile and change the FROM line to read
FROM resin/raspberrypi3-alpine
Packages will now be built for this platform. Run,
make build
~/bin/setup.sh
Press enter to accept the default location for the key.
cd /work/main/musl
Create a file called 0007-increase-semaphores.patch containing:
--- a/include/limits.h
+++ b/include/limits.h
@@ -64,7 +64,7 @@
#define PTHREAD_STACK_MIN 2048
#define PTHREAD_DESTRUCTOR_ITERATIONS 4
#define SEM_VALUE_MAX 0x7fffffff
-#define SEM_NSEMS_MAX 256
+#define SEM_NSEMS_MAX 4096
#define DELAYTIMER_MAX 0x7fffffff
#define MQ_PRIO_MAX 32768
#define LOGIN_NAME_MAX 256
Edit APKBUILD and add 0007-increase-semaphores.patch to the list in the source variable. Update the SHA1 sums in the APKBUILD with,
abuild checksum
Build the updated package with:
abuild -c -r -P /target
Create an index file
cd /target/main/armfh
apk index -o APKINDEX.tar.gz *.apk
abuild-sign APKINDEX.tar.gz
Exit from the container and find the built package in target/main/armhf
I can then add the .apk binary to my resin git repo and use apk add --allow-untrusted foo.apk in my Dockerfile.