Skip to content

Commit 73b6c60

Browse files
committed
release: update documentation on supported archs
Signed-off-by: Diana Popa <[email protected]>
1 parent 5e9e3a1 commit 73b6c60

File tree

2 files changed

+97
-51
lines changed

2 files changed

+97
-51
lines changed

docs/api_requests/actions.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ curl --unix-socket /tmp/firecracker.socket -i \
8686
}"
8787
```
8888

89-
9089
## SendCtrlAltDel
9190

9291
This action will send the CTRL+ALT+DEL key sequence to the microVM. By
@@ -100,12 +99,14 @@ i8042 controller. Driver support for both these devices needs to be present in
10099
the guest OS. For Linux, that means the guest kernel needs
101100
`CONFIG_SERIO_I8042` and `CONFIG_KEYBOARD_ATKBD`.
102101

103-
**Note on boot time impact**: at, boot time the Linux driver for i8042 spends
102+
**Note1**: at boot time, the Linux driver for i8042 spends
104103
a few tens of milliseconds probing the device. This can be disabled by using
105104
these kernel command line parameters:
106105

107106
```i8042.noaux i8042.nomux i8042.nopnp i8042.dumbkbd```
108107

108+
**Note2** This action is only supported on `x86_64` architecture.
109+
109110
### SendCtrlAltDel Example
110111

111112
```bash

docs/getting-started.md

Lines changed: 94 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ The generic requirements are explained below:
2525

2626
- **Linux 4.14+**
2727

28-
Firecracker currently supports physical Linux x86_64 hosts, running kernel
29-
version 4.14 or later.
28+
Firecracker currently supports physical Linux **x86_64** and **aarch64**
29+
hosts, running kernel version 4.14 or later. However, the **aarch64** support
30+
is not feature complete (alpha stage).
3031

3132
- **KVM**
3233

@@ -42,16 +43,18 @@ The generic requirements are explained below:
4243
the basic requirements to run Firecracker.</summary>
4344

4445
```bash
45-
err=""; \
46-
[ "$(uname) $(uname -m)" = "Linux x86_64" ] \
47-
|| err="ERROR: your system is not Linux x86_64."; \
48-
[ -r /dev/kvm ] && [ -w /dev/kvm ] \
49-
|| err="$err\nERROR: /dev/kvm is innaccessible."; \
50-
(( $(uname -r | cut -d. -f1)*1000 + $(uname -r | cut -d. -f2) >= 4014 )) \
51-
|| err="$err\nERROR: your kernel version ($(uname -r)) is too old."; \
52-
dmesg | grep -i "hypervisor detected" \
53-
&& echo "WARNING: you are running in a virtual machine. Firecracker is not well tested under nested virtualization."; \
54-
[ -z "$err" ] && echo "Your system looks ready for Firecracker!" || echo -e "$err"
46+
err="";
47+
[ "$(uname) $(uname -m)" = "Linux x86_64" ] \
48+
|| [ "$(uname) $(uname -m)" = "Linux aarch64" ] \
49+
|| err="ERROR: your system is not Linux x86_64 or Linux aarch64."; \
50+
[ -r /dev/kvm ] && [ -w /dev/kvm ] \
51+
|| err="$err\nERROR: /dev/kvm is innaccessible."; \
52+
(( $(uname -r | cut -d. -f1)*1000 + $(uname -r | cut -d. -f2) >= 4014 )) \
53+
|| err="$err\nERROR: your kernel version ($(uname -r)) is too old."; \
54+
dmesg | grep -i "hypervisor detected" \
55+
&& echo "WARNING: you are running in a virtual machine." \
56+
&& echo "Firecracker is not well tested under nested virtualization."; \
57+
[ -z "$err" ] && echo "Your system looks ready for Firecracker!" || echo -e "$err"
5558
```
5659

