This code will build a pretty "vanilla" Arch Linux ARM image for the Rock64 Single Board Computer.
It builds u-boot using ayufan's scripts (from https://github.com/ayufan-rock64/linux-build/, https://github.com/ayufan-rock64/linux-u-boot/). Then, it use guestfish to create an empty image, partition it as required by the RK3328, format the boot
and linux-root
partitions, and extract the Arch Linux ARM ARMv8 generic tarball into the image. It will then add the u-boot bootloader, extlinux config with the kernel command line args and fix the serial console.
Note that these days you can find Rock64 installation instructions on the official Arch Linux ARM website, so you may prefer to use those. The Rock64 was not explitly supported by Arch Linux ARM when I got mine, which is how this repo came into existence. Perhaps it's still useful for people who want to build their own images 🙂.
You can either build this using packages installed in your Linux system, or using Docker.
This is written from the perspective of someone building the image on Arch Linux x86_64. See below for Dockerised version.
Install the following prerequisites (mostly required for building u-boot):
guestfish
(part oflibguestfs
package)dtc
version1.4.5-1
- You can either build this yourself, or find it in the Arch Linux Historical Archive and install it using
pacman -U https://archive.org/download/archlinux_pkg_dtc/dtc-1.4.5-1-x86_64.pkg.tar.xz
)
- You can either build this yourself, or find it in the Arch Linux Historical Archive and install it using
git
uboot-tools
swig
make
python-virtualenv
And one of the following toolchains for cross-compilation (see issue #3):
aarch64-linux-gnu-gcc
, andaarch64-linux-gnu-binutils
version>=2.31
(presumed) or2.29.1-1
(tested).2.30
does not work, see the issue mentioned above. OR:- ARMv8 pre-built toolchain from https://archlinuxarm.org/wiki/Distcc_Cross-Compiling
Ensure the TOOLCHAIN
variable in the Makefile
is set appropriately.
Then:
make [arch.img]
- Build docker image
- Build Arch Linux Rock64 image
./docker/build-docker-image.sh
./docker/build-rock64-image.sh
Burn image to sdcard or eMMC. Boot.
username/password: alarm
/alarm
root
password: root
When using SSH, login as alarm
first, then su root
.
- If you suffer from network performance issues, try disabling rx and tx pauses using ethtool
- HDMI appears to work but I do not think it is hardware accelerated
In no particular order:
- Figure out how to install extra packages (currently, guestfish's
command
running ability cannot be used because of the mismatch in architectures in the guest image and host) - Create systemd unit file for the ethtool setup (see above)
- Contribute Arch Linux support back into ayufan's linux-build repo, assuming it's desired.
- Build Arch Linux packages for ayufan's kernels.
- ayufan for his excellent work on building Rock64 images. Many parts of this repo are inspired by his linux-build and other code. The following are (almost) directly taken from his code:
extlinux.conf
Makefile.*.mk
- Rockchip for caring about mainline support for their chips
- Arch Linux ARM for the distribution
- Arch Linux Wiki page on banana pi for a pointer on fixing python library loading issues when building u-boot
- picodotdev for setting up a Dockerfile & associated scripts for building the rock64 image
- chlorophyll-zz for speeding up the build process and finding a missing dependency
- ydirson for finding the fix for a build issue
- Everyone who's reported issues and helped me fix them!