Mail archive

[alpine-user] Problem on creating Alpine ISO for Raspberry Pi

From: Herry Herry <>
Date: Fri, 28 Apr 2017 22:49:19 +0000

Hi All,

First, thank you to Alpine developers for this amazing OS.

I was building a custom ISO image for Raspberry Pi as described in <>.

However, when I followed the instructions, I got this error:

$ apk update && apk add alpine-sdk xorriso syslinux
$ abuild-keygen -i -a -n
$ git clone " <>"
$ make PROFILE=alpine-rpi ALPINE_ARCH=armhf iso
==> modloop: Unpacking kernel modules
fetch ' <>'
fetch ' <>'
ERROR: unsatisfiable constraints:
 linux-rpi (missing):
   required by: world[linux-rpi]
make: *** [Makefile:85: /root/alpine-iso/isotmp.alpine-rpi/stamp.modloop.kernel.rpi] Error 1

Note that I ran the commands on an Alpine x86 VM. Someone in stackexchange pointed me that there were some broken links, in particular the repo’s ARCH (it should be ‘armhf’ instead of ‘x86_64’). In light of that, I applied the following patch (it passes ALPINE_ARCH when updating apk index files):

diff --git a/Makefile b/Makefile
index f88a6a9..0850156 100755
--- a/Makefile
+++ b/Makefile
_at_@ -87,6 +87,7 @@ $(MODLOOP_KERNELSTAMP):
    --update \
    --no-script \
    --root $(MODLOOP_DIR)/tmp \
+ --arch $(ALPINE_ARCH) \
  _at_mv "$(MODLOOP_DIR)"/tmp/lib/modules/* "$(MODLOOP_DIR)"/lib/modules/
  _at_if [ -d "$(MODLOOP_DIR)"/tmp/lib/firmware ]; then \
_at_@ -144,6 +145,7 @@ $(INITFS_DIRSTAMP):
    --update \
    --no-script \
    --root $(INITFS_DIR) \
+ --arch $(ALPINE_ARCH) \
  _at_cp -r $(APK_KEYS) $(INITFS_DIR)/etc/apk/ || true
  _at_if ! [ -e "$(INITFS_DIR)"/etc/mdev.conf ]; then \
diff --git a/ b/
index 53349ca..18ca2bf 100644
--- a/
+++ b/
_at_@ -1,4 +1,5 @@
 ALPINE_NAME := alpine-rpi
+ALPINE_ARCH := armhf
 KERNEL_FLAVOR := rpi rpi2
 BOOT_OPTS := dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1

The patch helped me eliminating the above error, but produced a new one:

$ make PROFILE=alpine-rpi iso
==> initramfs: creating /root/alpine-iso/isotmp.alpine-rpi/isofs/boot/initramfs-rpi
/root/alpine-iso/isotmp.alpine-rpi/initfs.rpi/lib/ Not found. Not found.
/usr/bin/lddtree: cd: line 284: can't cd to
==> initramfs: creating /root/alpine-iso/isotmp.alpine-rpi/isofs/boot/initramfs-rpi2
/root/alpine-iso/isotmp.alpine-rpi/initfs.rpi2/lib/ Not found. Not found.
/usr/bin/lddtree: cd: line 284: can't cd to
==> iso: generating repository
mkdir -p "/root/alpine-iso/isotmp.alpine-rpi/isofs/apks/armhf"
sed -e 's/\#.*//' alpine-rpi.packages \
    | xargs apk fetch --keys-dir /etc/apk/keys --repositories-file /etc/apk/repositories \
        --output /root/alpine-iso/isotmp.alpine-rpi/isofs/apks/armhf \
        --recursive || { rm /root/alpine-iso/isotmp.alpine-rpi/isofs/apks/armhf/*.apk; exit 1; }
raspberrypi: unable to select package (or it's dependencies)
omxplayer: unable to select package (or it's dependencies)
rm: can't remove '/root/alpine-iso/isotmp.alpine-rpi/isofs/apks/armhf/*.apk': No such file or directory
make: *** [Makefile:281: /root/alpine-iso/isotmp.alpine-rpi/isofs/apks/armhf/APKINDEX.tar.gz] Error 1

After investigation, it seems that mkinitfs didn’t consider ALPINE_ARCH when it was invoked by Makefile. Unfortunately, it's not clear for me on how to force mkinitfs to use ‘armhf' instead of ‘x86_64' since there is no option available to do that.

Can anyone please help me sorting out this problem?

Thank you.

Best regards,
Received on Fri Apr 28 2017 - 22:49:19 UTC