Alpine on ARM
This material needs wiki syntax or style improvements ... Please feel free to help us clean it up. |
This page is proposed for moving ...
|
(Parts of this page are WIP, still incomplete and some might be incorrect.)
Supported SoCs
Alpine gets compiled with support files for so many ARM SoCs that it's best to find out for a particular chipset by further refining (filtering) the search results for DTB files in the Package database.
For example, by refining these search results in the current "edge" release:
For architecure "armhf": https://pkgs.alpinelinux.org/contents?repo=main&file=*.dtb&arch=aarch64&branch=edge
For architecture "aarch64": https://pkgs.alpinelinux.org/contents?repo=main&file=*.dtb&arch=aarch64&branch=edge
Install Alpine on supported SoCs
Generic information
(If anyone has one of the above devices and has successfully installed Alpine on it, please consider adding the missing info here.)
Example with Wandboard
Get latest Alpine image
Download the last Generic ARM image on https://alpinelinux.org/downloads/ Extract the archive somewhere.
Prepare SD Card
First install SPL and u-boot.img (this could change for other board): in root, write the SPL from Alpine extracted files :
dd if=u-boot/wandboard/SPL of=/dev/sdX seek=1 bs=1k
and the u-boot.img :
dd if=u-boot/wandboard/u-boot.img of=/dev/sdX seek=69 bs=1k
After create the partition on the sd-card with fdisk, then copy folders apks/ boot/ efi/ extlinux/ u-boot/ to the sd-card partition. (I'm not sure all folder as useful).
After you can put the sd-card in the Wandboard and boot it with serial console connected.
The board should boot on the sd-card. When the prompt ask a login, enter 'root'.
Then launch 'setup-alpine' to configure the system.
Specific guides
- DIY Fully working Alpine Linux for Allwinner and Other ARM SOCs
- Raspberry_Pi
- Raspberry_Pi_4_-_Persistent_system_acting_as_a_NAS_and_Time_Machine
- Odroid-C2
- NanoPi Neo build script
- A20 OLinuXino Lime2
Unupported SoCs
If you have an armv6/armv7 SoC which is not listed above but is supported by mainline uboot/kernel then it's still possible to install Alpine
Requirements
- Alpine's forked uboot to support tarballs (fabled?)
- serial console
- crosscompiler/toolchain if you can not compile natively
The embedded world
A lot of the SoCs have their own way of doing things, although they use uboot and Linux kernel but often they are heavily modified to suit easy flashing of "ROMs" or other unknown reasons, e.g. Rockchip's notion "partition" are neither DOS nor GPT partitions. We will discuss to install Alpine in a more standard way like x86 with either DOS or GPT partitions. You will most likely have to install/flash the mainline uboot, which can be non-destructive if you use external storage.
Storage
One can load uboot from the following block devices if it's supported.
- NAND
- eMMC
- SD card
- USB
Power on
Some SoCs need both SPL and uboot, you need to check uboot for your board. Most (if not all) boards boots from the internal storage first (either NAND or eMMC) you will have to check documentation of your board if you wish to boot the SPL/uboot from SD/USB.
One can view SPL+uboot as BIOS and boot-loader on PC. Think that you could put the BIOS on an external storage :D
Once you have loaded the "standard" uboot, things are more or less like on x86.
Partitioning
Either DOS or GPT patitions should work. Start of the first partition should be on block 2048 so there is space for SPL/uboot and marked bootable (with the MBR bootable flag, or GPT legacy_bios_bootable attribute).
- SPL starts at block 64 (please consult the docs for your board)
- uboot starts at block 256 (please consult the docs for your board)
Just dd SPL and boot with the correct offset to the media you wish to boot
Booting Linux kernel
- uboot uses extlinux.conf file to locate the kernel/initramfs/... just like syslinx, you need to put that file on the partitions which is marked bootable in the /boot directory
- there should be an extra line "FDTDIR" which points to the DTBs
e.g.
label Fedora (3.17.0-0.rc4.git2.1.fc22.armv7hl) 22 (Rawhide) kernel /boot/vmlinuz-3.17.0-0.rc4.git2.1.fc22.armv7hl append ro root=UUID=8eac677f-8ea8-4270-8479-d5ddbb797450 console=ttyS0,115200n8 LANG=en_US.UTF-8 drm.debug=0xf fdtdir /boot/dtb-3.17.0-0.rc4.git2.1.fc22.armv7hl initrd /boot/initramfs-3.17.0-0.rc4.git2.1.fc22.armv7hl.img
Using QEMU
qemu-system-arm -M vexpress-a9 -kernel zImage -initrd initramfs-grsec -dtb vexpress-v2p-ca9.dtb -hda hda.img -serial stdio
References
- dtb (Device Tree Binary)
- Odroid-C2 2018 (ARMv8, AArch64; Alpine Linux custom build)
- CusDeb.com - bootstrap SD-card images for single-board computers online; (Pieman)
AvailableSoCs