🛠 Construire sa propre image Armbian pour la PINE A64 (armbian/build)
Objectives
Stop relying on binary images: compile the PINE A64 system yourself using the armbian/build framework, whose pine64 board configuration is still maintained (family sun50iw1, KERNEL_TARGET="current,edge,legacy"). You will see the complete boot chain specific to Allwinner — SoC BROM → U-Boot (mainline, defconfig pine64_plus_defconfig) → kernel + DTB, all read from the microSD (no SPI NOR on this board) — and the ARM Trusted Firmware replaced here by CRUST (a64_defconfig), the mainline port of Allwinner's ARM Trusted BSP.
Hardware
- 1 × x86-64 PC running Linux (or Docker, the mode recommended by Armbian) with ~35 GB free space
- 1 × PINE A64/A64+ + microSD to test the produced image
- EXP serial console (115200 8N1) to observe your custom U-Boot
- Network (the framework clones kernel, U-Boot, CRUST, Debian packages)
Complete code
# Cloner le framework de build Armbian
git clone --depth=1 https://github.com/armbian/build
cd build
# Compiler une image CLI Debian Bookworm, noyau mainline LTS (BRANCH=current)
# Le framework lit config/boards/pine64.conf :
# BOOTCONFIG=pine64_plus_defconfig (U-Boot mainline)
# CRUSTCONFIG=a64_defconfig (ARM Trusted Firmware pour A64)
# KERNEL_TARGET="current,edge,legacy"
./compile.sh BOARD=pine64 BRANCH=current DISTRIBUTION=bookworm \
BUILD_DESKTOP=no KERNEL_ONLY=no KERNEL_CONFIGURE=no
# Image produite :
ls -lh output/images/ # Armbian_*_Bookworm_current_pine64.img.xz
# Graver et booter (console EXP 115200 8N1 pour voir le U-Boot custom) :
xzcat output/images/Armbian_*_Bookworm_current_pine64.img.xz | sudo dd of=/dev/sdX bs=4M
sync
Expected verification
At the end of the build, output/images/ contains the .img.xz image with the current kernel, U-Boot u-boot-sunxi-with-spl.bin, and the DTB sun50i-a64-pine64*.dtb. On the serial console, the U-Boot banner appears, then the kernel starts on serial0:115200n8 (the chosen stdout-path of the mainline device tree). uname -a on the board confirms the kernel version you just compiled — and you can now patch the kernel or the DTS, rebuild, and see your change at the next boot.
Common errors
- Compiling with the wrong U-Boot defconfig: it is
pine64_plus_defconfig(used even for the base board in the Armbian config) — another sun50i defconfig results in a bootloader that does not communicate with this board. - Confusing kernel branches:
current/edge= mainline (recommended, the official wiki states that the majority of distros for the board run on mainline);legacy= Allwinner's old 3.10 "lichee" BSP, which ran Android 5.1 on a 32-bit kernel on a 64-bit SoC — to be avoided. - Running out of space or RAM on the host PC: the build downloads and compiles kernel + U-Boot + CRUST + Debian rootfs; plan for ample space and bandwidth.
- Being surprised that there is nothing to flash "into the board": the boot chain is BROM → microSD only; no SPI NOR, no default eMMC recovery — a broken image is repaired by reflashing the card (or via FEL, see the dedicated tutorial).
- Forgetting CRUST: without the ARM Trusted firmware (here CRUST
a64_defconfig), the A64 does not start the kernel correctly in EL2/EL1 mode — the framework handles this, but a manual U-Boot+kernel build without ATF is a bottomless pit. - Skimming through logs: the framework also writes to
output/log/— if a component fails to compile, that is where the real error is located.
Other tutorials for this board
- Premier boot d'Armbian sur la PINE A64 (microSD, console série, rootfs)
- PINE A64 ou PINE A64+ ? Le pièg du réseau gigabit dès le premier regard
- Faire clignoter une LED avec libgpiod (numérotation GPIO du A64 : PB0 = 32)
- Benchmark Ethernet iperf3 : mesurer le piège 10/100 vs gigabit
- Lire un capteur I²C (BME280) sur le bus i2c-1 du connecteur Pi-2
- Un serveur maison qui consomme 2,5 W : Docker léger sur la PINE A64
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash