6

has anyone had success running Alpine Linux on the Raspberry Pi 4? I have copied the contents of the Alpine release for rpi 64bit from here to an SD Card formatted with FAT32, but I only get to the coloured square.

I tried copying the firmware files and the linux kernel from the raspbian distribution, but still haven't had gotten past the coloured square screen.

I have seen references saying that the Armhf release of Alpine is recommended, perhaps that would work. http://markbucciarelli.com/posts/2019-05-05_install-alpine-on-raspberry-pi-using-macos.html

Edit: When I run lscpu on raspbian it looks like a 32 bit build of linux, so I'll have to try the 32 version of Alpine.

$ lscpu
Architecture:        armv7l
Byte Order:          Little Endian
CPU(s):              4
On-line CPU(s) list: 0-3
Thread(s) per core:  1
Core(s) per socket:  4
Socket(s):           1
Vendor ID:           ARM
Model:               3
Model name:          Cortex-A72
Stepping:            r0p3
CPU max MHz:         1500.0000
CPU min MHz:         600.0000
BogoMIPS:            270.00
Flags:               half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32

3 Answers 3

6

You can get the Raspberry Pi 4 to boot with Alpine Linux 3.10.2 by adding the following two files into the FAT32 (boot) partition: start4.elf and fixup4.dat.

They can be obtained from the official repository: https://github.com/raspberrypi/firmware/tree/master/boot

bootcode.bin is ignored by the Raspberry Pi 4.

The alpine linux config.txt is also old, need to use arm64_bit=1 instead of arm_control=0x200 plus a couple of other options to get everything working right (see the Manjaro config.txt).

However, as stated by another poster, no usb devices work. This is because the driver for the USB controller is not compiled into the alpine linux kernel. You can see this by looking at the config-rpi in the boot folder of the alpine linux install. I think the options needed for this are

CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_PCI=y

I was going to try and rebuild the kernel, but the alpine build system has a really strange way of compiling the kernel with multiple patches from different places instead of using the official sources, and does not use a single linux config. Plus abuild is a real pain to setup.

You probably just want to use the officially compiled kernel, and install the alpine userland into another partition. Edit the cmdline.txt file for root=/dev/sdxN for wherever the userland is located.

3

I managed to get Alpine 3.10.2 to boot to the command prompt with HDMI after I copied from a Manjaro Arm for RPI4 install image the following files: bootcode.bin *.dat *.elf then edited config.txt

No USB keyboard - working on it...

2
  • 1
    Welcome. Sounds like you didn't yet copy over /lib/modules from the Manjaro image? That would break your keyboard and any other USB devices.
    – jdonald
    Aug 23, 2019 at 22:46
  • That's good news. Was some support added in 3.10.2? The Alpine wiki is down at the moment.
    – kristianp
    Aug 26, 2019 at 2:41
1

As you can see at the Release notes on date: 2019-06-20 that this is supporting Buster. Versions before will not do it. You can try to "copy" modules, driver and firmware from that version to the Alpine Linux distribution as you already tried, but I don't believe that you will have much access. We have seen similar with Ubuntu on upgrade to RPi 3B+. I'm afraid you have to wait until Alpine Linux will provide a compatible image. You should file a bug report there.

3
  • 1
    Ok, the Raspbian version is Buster, but what's that got to do with Alpine linux? I thought copying the firmware files might help, as they are concerned with the boot process before loading the Linux kernel.
    – kristianp
    Jul 14, 2019 at 0:07
  • @kristianp You are right, Raspbian has nothing to do with Alpine Linux and that is exactly the problem. Don't forget to copy also the modules in /lib/modules/. They must fit to the kernel. You may be able to get the wifi running but then the keyboard isn't working ... Please answer this question if you have made a stable version.
    – Ingo
    Jul 14, 2019 at 5:08
  • 1
    The problem is you can't run a 64-bit userland on a 32-bit kernel.
    – goldilocks
    Sep 6, 2019 at 17:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.