From nobody Fri Nov 14 20:44:37 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1589894980; cv=none; d=zohomail.com; s=zohoarc; b=X8P3mC0I5z9q7lLnC1BW5OPRAZIfssWPGL6Tabh41D6c7dUALzEqIKDQaVe92V0tTSzfaXnxGyZX3e00u6XMKj34pirw7egbqvLUaarVG40YUjw7Wt2QBXkNzwY0WYegXGYhmxIBs7EIVJlZDXfOUDcfz6mYjDI9eMjogVnQQOY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589894980; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=hRJbeljuhFtssg60zdnBdDHTLLrxjHn5JbFqjLmgTw0=; b=DgDzq5NLaxR2fa+AeUIVC+VOtW6nW0sL98AuSRTAMNOx/mN4gsZSrGDIBD7fjfBmxmuOzuLsXWktVnKbmqcG0s8Zh0b+E+uo8WsT1xSvcUqbffMIGljtGh540/j2Q9AwZZ7gtCx/LGIqWOEDJq566g6NRYSAWE6f3niuXApArD8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1589894980167931.8907465266997; Tue, 19 May 2020 06:29:40 -0700 (PDT) Received: from localhost ([::1]:37596 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jb2JO-0001TA-FI for importer@patchew.org; Tue, 19 May 2020 09:29:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60384) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jb2Gu-0005KO-Kc for qemu-devel@nongnu.org; Tue, 19 May 2020 09:27:04 -0400 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]:35748) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jb2Gs-0008Nq-Qp for qemu-devel@nongnu.org; Tue, 19 May 2020 09:27:04 -0400 Received: by mail-qt1-x835.google.com with SMTP id z18so11083741qto.2 for ; Tue, 19 May 2020 06:27:02 -0700 (PDT) Received: from Rfoley-MA01.hsd1.ma.comcast.net ([2601:199:4480:60c0:dd6a:8c63:cd9d:ad15]) by smtp.gmail.com with ESMTPSA id d74sm3482136qke.100.2020.05.19.06.27.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:27:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hRJbeljuhFtssg60zdnBdDHTLLrxjHn5JbFqjLmgTw0=; b=BLZOX05vG2ZfsP3E9JZYCJaXNBSkE68zg+A3+41LHy4iX95ThTX9Hd2Vl+TuaVFYya j0PnzsxGrGSnqhI0KgsTv9VGP6gY7o92+WiuKooM/IXWuay32pveEGmTwEoTEYGK7uvR ypD/gMuuOAbOlTjqcaz6hEWifPZi1RY/PnnvoXR4HXGtCFPW2Y2E8XV+HEt15tzBMhdF zpgl0rqkSz22ZIPOk28gNUHGlsTLZHczPVwGXGxm0HQxqN8GZxtXINUsfodzXR+e84/4 jWpC3X+grxmrTP2982Fyg3nbTFIjRhsltgxAVcqUTZkAacBmy1Zgumr5P5CvSdeLvcES CwZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hRJbeljuhFtssg60zdnBdDHTLLrxjHn5JbFqjLmgTw0=; b=XjUlu8qIV8A66ZZO3/vc+Sob6mQ2Z/j5cIfNJ7JjKPA+NnyAgR2TAqt1K2BhfSkh3a ih9tZDXB7LBE2xtN040vHwYXijIyB5Ynie7XKN3+hF29PwD0zHfpofKnygdxqpA5MssV /hWuijhgvBwSZmL1trpJCZ39uNwwcsNkJrsjmbeqA3EtJPohmIhtvvVOzEyUIlK+ntUN VZITKcoQMOHHGpn6UMZZTIyuudiNB8M455cEV52fDsuelzEKwFfedOfbPKsXQtfx5ZJK +Ps4S57DWCeKPIe/NVENkZLlXUecL7aF3CiOYbVOLJ1eWG7X6gqpnNAlcENJLliglufM 1E6Q== X-Gm-Message-State: AOAM532/6Xgrf9vzDh+u2QAg53KZSN37qdlq4E/Yr17SCLw7L5Ch9jLC QGNZmQtVMeXtO9vsTpcamVQoW+kRpJaI5g== X-Google-Smtp-Source: ABdhPJzGw5Pn1XVqrjeUfjGoZvoVou1RvLOgm+XSDSnNnlUvNr9oRLlNlGFs5rtwXMv3hu/j8ilqjA== X-Received: by 2002:ac8:1381:: with SMTP id h1mr17590077qtj.98.1589894821156; Tue, 19 May 2020 06:27:01 -0700 (PDT) From: Robert Foley To: qemu-devel@nongnu.org Subject: [PATCH v7 09/12] tests/vm: Added a new script for ubuntu.aarch64. Date: Tue, 19 May 2020 09:22:56 -0400 Message-Id: <20200519132259.405-10-robert.foley@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200519132259.405-1-robert.foley@linaro.org> References: <20200519132259.405-1-robert.foley@linaro.org> Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::835; envelope-from=robert.foley@linaro.org; helo=mail-qt1-x835.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: philmd@redhat.com, alex.bennee@linaro.org, robert.foley@linaro.org, peter.puhov@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" ubuntu.aarch64 provides a script to create an Ubuntu 18.04 VM. Another new file is also added aarch64vm.py, which is a module with common methods used by aarch64 VMs, such as how to create the flash images. Signed-off-by: Robert Foley Reviewed-by: Peter Puhov --- configure | 20 +++++++ tests/vm/Makefile.include | 11 ++++ tests/vm/aarch64vm.py | 106 ++++++++++++++++++++++++++++++++++ tests/vm/basevm.py | 12 ++++ tests/vm/ubuntu.aarch64 | 117 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 266 insertions(+) create mode 100644 tests/vm/aarch64vm.py create mode 100755 tests/vm/ubuntu.aarch64 diff --git a/configure b/configure index 89d11aa5d4..d38db335dd 100755 --- a/configure +++ b/configure @@ -411,6 +411,7 @@ prefix=3D"/usr/local" mandir=3D"\${prefix}/share/man" datadir=3D"\${prefix}/share" firmwarepath=3D"\${prefix}/share/qemu-firmware" +efi_aarch64_arg=3D qemu_docdir=3D"\${prefix}/share/doc/qemu" bindir=3D"\${prefix}/bin" libdir=3D"\${prefix}/lib" @@ -1099,6 +1100,8 @@ for opt do ;; --firmwarepath=3D*) firmwarepath=3D"$optarg" ;; + --efi-aarch64=3D*) efi_aarch64_arg=3D"$optarg" + ;; --host=3D*|--build=3D*|\ --disable-dependency-tracking|\ --sbindir=3D*|--sharedstatedir=3D*|\ @@ -1753,6 +1756,7 @@ Advanced options (experts only): --sysconfdir=3DPATH install config in PATH$confsuffix --localstatedir=3DPATH install local state in PATH (set at runtime o= n win32) --firmwarepath=3DPATH search PATH for firmware files + --efi-aarch64=3DPATH PATH of efi file to use for aarch64 VMs. --with-confsuffix=3DSUFFIX suffix for QEMU data inside datadir/libdir/sy= sconfdir [$confsuffix] --with-pkgversion=3DVERS use specified string as sub-version of the pa= ckage --enable-debug enable common debug build options @@ -3548,6 +3552,20 @@ EOF fi fi =20 +############################################ +# efi-aarch64 probe +# Check for efi files needed by aarch64 VMs. +# By default we will use the efi included with QEMU. +# Allow user to override the path for efi also. +qemu_efi_aarch64=3D$PWD/pc-bios/edk2-aarch64-code.fd +for fd in $efi_aarch64_arg $qemu_efi_aarch64 +do + if test -f $fd; then + efi_aarch64=3D$fd + break + fi +done + ########################################## # libcap-ng library probe if test "$cap_ng" !=3D "no" ; then @@ -6588,6 +6606,7 @@ if test "$docs" !=3D "no"; then echo "sphinx-build $sphinx_build" fi echo "genisoimage $genisoimage" +echo "efi_aarch64 $efi_aarch64" echo "python_yaml $python_yaml" echo "slirp support $slirp $(echo_version $slirp $slirp_version)" if test "$slirp" !=3D "no" ; then @@ -7650,6 +7669,7 @@ echo "PYTHON=3D$python" >> $config_host_mak echo "SPHINX_BUILD=3D$sphinx_build" >> $config_host_mak echo "SPHINX_WERROR=3D$sphinx_werror" >> $config_host_mak echo "GENISOIMAGE=3D$genisoimage" >> $config_host_mak +echo "EFI_AARCH64=3D$efi_aarch64" >> $config_host_mak echo "PYTHON_YAML=3D$python_yaml" >> $config_host_mak echo "CC=3D$cc" >> $config_host_mak if $iasl -h > /dev/null 2>&1; then diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include index 83a33b1044..1cbfc08361 100644 --- a/tests/vm/Makefile.include +++ b/tests/vm/Makefile.include @@ -5,6 +5,9 @@ IMAGES :=3D freebsd netbsd openbsd centos fedora ifneq ($(GENISOIMAGE),) IMAGES +=3D ubuntu.i386 centos +ifneq ($(EFI_AARCH64),) +IMAGES +=3D ubuntu.aarch64 +endif endif =20 IMAGES_DIR :=3D $(HOME)/.cache/qemu-vm/images @@ -23,6 +26,11 @@ vm-help vm-test: ifneq ($(GENISOIMAGE),) @echo " vm-build-centos - Build QEMU in CentOS VM, with = Docker" @echo " vm-build-ubuntu.i386 - Build QEMU in ubuntu i386 VM" +ifneq ($(EFI_AARCH64),) + @echo " vm-build-ubuntu.aarch64 - Build QEMU in ubuntu aarch64 V= M" +else + @echo " (install qemu-efi-aarch64 to build centos/ubuntu aarch64 images.= )" +endif else @echo " (install genisoimage to build centos/ubuntu images)" endif @@ -64,6 +72,7 @@ $(IMAGES_DIR)/%.img: $(SRC_PATH)/tests/vm/% \ $(PYTHON) $< \ $(if $(V)$(DEBUG), --debug) \ $(if $(GENISOIMAGE),--genisoimage $(GENISOIMAGE)) \ + $(if $(EFI_AARCH64),--efi-aarch64 $(EFI_AARCH64)) \ --build-path $(BUILD_DIR)\ --image "$@" \ --force \ @@ -79,6 +88,7 @@ vm-build-%: $(IMAGES_DIR)/%.img $(if $(DEBUG), --interactive) \ $(if $(J),--jobs $(J)) \ $(if $(V),--verbose) \ + $(if $(EFI_AARCH64),--efi-aarch64 $(EFI_AARCH64)) \ --build-path $(BUILD_DIR)\ --image "$<" \ $(if $(BUILD_TARGET),--build-target $(BUILD_TARGET)) \ @@ -101,6 +111,7 @@ vm-boot-ssh-%: $(IMAGES_DIR)/%.img $(PYTHON) $(SRC_PATH)/tests/vm/$* \ $(if $(J),--jobs $(J)) \ $(if $(V)$(DEBUG), --debug) \ + $(if $(EFI_AARCH64),--efi-aarch64 $(EFI_AARCH64)) \ --build-path $(BUILD_DIR)\ --image "$<" \ --interactive \ diff --git a/tests/vm/aarch64vm.py b/tests/vm/aarch64vm.py new file mode 100644 index 0000000000..bb04cb19c9 --- /dev/null +++ b/tests/vm/aarch64vm.py @@ -0,0 +1,106 @@ +#!/usr/bin/env python3 +# +# VM testing aarch64 library +# +# Copyright 2020 Linaro +# +# Authors: +# Robert Foley +# +# This code is licensed under the GPL version 2 or later. See +# the COPYING file in the top-level directory. +# +import os +import sys +import subprocess +import basevm +from qemu.accel import kvm_available + +# This is the config needed for current version of QEMU. +# This works for both kvm and tcg. +CURRENT_CONFIG =3D { + 'cpu' : "max", + 'machine' : "virt,gic-version=3Dmax", +} + +# The minimum minor version of QEMU we will support with aarch64 VMs is 3. +# QEMU versions less than 3 have various issues running these VMs. +QEMU_AARCH64_MIN_VERSION =3D 3 + +# The DEFAULT_CONFIG will default to a version of +# parameters that works for backwards compatibility. +DEFAULT_CONFIG =3D {'kvm' : {'cpu' : "host", + 'machine' : "virt,gic-version=3Dhost"}, + 'tcg' : {'cpu' : "cortex-a57", + 'machine' : "virt"}, +} + +def get_config_defaults(vmcls, default_config): + """Fetch the configuration defaults for this VM, + taking into consideration the defaults for + aarch64 first, followed by the defaults for this VM.""" + config =3D default_config + config.update(aarch_get_config_defaults(vmcls)) + return config + +def aarch_get_config_defaults(vmcls): + """Set the defaults for current version of QEMU.""" + config =3D CURRENT_CONFIG + args, argv =3D basevm.parse_args(vmcls) + qemu_path =3D basevm.get_qemu_path(vmcls.arch, args.build_path) + qemu_version =3D basevm.get_qemu_version(qemu_path) + if qemu_version < QEMU_AARCH64_MIN_VERSION: + error =3D "\nThis major version of QEMU {} is to old for aarch64 V= Ms.\n"\ + "The major version must be at least {}.\n"\ + "To continue with the current build of QEMU, "\ + "please restart with QEMU_LOCAL=3D1 .\n" + print(error.format(qemu_version, QEMU_AARCH64_MIN_VERSION)) + exit(1) + if qemu_version =3D=3D QEMU_AARCH64_MIN_VERSION: + # We have an older version of QEMU, + # set the config values for backwards compatibility. + if kvm_available('aarch64'): + config.update(DEFAULT_CONFIG['kvm']) + else: + config.update(DEFAULT_CONFIG['tcg']) + return config + +def create_flash_images(flash_dir=3D"./", efi_img=3D""): + """Creates the appropriate pflash files + for an aarch64 VM.""" + flash0_path =3D get_flash_path(flash_dir, "flash0") + flash1_path =3D get_flash_path(flash_dir, "flash1") + fd_null =3D open(os.devnull, 'w') + subprocess.check_call(["dd", "if=3D/dev/zero", "of=3D{}".format(flash0= _path), + "bs=3D1M", "count=3D64"], + stdout=3Dfd_null, stderr=3Dsubprocess.STDOUT) + # A reliable way to get the QEMU EFI image is via an installed package= or + # via the bios included with qemu. + if not os.path.exists(efi_img): + sys.stderr.write("*** efi argument is invalid ({})\n".format(efi_i= mg)) + sys.stderr.write("*** please check --efi-aarch64 argument or "\ + "install qemu-efi-aarch64 package\n") + exit(3) + subprocess.check_call(["dd", "if=3D{}".format(efi_img), + "of=3D{}".format(flash0_path), + "conv=3Dnotrunc"], + stdout=3Dfd_null, stderr=3Dsubprocess.STDOUT) + subprocess.check_call(["dd", "if=3D/dev/zero", + "of=3D{}".format(flash1_path), + "bs=3D1M", "count=3D64"], + stdout=3Dfd_null, stderr=3Dsubprocess.STDOUT) + fd_null.close() + +def get_pflash_args(flash_dir=3D"./"): + """Returns a string that can be used to + boot qemu using the appropriate pflash files + for aarch64.""" + flash0_path =3D get_flash_path(flash_dir, "flash0") + flash1_path =3D get_flash_path(flash_dir, "flash1") + pflash_args_str =3D "-drive file=3D{},format=3Draw,if=3Dpflash "\ + "-drive file=3D{},format=3Draw,if=3Dpflash" + pflash_args =3D pflash_args_str.format(flash0_path, flash1_path) + return pflash_args.split(" ") + +def get_flash_path(flash_dir, name): + return os.path.join(flash_dir, "{}.img".format(name)) diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index b610581d1b..471d4402e2 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -90,6 +90,7 @@ class BaseVM(object): self._guest =3D None self._genisoimage =3D args.genisoimage self._build_path =3D args.build_path + self._efi_aarch64 =3D args.efi_aarch64 # Allow input config to override defaults. self._config =3D DEFAULT_CONFIG.copy() if config !=3D None: @@ -497,6 +498,14 @@ def get_qemu_path(arch, build_path=3DNone): qemu_path =3D "qemu-system-" + arch return qemu_path =20 +def get_qemu_version(qemu_path): + """Get the version number from the current QEMU, + and return the major number.""" + output =3D subprocess.check_output([qemu_path, '--version']) + version_line =3D output.decode("utf-8") + version_num =3D re.split(' |\(', version_line)[3].split('.')[0] + return int(version_num) + def parse_config(config, args): """ Parse yaml config and populate our config structure. The yaml config allows the user to override the @@ -573,6 +582,9 @@ def parse_args(vmcls): "See config_example.yaml for example.") parser.add_option("--build-path", default=3DNone, help=3D"Path of build directory. ") + parser.add_option("--efi-aarch64", + default=3D"/usr/share/qemu-efi-aarch64/QEMU_EFI.fd", + help=3D"Path to efi image for aarch64 VMs.") parser.disable_interspersed_args() return parser.parse_args() =20 diff --git a/tests/vm/ubuntu.aarch64 b/tests/vm/ubuntu.aarch64 new file mode 100755 index 0000000000..197eb92b82 --- /dev/null +++ b/tests/vm/ubuntu.aarch64 @@ -0,0 +1,117 @@ +#!/usr/bin/env python3 +# +# Ubuntu aarch64 image +# +# Copyright 2020 Linaro +# +# Authors: +# Robert Foley +# Originally based on ubuntu.i386 Fam Zheng +# +# This code is licensed under the GPL version 2 or later. See +# the COPYING file in the top-level directory. +# + +import os +import sys +import subprocess +import basevm +from qemu.accel import kvm_available +import time +import aarch64vm + +DEFAULT_CONFIG =3D { + 'cpu' : "cortex-a57", + 'machine' : "virt,gic-version=3D3", + 'install_cmds' : "apt-get update,"\ + "apt-get build-dep -y --arch-only qemu,"\ + "apt-get install -y libfdt-dev flex bison pkg-config", + # We increase beyond the default time since during boot + # it can take some time (many seconds) to log into the VM + # especially using softmmu. + 'ssh_timeout' : 60, +} + +class UbuntuAarch64VM(basevm.BaseVM): + name =3D "ubuntu.aarch64" + arch =3D "aarch64" + image_name =3D "ubuntu-18.04-server-cloudimg-arm64.img" + image_link =3D "https://cloud-images.ubuntu.com/releases/18.04/release= /" + image_name + login_prompt =3D "ubuntu-aarch64-guest login:" + BUILD_SCRIPT =3D """ + set -e; + cd $(mktemp -d); + sudo chmod a+r /dev/vdb; + tar --checkpoint=3D.10 -xf /dev/vdb; + ./configure {configure_opts}; + make --output-sync {target} -j{jobs} {verbose}; + """ + def boot(self, img, extra_args=3DNone): + aarch64vm.create_flash_images(self._tmpdir, self._efi_aarch64) + default_args =3D aarch64vm.get_pflash_args(self._tmpdir) + if extra_args: + extra_args.extend(default_args) + else: + extra_args =3D 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 chang= e it. + extra_args.extend(["-smp", "8"]) + + # We have overridden boot() since aarch64 has additional parameter= s. + # Call down to the base class method. + super(UbuntuAarch64VM, self).boot(img, extra_args=3Dextra_args) + + def build_image(self, img): + os_img =3D self._download_with_cache(self.image_link) + img_tmp =3D img + ".tmp" + subprocess.check_call(["cp", "-f", os_img, img_tmp]) + subprocess.check_call(["qemu-img", "resize", img_tmp, "+50G"]) + ci_img =3D self.gen_cloud_init_iso() + + self.boot(img_tmp, extra_args =3D ["-cdrom", ci_img]) + if self.debug: + self.wait_boot() + # First command we issue is fix for slow ssh login. + self.wait_ssh(wait_root=3DTrue, + cmd=3D"chmod -x /etc/update-motd.d/*") + # Wait for cloud init to finish + self.wait_ssh(wait_root=3DTrue, + cmd=3D"ls /var/lib/cloud/instance/boot-finished") + self.ssh_root("touch /etc/cloud/cloud-init.disabled") + # Disable auto upgrades. + # We want to keep the VM system state stable. + self.ssh_root('sed -ie \'s/"1"/"0"/g\' /etc/apt/apt.conf.d/20auto-= upgrades') + # If the user chooses *not* to do the second phase, + # then we will jump right to the graceful shutdown + if self._config['install_cmds'] !=3D "": + self.ssh_root("sync") + # Shutdown and then boot it again. + # Allows us to know for sure it is booting (not shutting down) + # before we call wait_ssh(). + self.graceful_shutdown() + self.boot(img_tmp) + if self.debug: + self.wait_boot() + self.wait_ssh(wait_root=3DTrue) + self.wait_ssh(wait_root=3DTrue, cmd=3D"locale") + # The previous update sometimes doesn't survive a reboot, so d= o it again + self.ssh_root("sed -ie s/^#\ deb-src/deb-src/g /etc/apt/source= s.list") + + # Issue the install commands. + # This can be overriden by the user in the config .yml. + install_cmds =3D self._config['install_cmds'].split(',') + for cmd in install_cmds: + self.ssh_root(cmd) + self.graceful_shutdown() + self.wait() + os.rename(img_tmp, img) + return 0 + +if __name__ =3D=3D "__main__": + defaults =3D aarch64vm.get_config_defaults(UbuntuAarch64VM, DEFAULT_CO= NFIG) + sys.exit(basevm.main(UbuntuAarch64VM, defaults)) --=20 2.17.1