From Fedora Project Wiki
No edit summary
(added note about potential availability of newer images)
 
(63 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{lang|en|zh-cn|page=Architectures/ARM/AArch64/QuickStart}}
{{lang|en|zh-cn|page=Architectures/ARM/AArch64/QuickStart}}
[[Category:AArch64]]{{shortcut|Arch:ARM}}
[[Category:AArch64]]{{shortcut|Arch:ARM}}
{{admon/warning|IMPORTANT |<b>This is pre-release software and not intended for general use.</b>}}
=Aarch64 Quickstart Guide=
=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.  
This page will help those new to aarch64 (ARMv8) get started with the Foundation Model provided by ARM. The F21-20140628-foundation-v8 Remix tarball provides an F21-based disk image, which boots the kernel from the image using UEFI(Tianocore) and Grub2, and a sample script for starting the model. This Fedora Remix uses a look aside repository for the kernel package, which includes patches that are headed upstream, but not yet added to Fedora.


== 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 re-distributable and will therefore require you to create a free account with ARM. Once completed, you will be able to download the Foundation Model and begin.  
{{admon/note|Note: It is important to use the latest Foundation Model, if you encounter any issues check to see that you have the most recent version. }}
{{admon/warning|IMPORTANT: The Fast Models are not currently supported. }}


* [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 18:
==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:


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


== Using the Model with an Image ==
== Using the Model with an Image ==


{{admon/important|Bug!|There is a bug in the Foundation Model Virtual Disk I/O implementation that makes the model unstableUntil it has been fixed using an NFS root will provide greater stability.}}
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 spaceThis may take several minutes to unpack, depending on your hardware.}}


Using the commands below, download and extract the Aarch64 root filesystem disk image. The disk image will extract to roughly 8GB in size and may take several minutes to unpack depending on your hardware.
  cd ~/aarch64
  cd ~/aarch64
  wget http://fedorapeople.org/~pwhalen/aarch64/stage4-root-20130423.img.tar.bz2
  wget http://dmarlin.fedorapeople.org/fedora-arm/aarch64/F21-20140628-foundation-v8.tar.xz
  tar xvjf stage4-root-20130423.img.tar.bz2
  tar xvf F21-20140628-foundation-v8.tar.xz


Download and extract the kernel package:
{{admon/note|Note: there can be newer images provided at link above.}}
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:  
=== Allowing the Model to Connect to the Internet ===
Systemd:
On the host:
  sudo Foundation_v8pkg/Foundation_v8 --image aarch64-kernels/systemd-3.7-image-foundation.axf --block-device stage4-root-20130423.img --network=bridged
* Enable IP forwarding (as root)
Busybox:
  echo 1 > /proc/sys/net/ipv4/ip_forward
