qemu-e2k/tests/vm/ubuntu.i386
Robert Foley e56833b48b tests/vm: Add common Ubuntu python module
Add a common Ubuntu python module and make use of
it with the ubuntu.i386 script.
This is preparation for adding an Ubuntu script
ubuntu.aarch64.  Splitting out the common
logic such as build_image() will reduce duplication.

Signed-off-by: Robert Foley <robert.foley@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20200601211421.1277-5-robert.foley@linaro.org>
Message-Id: <20200701135652.1366-9-alex.bennee@linaro.org>
2020-07-11 15:52:59 +01:00

41 lines
1.0 KiB
Python
Executable File

#!/usr/bin/env python3
#
# Ubuntu i386 image
#
# Copyright 2017 Red Hat Inc.
#
# Authors:
# 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 ubuntuvm
DEFAULT_CONFIG = {
'install_cmds' : "apt-get update,"\
"apt-get build-dep -y qemu,"\
"apt-get install -y libfdt-dev language-pack-en",
}
class UbuntuX86VM(ubuntuvm.UbuntuVM):
name = "ubuntu.i386"
arch = "i386"
image_link="https://cloud-images.ubuntu.com/releases/bionic/"\
"release-20191114/ubuntu-18.04-server-cloudimg-i386.img"
image_sha256="28969840626d1ea80bb249c08eef1a4533e8904aa51a327b40f37ac4b4ff04ef"
BUILD_SCRIPT = """
set -e;
cd $(mktemp -d);
sudo chmod a+r /dev/vdb;
tar -xf /dev/vdb;
./configure {configure_opts};
make --output-sync {target} -j{jobs} {verbose};
"""
if __name__ == "__main__":
sys.exit(basevm.main(UbuntuX86VM, DEFAULT_CONFIG))