From Fedora Project Wiki
(Created page with "{{lang|en|zh-cn|page=Architectures/ARM/AArch64/QuickStart}} Category:AArch64{{shortcut|Arch:ARM}} = Aarch64 快速入门指南 = This page will help those new to aarch64(a...")
 
(Aarch64 快速入门指南)
Line 2: Line 2:
 
[[Category:AArch64]]{{shortcut|Arch:ARM}}
 
[[Category:AArch64]]{{shortcut|Arch:ARM}}
 
= Aarch64 快速入门指南 =
 
= Aarch64 快速入门指南 =
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.
+
本文档将帮助那些 aarch64(armv8) 新手开始使用由 ARM 提供的基础模型。 这个模型在使用时包含了许多选项,包括是使用磁盘镜像文件还是 NFS 根文件系统,以及内核的选择(基于你想要使用 Systemd 还是 Busybox 作为 init 进程)。
  
 
== 下载基础模型 ==
 
== 下载基础模型 ==
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.
+
第一步将是从 ARM 网站下载基础模型。 模型不是可重发布的,且因此你需要在 ARM 网站创建一个免费账户。一旦完成,你将可以下载基础模型并开始工作。
  
* [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 基础模型]
  
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
 
  sudo yum install xterm xorg-x11-fonts-{misc,100dpi,75dpi}* telnet bridge-utils
Line 15: Line 15:
 
== 解压基础模型 ==
 
== 解压基础模型 ==
  
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.
+
一旦你下载到了模型,你将需要设置你的工作环境。模型可以解压到你选择的路径,在本例中我们将使用你的 home 目录。
Unpack the model:
+
解压模型:
  
 
  mkdir ~/aarch64
 
  mkdir ~/aarch64
Line 24: Line 24:
 
== 模型和镜像文件配合使用 ==
 
== 模型和镜像文件配合使用 ==
  
{{admon/important|Bug!|There is a bug in the Foundation Model Virtual Disk I/O implementation that makes the model unstable.  Until it has been fixed using an NFS root will provide greater stability.}}
+
{{admon/important|Bug!|在基础模型的虚拟磁盘 I/O 实现中有一个 bug,它使得模型不稳定。在它被修复前,使用 NFS 根文件系统将较为稳定。}}
  
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.
+
使用以下命令,下载并解压 Aarch64 根文件系统磁盘镜像。 磁盘镜像将解压出一个大概 8GB 大小,且将耗费一段时间(取决于你的硬件)。
 
  cd ~/aarch64
 
  cd ~/aarch64
 
  wget http://fedorapeople.org/~pwhalen/aarch64/stage4-root-20130423.img.tar.bz2
 
  wget http://fedorapeople.org/~pwhalen/aarch64/stage4-root-20130423.img.tar.bz2
 
  tar xvjf stage4-root-20130423.img.tar.bz2
 
  tar xvjf stage4-root-20130423.img.tar.bz2
  
Download and extract the kernel package:
+
下载并解压内核包:
 
  wget http://fedorapeople.org/~pwhalen/aarch64/aarch64-kernels.tar.bz2
 
  wget http://fedorapeople.org/~pwhalen/aarch64/aarch64-kernels.tar.bz2
 
  tar xvjf 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:
 
  Systemd:
 
  sudo Foundation_v8pkg/Foundation_v8 --image aarch64-kernels/systemd-3.7-image-foundation.axf --block-device stage4-root-20130423.img --network=bridged
 
  sudo Foundation_v8pkg/Foundation_v8 --image aarch64-kernels/systemd-3.7-image-foundation.axf --block-device stage4-root-20130423.img --network=bridged
Line 41: Line 41:
 
  sudo Foundation_v8pkg/Foundation_v8 --image aarch64-kernels/busybox-3.7-image-foundation.axf --block-device stage4-root-20130423.img --network=bridged
 
  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''''.
+
模型将耗费几分钟时间启动。''''root'密码为'fedora',还有一个账户为 'builder' 密码为 'builder''''
  
 
==== 网络配置 ====
 
==== 网络配置 ====

Revision as of 03:29, 23 May 2013

Shortcut:
Arch:ARM

Aarch64 快速入门指南

本文档将帮助那些 aarch64(armv8) 新手开始使用由 ARM 提供的基础模型。 这个模型在使用时包含了许多选项,包括是使用磁盘镜像文件还是 NFS 根文件系统,以及内核的选择(基于你想要使用 Systemd 还是 Busybox 作为 init 进程)。

下载基础模型

第一步将是从 ARM 网站下载基础模型。 模型不是可重发布的,且因此你需要在 ARM 网站创建一个免费账户。一旦完成,你将可以下载基础模型并开始工作。

为了运行这个模型,你可能需要安装一些附加的软件,请按以下命令操作:

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

解压基础模型

一旦你下载到了模型,你将需要设置你的工作环境。模型可以解压到你选择的路径,在本例中我们将使用你的 home 目录。 解压模型:

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

模型和镜像文件配合使用

Important.png
Bug!
在基础模型的虚拟磁盘 I/O 实现中有一个 bug,它使得模型不稳定。在它被修复前,使用 NFS 根文件系统将较为稳定。

使用以下命令,下载并解压 Aarch64 根文件系统磁盘镜像。 磁盘镜像将解压出一个大概 8GB 大小,且将耗费一段时间(取决于你的硬件)。

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

下载并解压内核包:

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

现在模型可以通过使用磁盘镜像作为根文件系统被启动了,执行以下命令:

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

模型将耗费几分钟时间启动。'root'密码为'fedora',还有一个账户为 'builder' 密码为 'builder'

网络配置

After launching the model, sign in using the root account for the network to be auto-configured.

On the host system:

sudo ifconfig ARM0 10.0.0.1 netmask 255.255.255.0

模型和 NFS 根文件系统配合使用

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.

配置 NFS 根文件系统

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

sudo mkdir -p /var/exports/aarch64/stage4-nfs-root
cd /var/exports/aarch64/
sudo wget http://fedorapeople.org/~pwhalen/aarch64/stage4-root-20130423.tar.xz
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
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  # Fedora
service nfs start   # RHEL

用 NFS 根文件系统启动模型

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


让模型连接因特网

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

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

Aarch64 Bootstrap 入门

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)

su - builder

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:

[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

已知问题