5760
</details>
@@ -62,7 +65,7 @@ Firecracker is linked statically against
6265
[musl](https://www.musl-libc.org/), having no library dependencies. You can
6366
just download the latest binary from our
6467
[release page](https://github.com/firecracker-microvm/firecracker/releases),
65-
and run it on your x86_64 Linux machine.
68+
and run it on your x86_64 or aarch64 Linux machine.
6669

6770
On the EC2 instance, this binary can be downloaded as:
6871

@@ -82,7 +85,6 @@ Make the binary executable:
8285
chmod +x firecracker
8386
```
8487

85-
8688
If, instead, you'd like to build Firecracker yourself, you should check out
8789
the [Building From Source section](#building-from-source) in this doc.
8890

@@ -100,14 +102,14 @@ First, make sure you have the `firecracker` binary available - either
100102
[built from source](#building-from-source).
101103

102104
Next, you will need an uncompressed Linux kernel binary, and an ext4
103-
file system image (to use as rootfs). You can use these files from our
104-
microVM image S3 bucket:
105-
[kernel](
106-
https://s3.amazonaws.com/spec.ccfc.min/img/hello/kernel/hello-vmlinux.bin
107-
), and
108-
[rootfs](
109-
https://s3.amazonaws.com/spec.ccfc.min/img/hello/fsfiles/hello-rootfs.ext4
110-
).
105+
file system image (to use as rootfs).
106+
107+
1. To run an `x86_64` guest you can download such resources from:
108+
[kernel](https://s3.amazonaws.com/spec.ccfc.min/img/hello/kernel/hello-vmlinux.bin)
109+
and [rootfs](https://s3.amazonaws.com/spec.ccfc.min/img/hello/fsfiles/hello-rootfs.ext4).
110+
1. To run an `aarch64` guest, download them from:
111+
[kernel](https://s3.amazonaws.com/spec.ccfc.min/img/aarch64/ubuntu_with_ssh/kernel/vmlinux.bin)
112+
and [rootfs](https://s3.amazonaws.com/spec.ccfc.min/img/aarch64/ubuntu_with_ssh/fsfiles/xenial.rootfs.ext4).
111113

112114
Now, let's open up two shell prompts: one to run Firecracker, and another one
113115
to control it (by writing to the API socket). For the purpose of this guide,
@@ -133,33 +135,72 @@ In your **second shell** prompt:
133135
- get the kernel and rootfs, if you don't have any available:
134136

135137
```bash
136-
curl -fsSL -o hello-vmlinux.bin https://s3.amazonaws.com/spec.ccfc.min/img/hello/kernel/hello-vmlinux.bin
137-
curl -fsSL -o hello-rootfs.ext4 https://s3.amazonaws.com/spec.ccfc.min/img/hello/fsfiles/hello-rootfs.ext4
138+
arch=`uname -m`
139+
dest_kernel="hello-vmlinux.bin"
140+
dest_rootfs="hello-rootfs.ext4"
141+
image_bucket_url="https://s3.amazonaws.com/spec.ccfc.min/img"
142+
143+
if [ ${arch} = "x86_64" ]; then
144+
kernel="${image_bucket_url}/hello/kernel/hello-vmlinux.bin"
145+
rootfs="${image_bucket_url}/hello/fsfiles/hello-rootfs.ext4"
146+
elif [ ${arch} = "aarch64" ]; then
147+
kernel="${image_bucket_url}/aarch64/ubuntu_with_ssh/kernel/vmlinux.bin"
148+
rootfs="${image_bucket_url}/aarch64/ubuntu_with_ssh/fsfiles/xenial.rootfs.ext4"
149+
else
150+
echo "Cannot run firecracker on $arch architecture!"
151+
exit 1
152+
fi
153+
154+
echo "Downloading $kernel..."
155+
curl -fsSL -o $dest_kernel $kernel
156+
157+
echo "Downloading $rootfs..."
158+
curl -fsSL -o $dest_rootfs $rootfs
159+
160+
echo "Saved kernel file to $dest_kernel and root block device to $dest_rootfs."
138161
```
139162

140163
- set the guest kernel:
141164

142165
```bash
143-
curl --unix-socket /tmp/firecracker.socket -i \
144-
-X PUT 'http://localhost/boot-source' \
145-
-H 'Accept: application/json' \
146-
-H 'Content-Type: application/json' \
147-
-d '{
148-
"kernel_image_path": "./hello-vmlinux.bin",
149-
"boot_args": "console=ttyS0 reboot=k panic=1 pci=off"
150-
}'
166+
arch=`uname -m`
167+
kernel_path="hello-vmlinux.bin"
168+
169+
if [ ${arch} = "x86_64" ]; then
170+
curl --unix-socket /tmp/firecracker.socket -i \
171+
-X PUT 'http://localhost/boot-source' \
172+
-H 'Accept: application/json' \
173+
-H 'Content-Type: application/json' \
174+
-d '{
175+
"kernel_image_path": \"${kernel_path}\",
176+
"boot_args": "console=ttyS0 reboot=k panic=1 pci=off"
177+
}'
178+
elif [ ${arch} = "aarch64" ]; then
179+
curl --unix-socket /tmp/firecracker.socket -i \
180+
-X PUT 'http://localhost/boot-source' \
181+
-H 'Accept: application/json' \
182+
-H 'Content-Type: application/json' \
183+
-d '{
184+
"kernel_image_path": \"${kernel_path}\,
185+
"boot_args": "keep_bootcon console=tty1 reboot=k panic=1 pci=off"
186+
}'
187+
else
188+
echo "Cannot run firecracker on $arch architecture!"
189+
exit 1
190+
fi
151191
```
152192

153193
- set the guest rootfs:
154194

155195
```bash
156-
curl --unix-socket /tmp/firecracker.socket -i \
196+
rootfs_path="hello-rootfs.ext4"
197+
curl --unix-socket /tmp/firecracker.socket -i \
157198
-X PUT 'http://localhost/drives/rootfs' \
158199
-H 'Accept: application/json' \
159200
-H 'Content-Type: application/json' \
160201
-d '{
161202
"drive_id": "rootfs",
162-
"path_on_host": "./hello-rootfs.ext4",
203+
"path_on_host": \"${rootfs_path}\,
163204
"is_root_device": true,
164205
"is_read_only": false
165206
}'
@@ -181,11 +222,9 @@ Going back to your first shell, you should now see a serial TTY prompting you
181222
to log into the guest machine. If you used our `hello-rootfs.ext4` image,
182223
you can login as `root`, using the password `root`.
183224

