qemu-e2k/tests/vm/ubuntu.aarch64
Philippe Mathieu-Daudé 57c1a9a706 tests/vm/ubuntu.aarch64: Correct comment about TCG specific delay
Wether we use a software MMU or not to set the SSH timeout
isn't really relevant. What we want to know is if we use
a hardware or software accelerator (TCG).
Replace the 'softmmu' mention by 'TCG'.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20231002145104.52193-2-philmd@linaro.org>
2023-11-07 12:13:27 +01:00

73 lines
2.7 KiB
Python
Executable File

#!/usr/bin/env python3
#
# Ubuntu aarch64 image
#
# Copyright 2020 Linaro
#
# Authors:
# Robert Foley <robert.foley@linaro.org>
# Originally based on ubuntu.i386 Fam Zheng <famz@redhat.com>
#
# This code is licensed under the GPL version 2 or later. See
# the COPYING file in the top-level directory.
#
import sys
import basevm
import aarch64vm
import ubuntuvm
DEFAULT_CONFIG = {
'cpu' : "cortex-a57",
'machine' : "virt,gic-version=3",
'install_cmds' : "apt-get update,"\
"apt-get build-dep -y --arch-only qemu,"\
"apt-get install -y libfdt-dev pkg-config language-pack-en ninja-build",
# We increase beyond the default time since during boot
# it can take some time (many seconds) to log into the VM
# especially using TCG.
'ssh_timeout' : 60,
}
class UbuntuAarch64VM(ubuntuvm.UbuntuVM):
name = "ubuntu.aarch64"
arch = "aarch64"
# NOTE: The Ubuntu 20.04 cloud images are periodically updated. The
# fixed image chosen below is the latest release at time of
# writing. Using a rolling latest instead would mean that the SHA
# would be incorrect at an indeterminate point in the future.
image_name = "focal-server-cloudimg-arm64.img"
image_link = "https://cloud-images.ubuntu.com/focal/20220615/" + image_name
image_sha256="95a027336e197debe88c92ff2e554598e23c409139e1e750b71b3b820b514832"
BUILD_SCRIPT = """
set -e;
cd $(mktemp -d);
sudo chmod a+r /dev/vdb;
tar --checkpoint=.10 -xf /dev/vdb;
./configure {configure_opts};
make --output-sync {target} -j{jobs} {verbose};
"""
def boot(self, img, extra_args=None):
aarch64vm.create_flash_images(self._tmpdir, self._efi_aarch64)
default_args = aarch64vm.get_pflash_args(self._tmpdir)
if extra_args:
extra_args.extend(default_args)
else:
extra_args = default_args
# We always add these performance tweaks
# because without them, we boot so slowly that we
# can time out finding the boot efi device.
if '-smp' not in extra_args and \
'-smp' not in self._config['extra_args'] and \
'-smp' not in self._args:
# Only add if not already there to give caller option to change it.
extra_args.extend(["-smp", "8"])
# We have overridden boot() since aarch64 has additional parameters.
# Call down to the base class method.
super(UbuntuAarch64VM, self).boot(img, extra_args=extra_args)
if __name__ == "__main__":
defaults = aarch64vm.get_config_defaults(UbuntuAarch64VM, DEFAULT_CONFIG)
sys.exit(basevm.main(UbuntuAarch64VM, defaults))