Install QEMU
This document describes how to build and run for the QEMU target. It is assumed that you have completed the procedures outlined on the Getting started page. If not, begin there before proceeding.
Building
Since we are using a virtual Python environment, we need begin by sourceing it.
$ source <workspace root>/.pyvenv/bin/activate
Note
The source
above has to be done once everytime you spawn a new shell.
Start the build, this will probably take several hours on a normal desktop
computer the first time you’re building it with nothing in the cache(s). The TRS
is based on various Yocto layers and if you don’t have your DL_DIR
and
SSTATE_DIR
set as an environment variable, those will be set to
$HOME/yocto_cache
by default. Note that the clean target will leave
download and sstate chaches in place and is relatively fast operation
and quite often needed when updates have been applied to the yocto meta layers.
$ cd <workspace root>
$ make
Run
After the build is complete, you will be able to run it on your host system using QEMU.
$ make run
U-Boot is already set to boot the current kernel, initramfs, and rootfs upon initial startup.
Note
To quit QEMU, press Ctrl-A x
(alternatively kill the qemu-system-aarch64 process)
If everything goes as expected, you will presented login message and a login
prompt. The login name is ewaol
as depicted below.
ledge-secure-qemuarm64 login: ewaol
ewaol@ledge-secure-qemuarm64:~$
Test
Once the build has been completed, you can run automatic tests with QEMU. These boot QEMU using the compiled images and run test commands via SSH on the running system. While the QEMU image is running, SSH access to it works via localhost IP address 127.0.0.1 and TCP port 2222. TEST_SUITES variable in trs-image.bb recipe define which tests are executed.
$ cd <workspace root>
$ make test
See yocto runtime testing documentation for details about the test environment and instructions for writing new tests.