184-
When you're done,
185-
issuing a `reboot` command inside the guest will shutdown Firecracker
186-
gracefully. This is because, since microVMs are not designed to be restarted,
187-
and Firecracker doesn't currently implement guest power management, we're
188-
using the keyboard reset action as a shut down switch.
225+
When you're done, issuing a `reboot` command inside the guest will actually
226+
shutdown Firecracker gracefully. This is due to the fact that Firecracker
227+
doesn't implement guest power management.
189228

190229
**Note**: the default microVM will have 1 vCPU and 128 MiB RAM. If you wish to
191230
customize that (say, 2 vCPUs and 1024MiB RAM), you can do so before issuing
@@ -206,7 +245,7 @@ curl --unix-socket /tmp/firecracker.socket -i \
206245

207246
The quickest way to build and test Firecracker is by using our development
208247
tool ([`tools/devtool`](../tools/devtool)). It employs a
209-
[Docker container](../tools/devctr/Dockerfile) to store the software toolchain
248+
per-architecture [Docker container](../tools/devctr/) to store the software toolchain
210249
used throughout the development process. If you need help setting up
211250
[Docker](https://docker.com) on your system, you can check out
212251
[Appendix B: Setting Up Docker](#appendix-b-setting-up-docker).
@@ -231,9 +270,8 @@ git checkout tags/v0.10.1
231270

232271
Within the Firecracker repository root directory:
233272

234-
```bash
235-
tools/devtool build
236-
```
273+
1. on an **x86_64** machine: ```tools/devtool build```
274+
1. on an **aarch64** machine: ```tools/devtool build -- --target aarch64-unknown-linux-musl```
237275

238276
This will build and place the two Firecracker binaries at
239277
`build/debug/firecracker` and `build/debug/jailer`. The default build profile
@@ -264,7 +302,8 @@ toolchains, such as the default Rust toolchains provided in certain Linux
264302
distributions:
265303

266304
```bash
267-
cargo build --target x86_64-unknown-linux-gnu
305+
arch=`uname -m`
306+
cargo build --target ${arch}-unknown-linux-gnu
268307
```
269308

270309
That being said, Firecracker binaries built without `devtool` are always
@@ -283,7 +322,11 @@ Please note that the test suite is designed to ensure our
283322
and, as such, some performance tests may fail when run on a regular desktop
284323
machine. Specifically, don't be alarmed if you see
285324
`tests/integration_tests/performance/test_process_startup_time.py` failing when
286-
not run on an EC2 .metal instance.
325+
not run on an EC2 .metal instance. You can skip performance tests with:
326+
327+
```bash
328+
./tools/devtool test -- --ignore integration_tests/performance
329+
```
287330

288331
## Appendix A: Setting Up KVM Access
289332

@@ -298,17 +341,19 @@ sudo setfacl -m u:${USER}:rw /dev/kvm
298341
Otherwise, if access is managed via the `kvm` group:
299342

300343
```bash
301-
[ $(stat -c "%G" /dev/kvm) = kvm ] && sudo usermod -aG kvm ${USER} && echo "Access granted."
344+
[ $(stat -c "%G" /dev/kvm) = kvm ] && sudo usermod -aG kvm ${USER} \
345+
&& echo "Access granted."
302346
```
303347

304348
If none of the above works, you will need to either install the file
305349
system ACL package for your distro and use the `setfacl` command as above,
306350
or run Firecracker as `root` (via `sudo`).
307351

308352
You can check if you have access to `/dev/kvm` with:
309-
```bash
310-
[ -r /dev/kvm ] && [ -w /dev/kvm ] && echo "OK" || echo "FAIL"
311-
```
353+
354+
```bash
355+
[ -r /dev/kvm ] && [ -w /dev/kvm ] && echo "OK" || echo "FAIL"
356+
```
312357

313358
**Note:** If you've just added your user to the `kvm` group via `usermod`, don't
314359
forget to log out and then back in, so this change takes effect.

0 commit comments

Comments
 (0)