sudo Foundation_v8pkg/Foundation_v8 --image aarch64-kernels/busybox-3.7-image-foundation.axf --block-device stage4-root-20130423.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''''.
* 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


==== Network Configuration ====
* 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).
 
=== Starting the Model ===


After launching the model, sign in using the root account for the network to be auto-configured.  
The kernel supports virtio, so the kernel image and initramfs included on the image will be used in the boot process.  This image boots using UEFI (tianocore) and Grub2.


On the host system:
An example script for starting the model has been included in the tarball.  This script performs the following steps to start the model:
sudo ifconfig ARM0 10.0.0.1 netmask 255.255.255.0


== Using the model with an NFS root ==
<pre>
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`/${IMAGE} \
  --network=bridged \
  --network-bridge=ARM1 &
sleep 5
sudo ifconfig ARM1 192.168.1.1 netmask 255.255.255.0
</pre>
{{admon/note|Note: |  Depending on your environment you may need to change the IP addressing used.}}


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.
To start the model, change to the image subdirectory and run the script:


== Setting up an NFS Root Filesystem ==
  cd ~/F21-20140628-foundation-v8
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 (extracting may take several minutes depending on your hardware):
  ./efi-aarch64.sh


sudo mkdir -p /var/exports/aarch64/stage4-nfs-root
{{admon/note|Note: | You must have 'sudo' access in order to run this script. The script assumes the foundation model is in:
cd /var/exports/aarch64/
    ~/aarch64/Foundation_v8pkg
sudo wget http://fedorapeople.org/~pwhalen/aarch64/stage4-root-20130423.tar.xz
Adjust as necessary for your environment.}}
cd stage4-nfs-root
sudo tar xvJf ../stage4-root-20130423.tar.xz
sudo mv stage4-root-20130423/* .
sudo mv stage4-root-20130423/.profile .
sudo rm -rf stage4-root-20130423


* Now create an NFS share for the rootfs, edit /etc/exports
To connect to the serial console, telnet to the provided ports as it boots, for example:
sudo vi /etc/exports
/var/exports/aarch64/stage4-nfs-root *(rw,no_root_squash,no_all_squash,async)


* Start the service
  telnet 192.168.1.1 5000    # note this is the IP of the model gateway and not the model
  sudo systemctl start nfs.service  # Fedora
service nfs start  # RHEL


== Booting the Model with an NFS root ==
{{admon/note|Note: |  Connecting using telnet will also close the xterm popup window. | If your connection is not successful using port 5000, try 5001, 5002, or 5003.}}


You need to setup the network for use with the aarch64 model and the addressing used in the kernel arguments.
This is an example log of the model starting, and using telnet to access the console:
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.
<pre>
terminal_0: Listening for serial connection on port 5000
terminal_1: Listening for serial connection on port 5001
terminal_2: Listening for serial connection on port 5002
terminal_3: Listening for serial connection on port 5003
Visualization web server started on port 2001
Simulation is started
sh: xterm: command not found
telnet 192.168.1.1 5000


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


$ telnet 192.168.1.1 5000
Trying 192.168.1.1...
Connected to 192.168.1.1.
Escape character is '^]'.
</pre>


== Allowing the Model to Connect to the Internet ==
The model will then start the first stage bootloader (tianocore), which will launch grub2, which will in turn boot the selected kernel, for example:
On the host:
{{admon/note|Note: | To navigate the menu use '<ctrl>n' - next and '<ctrl>p' - previous.}}
* Enable IP forwarding (as root)
<pre>
echo 1 > /proc/sys/net/ipv4/ip_forward
Secure firmware (version  built at 13:07:46 on Apr  7 2014)
PROGRESS CODE: V3020003 I0
PROGRESS CODE: V3020002 I0
PROGRESS CODE: V3020003 I0
PROGRESS CODE: V3021001 I0


* Set up Network Address Translation:
+---------------------------------------------------------------------------+
HOSTEXTERNAL=eth0 # Replace this with your outside interface
|                                                                          |
sudo iptables -t nat -A POSTROUTING -o $HOSTEXTERNAL -j MASQUERADE
|    ARM64, with Linux 3.14.0-0.rc8.git1.1.0.1.fc21.aarch64                |
sudo iptables -A FORWARD -i $HOSTEXTERNAL -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|    ARM64, with Linux 0-rescue-79e714035d9e46cbbecc55e70a3b10a1          |
sudo iptables -A FORWARD -i ARM0 -o $HOSTEXTERNAL -j ACCEPT
|                                                                          |
|                                                                          |
|                                                                          |
|                                                                          |
|                                                                          |
|                                                                          |
|                                                                          |
|                                                                          |
|                                                                          |
|                                                                          |
|  The selected entry will be started automatically in 1s.                |
|  Press 'e' to edit the selected item, or 'c' for a command prompt.      |
+---------------------------------------------------------------------------+


* Firewall trouble? Try this:
EFI stub: Booting Linux Kernel...
sudo iptables -A INPUT -i ARM0 -j ACCEPT
:
</pre>


The model uses Google's Public DNS server (8.8.8.8) for name resolution (/etc/resolv.conf).
You should be able to ssh to the model once it has fully booted.  


= Getting Started with the Aarch64 Bootstrap =
{{admon/note|Note: | It may take several minutes for the model to be fully booted.}}
Consider setting the date to something more current. The following command, run as root, will set the date to April 19 2000 hours, 2013:
date 041920002013


Log in using the root account (using the Busybox kernel this will be done by default)
* For ssh login:
su - builder
ssh root@192.168.1.5        # note this is the IP address of the model


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:
'''Notes:'''
<pre>
* Verify that the system date/time are correct.
[builder@aarch64 ~]$ /usr/sbin/arm-rebuild.sh
* To avoid image or filesystem corruption it is important to shutdown the model properly.
building: bouncycastle-1.46-7.fc19 at Thu Apr 25 22:43:27 GMT 2013
  shutdown -h now
INFO: mock.py version 1.1.30 starting...
* After shutting down, ensure the Foundation Model process has been stopped before restarting.
Start: init plugins
  sudo kill -TERM <PID for the Foundation Model process>
INFO: selinux disabled
* The '''root password is 'fedora''''.
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>


= Known Issues =
= Fixing build failures =
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.

Latest revision as of 14:56, 6 November 2014

Shortcut:
Arch:ARM
IMPORTANT
This is pre-release software and not intended for general use.

Aarch64 Quickstart Guide

This page will help those new to aarch64 (ARMv8) get started with the Foundation Model provided by ARM. The F21-20140628-foundation-v8 Remix tarball provides an F21-based disk image, which boots the kernel from the image using UEFI(Tianocore) and Grub2, and a sample script for starting the model. This Fedora Remix uses a look aside repository for the kernel package, which includes patches that are headed upstream, but not yet added to Fedora.

Download the Foundation Model

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

Note: It is important to use the latest Foundation Model, if you encounter any issues check to see that you have the most recent version.
IMPORTANT: The Fast Models are not currently supported.

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-52rel06.tgz

Using the Model with an Image

Using the commands below, download and extract the Aarch64 root filesystem tarball.

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/F21-20140628-foundation-v8.tar.xz
tar xvf F21-20140628-foundation-v8.tar.xz 
Note: there can be newer images provided at link above.

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

Starting the Model

The kernel supports virtio, so the kernel image and initramfs included on the image will be used in the boot process. This image boots using UEFI (tianocore) and Grub2.

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`/${IMAGE} \
  --network=bridged \
  --network-bridge=ARM1 &
sleep 5
sudo ifconfig ARM1 192.168.1.1 netmask 255.255.255.0
Note:
Depending on your environment you may need to change the IP addressing used.

To start the model, change to the image subdirectory and run the script:

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

To connect to the serial console, telnet to the provided ports as it boots, for example:

telnet 192.168.1.1 5000     # note this is the IP of the model gateway and not the model
Note:
Connecting using telnet will also close the xterm popup window.

This is an example log of the model starting, and using telnet to access the console:

terminal_0: Listening for serial connection on port 5000
terminal_1: Listening for serial connection on port 5001
terminal_2: Listening for serial connection on port 5002
terminal_3: Listening for serial connection on port 5003
Visualization web server started on port 2001
Simulation is started
sh: xterm: command not found
 
telnet 192.168.1.1 5000


$ telnet 192.168.1.1 5000
Trying 192.168.1.1...
Connected to 192.168.1.1.
Escape character is '^]'.

The model will then start the first stage bootloader (tianocore), which will launch grub2, which will in turn boot the selected kernel, for example:

Note:
To navigate the menu use '<ctrl>n' - next and '<ctrl>p' - previous.
Secure firmware (version  built at 13:07:46 on Apr  7 2014)
PROGRESS CODE: V3020003 I0
PROGRESS CODE: V3020002 I0
PROGRESS CODE: V3020003 I0
PROGRESS CODE: V3021001 I0

+---------------------------------------------------------------------------+
|                                                                           |
|     ARM64, with Linux 3.14.0-0.rc8.git1.1.0.1.fc21.aarch64                |
|     ARM64, with Linux 0-rescue-79e714035d9e46cbbecc55e70a3b10a1           |
|                                                                           |
|                                                                           |
|                                                                           |
|                                                                           |
|                                                                           |
|                                                                           |
|                                                                           |
|                                                                           |
|                                                                           |
|                                                                           |
|   The selected entry will be started automatically in 1s.                 |
|   Press 'e' to edit the selected item, or 'c' for a command prompt.       |
+---------------------------------------------------------------------------+

EFI stub: Booting Linux Kernel...
	:

You should be able to ssh to the model once it has fully booted.

Note:
It may take several minutes for the model to be fully booted.
  • For ssh login:
ssh root@192.168.1.5        # note this is the IP address of the model


Notes:

  • Verify that the system date/time are correct.
  • To avoid image or filesystem corruption it is important to shutdown the model properly.
 shutdown -h now
  • After shutting down, ensure the Foundation Model process has been stopped before restarting.
 sudo kill -TERM <PID for the Foundation Model process>
  • The root password is 'fedora'.

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.