-
Notifications
You must be signed in to change notification settings - Fork 9
Install CentOS 7 on your favourite ARMv8 ARM64 AArch64 board
With the beginning of 2016 the first affordable ARM64 single board computers became available to the public. While playing with Ubuntu, Debian and Archlinux I was courious to know how much effort would it take to get CentOS 7 up and running on my ODROID-C2 and my Pine64. At the end if have automated this tasks, so you will be able to get your Docker enabled CentOS 7 within a couple of minutes.
This post is a second revision you may find the first one in the GH revision history of this wiki article.
The Alternative Architecture Centos SIG already prepared a tar archive containing a CentOS 7 userland for ARM64 server boards:
curl -sSL -o CentOS-7-aarch64-rootfs-7.3.1611.tar.xz http://mirror.centos.org/altarch/7/isos/aarch64/CentOS-7-aarch64-rootfs-7.3.1611.tar.xz
Step 2: Prepare the target media with a formware-only disk image (SoC bootloader and Linux kernel image)
Most ARM single board computers are shipped with a vendor specific bootloader (mostly u-boot) and Linux kernel image. You may take an existing Debian/Ubuntu/Archlinux disk image and wipe out the root file system contents (but leaving the kernel image (/boot
), the kernel modules (/lib/modules
) and the firmware files (/lib/firmware
) untouched).
Now it is time to copy the CentOS rootfs contents to your target media
sudo tar --numeric-owner -xpJf .../CentOS-7-aarch64-rootfs-1606.tar.xz -C <rootfs>
You need to modify the contents of <rootfs>/etc/fstab
in order to reflect the UUID change for the root device (sudo blkid
will tell you the right UUID), like:
UID=595a1820-11ff-4afb-94fe-53d14ae7fd49 / ext4 defaults 0 0
After having rebooted into your CentOS 7 environment (the default password for root is 'centos'), you may perform some configuration changes, like:
sudo timedatectl set-timezone Europe/Berlin
sudo localectl set-locale LANG=en_GB.UTF-8
sudo hostnamectl set-hostname c2 --static
sudo hostnamectl set-hostname "ODROID-C2" --pretty
Automated setup procedure: z2d
I've prepared a github repository containing a collection of scripts helping you to set up Ubuntu Core 16.04 / Debian 8 Jessie and CentOS 7 (and Docker) for various ARM devices.
After cloning the repository you will find the scripts in the respective subdirectory, e.g. for the ODROID-C2, the set up is done on the ODROID-C2 via
$ git pull https://github.com/umiddelb/z2d
$ cd z2d/odroid-c2
$ vi centos-00.sh # adjust the target device
$ sh centos-00.sh
$ sh centos-01.sh
$ sudo init 6 # reboot into CentOS 7
# login with user centos
$ sudo bash
# cd /
# sh centos-03.sh
Note: For convenience reasons, this setup uses a precompiled kernel image, but you can of course compile your own kernel from source.