docs: Consolidate building on AArch64 to building.md

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
This commit is contained in:
Henry Wang
2022-12-07 23:28:38 -05:00
committed by Rob Bradford
parent d15e1f1a13
commit 6835dfa5e9
2 changed files with 8 additions and 37 deletions
-33
View File
@@ -7,39 +7,6 @@ booting and direct-kernel booting. The document covers both methods.
All the steps are based on Ubuntu. We use the Ubuntu cloud image for guest VM All the steps are based on Ubuntu. We use the Ubuntu cloud image for guest VM
disk. disk.
## Getting started
We create a folder to build and run Cloud Hypervisor at `$HOME/cloud-hypervisor`
```shell
$ export CLOUDH=$HOME/cloud-hypervisor
$ mkdir $CLOUDH
```
## Prerequisites
You need to install some prerequisite packages to build and test Cloud Hypervisor.
### Tools
```bash
# Install rust tool chain
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Install the tools used for building guest kernel, EDK2 and converting guest disk
$ sudo apt-get update
$ sudo apt-get install git build-essential m4 bison flex uuid-dev qemu-utils
```
### Building Cloud Hypervisor
```bash
$ pushd $CLOUDH
$ git clone https://github.com/cloud-hypervisor/cloud-hypervisor.git
$ cd cloud-hypervisor
$ cargo build
$ popd
```
### Disk image ### Disk image
Download the Ubuntu cloud image and convert the image type. Download the Ubuntu cloud image and convert the image type.
+8 -4
View File
@@ -24,12 +24,15 @@ Hypervisor. Here, all the steps are based on Ubuntu, for other Linux
distributions please replace the package manager and package name. distributions please replace the package manager and package name.
```shell ```shell
# Install build-essential, git, and qemu-utils # Install basic packages needed. For a package list targeting for more
$ sudo apt install git build-essential qemu-utils # functionalities for example the test, please see resources/Dockerfile.
$ sudo apt-get update
$ sudo apt install git build-essential m4 bison flex uuid-dev qemu-utils
# Install rust tool chain # Install rust tool chain
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh $ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# If you want to build statically linked binary please add musl target # If you want to build statically linked binary please add musl target
$ rustup target add x86_64-unknown-linux-musl $ rustup target add x86_64-unknown-linux-musl # x86-64
$ rustup target add aarch64-unknown-linux-musl # AArch64
``` ```
## Clone and build ## Clone and build
@@ -46,7 +49,8 @@ $ cargo build --release
$ sudo setcap cap_net_admin+ep ./target/release/cloud-hypervisor $ sudo setcap cap_net_admin+ep ./target/release/cloud-hypervisor
# If you want to build statically linked binary # If you want to build statically linked binary
$ cargo build --release --target=x86_64-unknown-linux-musl --all $ cargo build --release --target=x86_64-unknown-linux-musl --all # x86-64
$ cargo build --release --target=aarch64-unknown-linux-musl --all # AArch64
$ popd $ popd
``` ```