Architectures/ARM/AArch64/QuickStart

From FedoraProject

< Architectures | ARM | AArch64(Difference between revisions)
Jump to: navigation, search
(Network Configuration)
(Aarch64 Quickstart Guide)
(19 intermediate revisions by 6 users not shown)
Line 2: Line 2:
 
[[Category:AArch64]]{{shortcut|Arch:ARM}}
 
[[Category:AArch64]]{{shortcut|Arch:ARM}}
 
=Aarch64 Quickstart Guide=
 
=Aarch64 Quickstart Guide=
This page will help those new to aarch64(armv8) get started with the Foundation Model provided by ARM. There 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.  
+
This page will help those new to aarch64 (ARMv8) get started with the Foundation Model provided by ARM. The F19-aarch64-efi tarball provides an F19-based disk image, which includes a kernel, initramfs, and device tree blob, files to support booting the kernel using EFI, and a sample script for starting the model.
  
 
== Download the Foundation Model ==
 
== Download the Foundation Model ==
The first step will be to download the Foundation model from ARM. The model is not redistributable and will therefor require you to create a free account with ARM. Once completed you will be able to download the Foundation Model and begin.  
+
The first step is to download the Foundation model from ARM. The model is not redistributable and will therefor require you to create a free account with ARM. Once completed, you will be able to download the Foundation Model and begin.  
  
 
* [http://www.arm.com/products/tools/models/fast-models/foundation-model.php The Foundation Model]
 
* [http://www.arm.com/products/tools/models/fast-models/foundation-model.php The Foundation Model]
Line 15: Line 15:
 
==Extract the Foundation Model==
 
==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.  
+
Once you have downloaded the model, you will need to set up your environment. The model can be extracted to a path of your choosing.  Your home directory will be used in this example.
 +
 
 
Unpack the model:
 
Unpack the model:
  
Line 24: Line 25:
 
== Using the Model with an Image ==
 
== 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 12GB in size and may take several minutes to unpack depending on your hardware.
+
Using the commands below, download and extract the Aarch64 root filesystem tarball.  
 +
 
 +
{{admon/note|Note: The extracted disk image requires approximately 12GB disk space.  Please ensure you have adequate free space.  This may take several minutes to unpack, depending on your hardware.}}
 +
 
 
  cd ~/aarch64
 
  cd ~/aarch64
  wget http://fedorapeople.org/~pwhalen/aarch64/stage4-root-20130528.img.tar.bz2
+
  wget http://dmarlin.fedorapeople.org/fedora-arm/aarch64/F19-aarch64-efi.tar.xz
  tar xvjf stage4-root-20130528.img.tar.bz2
+
  tar Jxvf F19-aarch64-efi.tar.xz
  
==== Kernel Packages ====
+
=== Starting the Model ===
The Foundation model seems to have some performance issues when using a serial console, there are two kernel packages to choose from - one that includes the console, the other does not and is intended for use by connecting through ssh. The kernels use the wrapper to set the hostname and networking. For example 'systemd-3.9-image-2G-1.axf' will set a hostname of 'model-1' with and IP address of 10.0.1.2, the default gw should be set to 10.0.1.1. The last number in the kernel name indicates which network, hostname will be used when it boots.  
+
 
* With console:
+
The kernel supports virtio, so the kernel image, initramfs, and device tree blob included on the image will be used in the boot process.  You no longer need to use separate "Kernel Packages".
<pre>
+
 
wget http://fedorapeople.org/~pwhalen/aarch64/systemd-3.9-image-2G.tar.bz2
+
An example script for starting the model has been included in the tarball. This script performs the following steps to start the model:
tar xvjf systemd-3.9-image-2G.tar.bz2
+
</pre>
+
* No console:
+
<pre>
+
wget http://fedorapeople.org/~pwhalen/aarch64/systemd-3.9-image-ns-2G.tar.bz2
+
tar xvjf systemd-3.9-image-ns-2G.tar.bz2
+
</pre>
+
  
===== Starting the Model =====
 
NOTE: You may need to adjust your path for the model depending on the version in use.
 
* With console:
 
 
<pre>
 
<pre>
sudo Foundation_v8pkg/models/Linux64_GCC-4.1/Foundation_v8 \
+
sudo ../Foundation_v8pkg/models/Linux64_GCC-4.1/Foundation_v8 \
--image systemd-3.9-image-2G/systemd-3.9-image-2G-1.axf \
+
  --cores=1 \
--network=bridged \
+
  --visualization \
--network-bridge=ARM1 \
+
  --image=linux-system-el3-foundation.axf \
--block-device stage4-root-20130528.img 
+
  --data=RTSM_VE_FOUNDATIONV8_EFI.fd@0xA0000000 \
</pre>
+
  --block-device `pwd`/aarch64-efi.img \
* No console:
+
  --network=bridged \
<pre>
+
  --network-bridge=ARM1 &
sudo Foundation_v8pkg/models/Linux64_GCC-4.1/Foundation_v8 \
+
sleep 5
--image systemd-3.9-image-ns-2G/systemd-3.9-image-ns-2G-1.axf \
+
sudo ifconfig ARM1 10.0.1.1 netmask 255.255.255.0
--network=bridged \
+
--network-bridge=ARM1 \
+
--block-device stage4-root-20130528.img 
+
 
</pre>
 
</pre>
  
On the host immediately after launching the model:
 
  
  sudo ifconfig ARM1 10.0.1.1 netmask 255.255.255.0
+
Both console (telnet) and ssh access are supported. To start the model, change to the F19-aarch64-efi subdirectory and run the script:
  
== Using the model with an NFS root ==
+
  cd ~/aarch64/F19-aarch64-efi
 +
  ./efi-aarch64.sh
 +
 
 +
{{admon/note|Note: | You must have 'sudo' access in order to run this script.}}
 +
 
 +
{{admon/note|Note: | The script assumes the foundation model is in:
 +
    ~/aarch64/Foundation_v8pkg.
 +
Adjust as necessary for your environment.}}
 +
 
 +
 
 +
You should be able to ssh to the model once it has fully booted. You can use telnet to connect to the serial console using the provided ports as it boots.
 +
 
 +
{{admon/note|Note: |  Connecting using telnet will also close the xterm popup window.}}
 +
 
 +
{{admon/note|Note: |  It may take several minutes for the model to be fully booted.}}
 +
 
 +
 
 +
* For console:
 +
telnet 10.0.1.1 5000    # note this is the IP of the gateway and not the model
 +
* For ssh login:
 +
ssh root@10.0.1.2        # note this is the IP address of the model
 +
 
 +
 
 +
The '''root password is 'fedora''''.
  
Using the model through an NFS root is no longer recommended or supported here.
 
  
 
== Allowing the Model to Connect to the Internet ==
 
== Allowing the Model to Connect to the Internet ==
Line 76: Line 88:
 
* Set up Network Address Translation:
 
* Set up Network Address Translation:
 
  HOSTEXTERNAL=eth0 # Replace this with your outside interface
 
  HOSTEXTERNAL=eth0 # Replace this with your outside interface
  sudo iptables -t nat -A POSTROUTING -o $HOSTEXTERNAL -j MASQUERADE
+
  sudo iptables -t nat -I POSTROUTING -o $HOSTEXTERNAL -j MASQUERADE
  sudo iptables -A FORWARD -i $HOSTEXTERNAL -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
+
  sudo iptables -I FORWARD -i $HOSTEXTERNAL -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
  sudo iptables -A FORWARD -i ARM0 -o $HOSTEXTERNAL -j ACCEPT
+
  sudo iptables -I FORWARD -i ARM1 -o $HOSTEXTERNAL -j ACCEPT
  
 
* Firewall trouble? Try this:
 
* Firewall trouble? Try this:
  sudo iptables -A INPUT -i ARM0 -j ACCEPT
+
  sudo iptables -I INPUT -i ARM1 -j ACCEPT
  
 
The model uses Google's Public DNS server (8.8.8.8) for name resolution (/etc/resolv.conf).
 
The model uses Google's Public DNS server (8.8.8.8) for name resolution (/etc/resolv.conf).
  
= Getting Started with the Aarch64 Bootstrap =
+
= Fixing build failures =
Use either ssh or the console to connect to the model, if this is your first time running the model it is recommended to use a kernel that will provide a console for troubleshooting any problems that arise.
+
If you want to debug a broken package, please visit the [[ Architectures/ARM/AArch64/Stage4_Problem_Packages | problem package list]], follow the directions and claim the packages of your choice.
 
+
Before getting started, its very important to set the correct date on the model, the below example will set the date to 12:00pm, 29 May 2013
+
date 052912002013
+
 
+
Then execute the script:
+
/usr/sbin/arm-rebuild.sh
+
 
+
The system should begin building packages for the aarch64 bootstrap, below is an example of the output you should see:
+
<pre>
+
[builder@aarch64 ~]$ /usr/sbin/arm-rebuild.sh
+
building: bouncycastle-1.46-7.fc19 at Thu Apr 25 22:43:27 GMT 2013
+
INFO: mock.py version 1.1.30 starting...
+
Start: init plugins
+
INFO: selinux disabled
+
Finish: init plugins
+
Start: run
+
INFO: Start(/home/builder/bouncycastle-1.46-7.fc19.src.rpm)  Config(stage4-aarch64)
+
Start: lock buildroot
+
Start: clean chroot
+
Finish: clean chroot
+
Finish: lock buildroot
+
Start: chroot init
+
Start: lock buildroot
+
Mock Version: 1.1.30
+
INFO: Mock Version: 1.1.30
+
INFO: calling preinit hooks
+
INFO: enabled root cache
+
INFO: enabled yum cache
+
Start: cleaning yum metadata
+
Finish: cleaning yum metadata
+
INFO: enabled ccache
+
Start: device setup
+
Finish: device setup
+
Start: yum update
+
</pre>
+
 
+
= Notes =
+
* When using the model with a kernel that provides a serial console you may see intermittent 'ttyAMA0: 1 input overrun(s)'.
+
* Intermittent networking issues with 'partial' file downloads.
+

Revision as of 17:53, 21 October 2013

Shortcut:
Arch:ARM

Contents

Aarch64 Quickstart Guide

This page will help those new to aarch64 (ARMv8) get started with the Foundation Model provided by ARM. The F19-aarch64-efi tarball provides an F19-based disk image, which includes a kernel, initramfs, and device tree blob, files to support booting the kernel using EFI, and a sample script for starting the model.

Download the Foundation Model

The first step is to download the Foundation model from ARM. The model is not redistributable and will therefor require you to create a free account with ARM. Once completed, you will be able to download the Foundation Model and begin.

To run the model you may need to install some additional software with the following command:

sudo yum install xterm xorg-x11-fonts-{misc,100dpi,75dpi}* telnet bridge-utils

Extract the Foundation Model

Once you have downloaded the model, you will need to set up your environment. The model can be extracted to a path of your choosing. Your home directory will be used in this example.

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 tarball.

Note.png
Note: The extracted disk image requires approximately 12GB disk space. Please ensure you have adequate free space. This may take several minutes to unpack, depending on your hardware.
cd ~/aarch64
wget http://dmarlin.fedorapeople.org/fedora-arm/aarch64/F19-aarch64-efi.tar.xz
tar Jxvf F19-aarch64-efi.tar.xz 

Starting the Model

The kernel supports virtio, so the kernel image, initramfs, and device tree blob included on the image will be used in the boot process. You no longer need to use separate "Kernel Packages".

An example script for starting the model has been included in the tarball. This script performs the following steps to start the model:

sudo ../Foundation_v8pkg/models/Linux64_GCC-4.1/Foundation_v8 \
  --cores=1 \
  --visualization \
  --image=linux-system-el3-foundation.axf \
  --data=RTSM_VE_FOUNDATIONV8_EFI.fd@0xA0000000 \
  --block-device `pwd`/aarch64-efi.img \
  --network=bridged \
  --network-bridge=ARM1 &
sleep 5
sudo ifconfig ARM1 10.0.1.1 netmask 255.255.255.0


Both console (telnet) and ssh access are supported. To start the model, change to the F19-aarch64-efi subdirectory and run the script:

 cd ~/aarch64/F19-aarch64-efi
 ./efi-aarch64.sh
Note.png
Note:
You must have 'sudo' access in order to run this script.
Note.png
Note:
The script assumes the foundation model is in:
   ~/aarch64/Foundation_v8pkg.
Adjust as necessary for your environment.


You should be able to ssh to the model once it has fully booted. You can use telnet to connect to the serial console using the provided ports as it boots.

Note.png
Note:
Connecting using telnet will also close the xterm popup window.
Note.png
Note:
It may take several minutes for the model to be fully booted.


  • For console:
telnet 10.0.1.1 5000     # note this is the IP of the gateway and not the model
  • For ssh login:
ssh root@10.0.1.2        # note this is the IP address of the model


The root password is 'fedora'.


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 -I POSTROUTING -o $HOSTEXTERNAL -j MASQUERADE
sudo iptables -I FORWARD -i $HOSTEXTERNAL -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
sudo iptables -I FORWARD -i ARM1 -o $HOSTEXTERNAL -j ACCEPT
  • Firewall trouble? Try this:
sudo iptables -I INPUT -i ARM1 -j ACCEPT

The model uses Google's Public DNS server (8.8.8.8) for name resolution (/etc/resolv.conf).

Fixing build failures

If you want to debug a broken package, please visit the problem package list, follow the directions and claim the packages of your choice.