Author: Cole Smith
License: LGPL-2.1
This document will walk you through installing Arch Linux ARM on the DevTerm A06. At the time of writing, only Armbian is supported on the DevTerm.
We will create a root file system based on the rock64 architecture (rk3328). This will include patching our bootloader and kernel with the patches provided by ClockworkPi. Technically, the DevTerm A06's architecture is based on the rk3399.
Pre-built root filesystem(s) are provided in the Releases tab. Skip to the Prepare the SD Card section if using
a pre-built image. Replace arch-linux-clockworkpi-a06-root-fs.tar.xz
with your downloaded file name in the guide
steps.
NOTE: Please note the following defaults for the release filesystem:
root
US/Eastern
en_US UTF8
devterm
This guide assumes you are already using Arch Linux. Some package names or procedures may differ depending on your distribution.
In order to build the root filesystem, we will set up the following:
aarch64
chroot environment + necessary configurationarm-none-eabi-gcc
build tools from ARMWe will start by creating an ARM chroot environment to build our root filesystem using this guide.
$ yay -S base-devel binfmt-qemu-static qemu-user-static arch-install-scripts
# systemctl restart systemd-binfmt.service
aarch64
executable exists in$ ls /proc/sys/fs/binfmt_misc
aarch64
tarball from Arch Linux ARM$ wget http://os.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz
$ sudo su
# mkdir root
# bsdtar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C root
# mount --bind root root
NOTE: It's very important that this root
folder is owned by root. Otherwise, you will
get unsafe path transition
errors in the final build.
# arch-chroot root
# pacman-key --init
# pacman-key --populate archlinuxarm
# pacman -Syu
We will start with lightly configuring our system before compiling the packages.
For this section, all commands will be run inside the chroot.
# pacman -S base-devel git vim wget ranger sudo man networkmanager
networkmanager
and dhcpcd
for networking on first boot# systemctl enable NetworkManager dhcpcd
/etc/locale.gen
and uncommenting your required locales.# locale-gen
fstab
# echo 'LABEL=ROOT_ARCH / ext4 defaults 0 0' >> /etc/fstab
timedatectl
. To list supported timezones: timedatectl list-timezones
# timedatectl set-timezone "US/Eastern"
# timedatectl set-ntp true
NOTE: This may affect the timezone of your system outside the chroot, if so, you may reset your host system timezone after finishing the root tarball.
# hwclock --systohc
# echo 'devterm' > /etc/hostname
/etc/X11/xorg.conf.d/10-monitor.conf
Section "Monitor"
Identifier "DSI-1"
Option "Rotate" "right"
EndSection
# passwd
alarm
useralarm
, the default Arch Linux ARM user, sudo
privileges.# EDITOR=/usr/bin/vim visudo
alarm
after the one for root
alarm ALL=(ALL) ALL
alarm
user# su alarm
$ cd
NOTE: The default password for the alarm user is alarm
U-Boot depends on the arm-none-eabi-gcc
executable to be built, and since this program is not available in the Arch
Linux ARM repositories, we will download it directly from
ARM's website
.
$ wget https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-aarch64-arm-none-eabi.tar.xz
$ mkdir gcc
$ tar -xJf gcc-arm-10.3-2021.07-aarch64-arm-none-eabi.tar.xz -C gcc
PATH
$ cd gcc/gcc-arm-10.3-2021.07-aarch64-arm-none-eabi/bin
$ export PATH=$PATH:$(pwd)
$ cd
This repository contains pre-configured and patched Arch Linux packages for the DevTerm A06. The Linux kernel and U-Boot are based off the rock64 variants, already available in Arch Linux ARM, with patches provided by ClockWorkPi.
You can find these patches from ClockworkPi here.
alarm
home folder of your aarch64
chroot environment, clone this repository$ git clone https://github.com/css459/arch-linux-arm-clockworkpi-a06.git
$ cd arch-linux-arm-clockworkpi-a06
aarch64
architecture. The package build tool makepkg
, supports a flag called MAKEFLAGS
. Below, we will append
MAKEFLAGS="-j$(nproc)"
to the makepkg
command to instruct the compiler to use one worker for each core.$ cd linux-clockworkpi-a06
$ MAKEFLAGS="-j$(nproc)" makepkg -si
$ cd ..
$ cd uboot-clockworkpi-a06
$ MAKEFLAGS="-j$(nproc)" makepkg -si
$ cd ..
NOTE: DO NOT INSTALL THE BOOTLOADER TO THE DISK WHEN ASKED AFTER THIS STEP. We will do this ourselves when we prepare the SD card.
For each additional package directory in this repository
$ cd <package directory>
$ MAKEFLAGS="-j$(nproc)" makepkg -si
$ cd ..
alarm
$ exit
root
# exit
# umonut root
We are now ready to package up the root filesystem into a compressed tarball.
# cd root
# tar cpJf ../arch-linux-clockworkpi-a06-root-fs.tar.xz .
# cd ..
Change ownership of the tarball and exit the root
account
# chown <user>:<user> arch-linux-clockworkpi-a06-root-fs.tar.xz
# exit
You now have a root filesystem tarball to bootstrap the SD card!
We will now put our prepared filesystem onto the SD card. We will follow Arch Linux ARM's guide for the rock64, but use our tarball in place of theirs.
# dd if=/dev/zero of=/dev/sdX bs=1M count=32
# fdisk /dev/sdX
Inside fdisk,
Create the ext4 filesystem without a Journal
# mkfs.ext4 -L ROOT_ARCH -O ^has_journal /dev/sdX1
NOTE: Disabling the journal is helpful for simple flash devices
like SD Cards to reduce successive writes. In rare cases, your filesystem
may become corrupted, which may arise as a boot loop. Running
fsck -y /dev/sdX1
on an external system can fix this issue.
# mount /dev/sdX1 /mnt
# sudo su
# bsdtar -xpf arch-linux-clockworkpi-a06-root-fs.tar.xz -C /mnt
# exit
# cd /mnt/boot
# dd if=idbloader.img of=/dev/sdX seek=64 conv=notrunc,fsync
# dd if=u-boot.itb of=/dev/sdX seek=16384 conv=notrunc,fsync
# cd
# umount /mnt
# eject /dev/sdX
The SD card is now ready to be booted by the DevTerm! Good luck!
You will want to set up Wi-Fi on first boot. You can do so by using NetworkManager.
Check out the post-install suggestions from Arch Linux for further configuration.
If you run into issues where you see no screen output or the DevTerm will not boot, please check the debugging output via UART:
/dev/ttyUSB0
sudo stty -F /dev/ttyUSB0 1500000 && sudo cat /dev/ttyUSB0
Very special thanks to Max Fierke (@maxfierke) from the CPI Discord, and the Manjaro team for their help in debugging and kernel patching. The Linux kernel and u-boot ports in this repository uses their carefully designed patches, and modified PKGBUILDs. This Arch Linux port would not be possible without their hard work, and I make no claims or credit to it.