From Fedora Project Wiki

Aarch64 Quickstart Guide

This page will help those new to aarch64(armv8) get started with the Foundation Model provided by ARM. The are a number of options available when using the model, including use of a disk image file or NFS root filesystem, as well as a choice of kernel if you would like to use Systemd or Busybox as the init process.

Download The Required Software

The first step will be to download the Foundation model from ARM, a stage4 root filesystem (image or tarball), and the kernel package. In order to download the Foundation model you will need to create a free account with ARM.

Extract the Foundation Model

Once you have downloaded the model, you will need to set up your environment. The model can extracted to a path of your choosing, in this example we will use your home directory. Unpack the model:

mkdir ~/aarch64
cd ~/aarch64
tar xvzf FM000-KT-00035-r0p8-44rel23.tgz

Using the Model with an Image

Using the commands below, download and extract the Aarch64 root filesystem disk image. The disk image will extract to roughly 8GB in size.

cd ~/aarch64
wget http://fedorapeople.org/~pwhalen/aarch64/stage4-root-20130418.img.tar.bz2
tar xvjf stage4-root-20130418.img.tar.bz2

Download and extract the kernel package:

wget http://fedorapeople.org/~pwhalen/aarch64/aarch64-kernels.tar.bz2
tar xvjf aarch64-kernels.tar.bz2

The model can now be launched using the disk image as the root filesystem with the commands below:

Systemd:
sudo Foundation_v8pkg/Foundation_v8 --image aarch64-kernels/systemd-3.7-image-foundation.axf --block-device stage4-root-20130418.img --network=bridged
Busybox:
sudo Foundation_v8pkg/Foundation_v8 --image aarch64-kernels/busybox-3.7-image-foundation.axf --block-device stage4-root-20130418.img --network=bridged

The model will take a few moments to start. The root password is 'fedora', there is also another account called 'builder' password 'builder'.

Network Configuration

To set up the network, run the following commands on the model as root:

ifconfig eth0 10.0.0.2 netmask 255.255.255.0
route add default gw 10.0.0.1

And on the host system:

sudo ifconfig ARM0 10.0.0.1 netmask 255.255.255.0

Using the model with an NFS root

Using the model through an NFS is recommended as it will allow the most flexibility when working with the system. It is important to use the paths provided as the kernel will expect the root file system to be mounted through NFS from the given path.

Setting up an NFS Root Filesystem

First you will need to create a directory for the root filesystem. It is important you use the same path in the example as the kernel expects the rootfs to be at the path used below:

mkdir -p /var/exports/aarch64/stage4-nfs-root
cd /var/exports/aarch64/
wget http://arm-temp.ausil.us/pub/fedora-arm/stage4-root-20130418.tar.xz
cd stage4-nfs-root
sudo tar xvJf ../stage4-root-20130418.tar.xz
sudo mv stage4-root-20130418/* .
sudo rm -rf stage4-root-20130418
  • Now create an NFS share for the rootfs, edit /etc/exports
sudo vi /etc/exports
/var/exports/aarch64/stage4-nfs-root *(rw,no_root_squash,no_all_squash,async)
  • Start the service
sudo systemctl start nfs.service

Booting the Model with an NFS root

You need to setup the network for use with the aarch64 model and the addressing used in the kernel arguments. Start the model using one of the following depending on if you would like to use systemd or busybox as your init process (Busybox is currently recommended).

  • Systemd:
sudo Foundation_v8pkg/Foundation_v8 --image aarch64-kernels/systemd-3.7-nfs-foundation.axf --network=bridged
  • Busybox:
sudo Foundation_v8pkg/Foundation_v8 --image aarch64-kernels/busybox-3.7-nfs-foundation.axf --network=bridged

After starting the model you will see a new device created on your host system named 'ARM0', use the following to assign an IP address for use with the model:

sudo ifconfig ARM0 10.0.0.1 netmask 255.255.255.0

Once this adapter is assigned an IP address, the system should boot to either a login prompt or boot with busybox as the init process.

You may need to adjust your firewall to allow connections to the NFS server (Port 2049).


Allowing the Model to Connect to the Internet

On the host:

  • Enable IP forwarding (as root)
echo 1 > /proc/sys/net/ipv4/ip_forward
  • Set up Network Address Translation:
HOSTEXTERNAL=eth0 # Replace this with your outside interface
sudo iptables -t nat -A POSTROUTING -o $HOSTEXTERNAL -j MASQUERADE
sudo iptables -A FORWARD -i $HOSTEXTERNAL -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i ARM0 -o $HOSTEXTERNAL -j ACCEPT
  • Firewall trouble? Try this:
sudo iptables -A INPUT -i ARM0 -j ACCEPT

On the model:

  • Add a nameserver to '/etc/resolv.conf':
echo "nameserver 8.8.8.8" >> /etc/resolv.conf

Getting Started with the Aarch64 Bootstrap

Once networking is set up on the host, you can login as 'builder' password 'builder' to start building packages for aarch64, or use 'root' password 'fedora' then su to the builder account.

su - builder
cp .ssh/id_rsa.upload .ssh/id_rsa

Then execute the script:

/usr/sbin/arm-rebuild.sh

The first time you run arm-rebuild.sh it will retrieve arm-temp.ausil.us's ssh host key and ask if you want to continue connecting. Say yes, per the following:

The authenticity of host 'arm-temp.ausil.us (74.119.218.150)' can't be established.
RSA key fingerprint is ae:aa:1d:58:0f:c5:c3:f3:00:95:c7:e8:8b:15:c3:da.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'arm-temp.ausil.us,74.119.218.150' (RSA) to the list of known hosts.