arm64¶
Artifacts:
Important
If you are using a prebuilt Target, your artifacts may begin with lmp-base-console-image
instead.
└── arm64 ├── lmp-factory-image-qemuarm64-secureboot.wic.gz ├── other │ └── lmp-factory-image-qemuarm64-secureboot.wic.qcow2 # optional └── flash.bin
Note
You can fetch either the compressed .wic.gz
or the .qcow2
artifact, you do not need both.
Use the .qcow2 artifact if you wish to change the QEMU disk size.
Booting in QEMU¶
Important
These instructions require QEMU 5.2 or later.
Note
Make sure to set the FIOCTL_FACTORY environment variable:
export FIOCTL_FACTORY=<factory>
List available Targets and decide on which to boot:
fioctl targets list
Make a directory for the artifacts and
cd
into it:mkdir -p lmp-qemu/arm64 cd lmp-qemu/arm64
Download the artifacts needed for arm64. These can be found under the Targets tab for your Factory. Resizable qcow2 images are located in the
other
folder.Optional. Resize the qcow2 image:
qemu-img resize -f qcow2 lmp-factory-image-qemuarm64-secureboot.wic.qcow2 8G
The above example resizes to 8G—set to meet your needs.
Tip
If you already have the wic file, you can use it to create a qcow image:
qemu-img create -f qcow2 -F raw -b lmp-factory-image-qemuarm64-secureboot.wic lmp-factory-image-qemuarm64-secureboot.wic.qcow2
You can then use
qemu-img resize
as above.The directory tree should now look like this:
lmp-qemu/ └── arm64 ├── lmp-factory-image-qemuarm64-secureboot.wic ├── lmp-factory-image-qemuarm64-secureboot.wic.qcow2 # optional, needed if resizing is required └── flash.bin
Run the QEMU script below against the artifacts inside of
lmp-qemu/
. You can save this asrun.sh
inside the directory for convenience.
Important
If you are using the qcow2 image, change the script so that:
file=
is set as the qcow2 image name, i.e., lmp-factory-image-qemuarm64-secureboot.wic.qcow2format=raw
is replaced withformat=qcow2
.
For example:
qemu-system-aarch64 -m 1024 -cpu cortex-a57 -no-acpi -bios flash.bin \ -device virtio-net-device,netdev=net0,mac=52:54:00:12:35:02 -device virtio-serial-device \ -drive id=disk0,file=lmp-factory-image-qemuarm64-secureboot.wic.qcow2,if=none,format=qcow2 \ -device virtio-blk-device,drive=disk0 -netdev user,id=net0,hostfwd=tcp::2222-:22 \ -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0 \ -chardev null,id=virtcon -machine virt,secure=on -nographic
Note
The QEMU CLI passes the necessary flags and parameters to the appropriate qemu-system command. This includes path to the image, CPU, network, and other device information. For specifics, consult QEMU’s Documentation.
Booting Graphically¶
In order to boot QEMU with an OpenGL capable virtual GPU (required for Wayland/Weston), add the following flags to the QEMU CLI:
-display gtk,gl=on -device virtio-gpu-pci
Do not copy the -nographic
flag at the end of the QEMU CLI below.
QEMU CLI¶
qemu-system-aarch64 -m 1024 -cpu cortex-a57 -no-acpi -bios flash.bin \
-device virtio-net-device,netdev=net0,mac=52:54:00:12:35:02 -device virtio-serial-device \
-drive id=disk0,file=lmp-factory-image-qemuarm64-secureboot.wic,if=none,format=raw \
-device virtio-blk-device,drive=disk0 -netdev user,id=net0,hostfwd=tcp::2222-:22 \
-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0 \
-chardev null,id=virtcon -machine virt,secure=on -nographic
Hint
To access QEMU via SSH, append these parameters to the QEMU CLI command above:
-netdev user,id=net0,hostfwd=tcp::2222-:22
Then, run SSH with:
ssh -p 2222 fio@localhost
Tip
You can register your device by following the steps from Registering Your Device.