2021-07-09 17:29:27 +03:00
|
|
|
# Copyright (c) 2021 Red Hat, Inc.
|
|
|
|
#
|
|
|
|
# Author:
|
|
|
|
# Cleber Rosa <crosa@redhat.com>
|
|
|
|
#
|
|
|
|
# This work is licensed under the terms of the GNU GPL, version 2 or
|
|
|
|
# later. See the COPYING file in the top-level directory.
|
|
|
|
#
|
|
|
|
# This is an ansible playbook file. Run it to set up systems with the
|
|
|
|
# environment needed to build QEMU.
|
|
|
|
---
|
|
|
|
- name: Installation of basic packages to build QEMU
|
|
|
|
hosts: all
|
|
|
|
tasks:
|
|
|
|
- name: Check for suitable ansible version
|
|
|
|
delegate_to: localhost
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- '((ansible_version.major == 2) and (ansible_version.minor >= 8)) or (ansible_version.major >= 3)'
|
|
|
|
msg: "Unsuitable ansible version, please use version 2.8.0 or later"
|
|
|
|
|
2022-02-25 20:20:10 +03:00
|
|
|
- name: Add armhf foreign architecture to aarch64 hosts
|
|
|
|
command: dpkg --add-architecture armhf
|
|
|
|
when:
|
|
|
|
- ansible_facts['distribution'] == 'Ubuntu'
|
|
|
|
- ansible_facts['architecture'] == 'aarch64'
|
|
|
|
|
2021-07-09 17:29:27 +03:00
|
|
|
- name: Update apt cache / upgrade packages via apt
|
|
|
|
apt:
|
|
|
|
update_cache: yes
|
|
|
|
upgrade: yes
|
|
|
|
when:
|
|
|
|
- ansible_facts['distribution'] == 'Ubuntu'
|
|
|
|
|
2023-05-02 18:54:54 +03:00
|
|
|
# lcitool variables -f json ubuntu-2204 qemu | jq -r '.pkgs[]' | xargs -n 1 echo "-"
|
|
|
|
- name: Install basic packages to build QEMU on Ubuntu 22.04
|
2021-07-09 17:29:27 +03:00
|
|
|
package:
|
|
|
|
name:
|
2023-05-02 18:54:54 +03:00
|
|
|
- bash
|
|
|
|
- bc
|
|
|
|
- bison
|
|
|
|
- bsdextrautils
|
|
|
|
- bzip2
|
|
|
|
- ca-certificates
|
2021-07-09 17:29:27 +03:00
|
|
|
- ccache
|
2023-05-02 18:54:54 +03:00
|
|
|
- clang
|
|
|
|
- dbus
|
|
|
|
- debianutils
|
|
|
|
- diffutils
|
|
|
|
- exuberant-ctags
|
|
|
|
- findutils
|
|
|
|
- flex
|
|
|
|
- g++
|
2021-07-09 17:29:27 +03:00
|
|
|
- gcc
|
2023-05-02 18:54:54 +03:00
|
|
|
- gcovr
|
|
|
|
- genisoimage
|
2021-07-09 17:29:27 +03:00
|
|
|
- gettext
|
|
|
|
- git
|
2023-05-02 18:54:54 +03:00
|
|
|
- hostname
|
2021-07-09 17:29:27 +03:00
|
|
|
- libaio-dev
|
2023-05-02 18:54:54 +03:00
|
|
|
- libasan5
|
|
|
|
- libasound2-dev
|
2021-07-09 17:29:27 +03:00
|
|
|
- libattr1-dev
|
2023-05-02 18:54:54 +03:00
|
|
|
- libbpf-dev
|
2021-07-09 17:29:27 +03:00
|
|
|
- libbrlapi-dev
|
|
|
|
- libbz2-dev
|
2023-05-02 18:54:54 +03:00
|
|
|
- libc6-dev
|
2021-07-09 17:29:27 +03:00
|
|
|
- libcacard-dev
|
|
|
|
- libcap-ng-dev
|
2023-05-02 18:54:54 +03:00
|
|
|
- libcapstone-dev
|
|
|
|
- libcmocka-dev
|
2021-07-09 17:29:27 +03:00
|
|
|
- libcurl4-gnutls-dev
|
2023-05-02 18:54:54 +03:00
|
|
|
- libdaxctl-dev
|
2021-07-09 17:29:27 +03:00
|
|
|
- libdrm-dev
|
|
|
|
- libepoxy-dev
|
|
|
|
- libfdt-dev
|
2023-05-02 18:54:54 +03:00
|
|
|
- libffi-dev
|
2021-07-09 17:29:27 +03:00
|
|
|
- libgbm-dev
|
2023-05-02 18:54:54 +03:00
|
|
|
- libgcrypt20-dev
|
|
|
|
- libglib2.0-dev
|
|
|
|
- libglusterfs-dev
|
|
|
|
- libgnutls28-dev
|
2021-07-09 17:29:27 +03:00
|
|
|
- libgtk-3-dev
|
2023-05-02 18:54:54 +03:00
|
|
|
- libibumad-dev
|
2021-07-09 17:29:27 +03:00
|
|
|
- libibverbs-dev
|
|
|
|
- libiscsi-dev
|
|
|
|
- libjemalloc-dev
|
|
|
|
- libjpeg-turbo8-dev
|
2023-05-02 18:54:54 +03:00
|
|
|
- libjson-c-dev
|
|
|
|
- liblttng-ust-dev
|
2021-07-09 17:29:27 +03:00
|
|
|
- liblzo2-dev
|
|
|
|
- libncursesw5-dev
|
|
|
|
- libnfs-dev
|
|
|
|
- libnuma-dev
|
2023-05-02 18:54:54 +03:00
|
|
|
- libpam0g-dev
|
|
|
|
- libpcre2-dev
|
2021-07-09 17:29:27 +03:00
|
|
|
- libpixman-1-dev
|
2023-05-02 18:54:54 +03:00
|
|
|
- libpmem-dev
|
|
|
|
- libpng-dev
|
|
|
|
- libpulse-dev
|
2021-07-09 17:29:27 +03:00
|
|
|
- librbd-dev
|
|
|
|
- librdmacm-dev
|
|
|
|
- libsasl2-dev
|
|
|
|
- libsdl2-dev
|
2023-05-02 18:54:54 +03:00
|
|
|
- libsdl2-image-dev
|
2021-07-09 17:29:27 +03:00
|
|
|
- libseccomp-dev
|
2023-05-02 18:54:54 +03:00
|
|
|
- libslirp-dev
|
2021-07-09 17:29:27 +03:00
|
|
|
- libsnappy-dev
|
|
|
|
- libspice-protocol-dev
|
2023-05-02 18:54:54 +03:00
|
|
|
- libspice-server-dev
|
2021-07-09 17:29:27 +03:00
|
|
|
- libssh-dev
|
2023-05-02 18:54:54 +03:00
|
|
|
- libsystemd-dev
|
|
|
|
- libtasn1-6-dev
|
|
|
|
- libubsan1
|
|
|
|
- libudev-dev
|
|
|
|
- liburing-dev
|
2021-07-09 17:29:27 +03:00
|
|
|
- libusb-1.0-0-dev
|
|
|
|
- libusbredirhost-dev
|
|
|
|
- libvdeplug-dev
|
2023-05-02 18:54:54 +03:00
|
|
|
- libvirglrenderer-dev
|
2021-07-09 17:29:27 +03:00
|
|
|
- libvte-2.91-dev
|
2023-05-02 18:54:54 +03:00
|
|
|
- libxen-dev
|
|
|
|
- libxml2-dev
|
2021-07-09 17:29:27 +03:00
|
|
|
- libzstd-dev
|
2023-05-02 18:54:54 +03:00
|
|
|
- llvm
|
|
|
|
- locales
|
2021-07-09 17:29:27 +03:00
|
|
|
- make
|
2023-05-02 18:54:54 +03:00
|
|
|
- meson
|
|
|
|
- multipath-tools
|
|
|
|
- ncat
|
|
|
|
- nettle-dev
|
|
|
|
- ninja-build
|
|
|
|
- openssh-client
|
|
|
|
- pkgconf
|
|
|
|
- python3
|
|
|
|
- python3-numpy
|
|
|
|
- python3-opencv
|
|
|
|
- python3-pillow
|
|
|
|
- python3-pip
|
2021-07-09 17:29:27 +03:00
|
|
|
- python3-sphinx
|
|
|
|
- python3-sphinx-rtd-theme
|
2023-05-02 18:54:54 +03:00
|
|
|
- python3-venv
|
|
|
|
- python3-yaml
|
|
|
|
- rpm2cpio
|
|
|
|
- sed
|
2021-07-09 17:29:27 +03:00
|
|
|
- sparse
|
2023-05-02 18:54:54 +03:00
|
|
|
- systemtap-sdt-dev
|
|
|
|
- tar
|
|
|
|
- tesseract-ocr
|
|
|
|
- tesseract-ocr-eng
|
|
|
|
- texinfo
|
2021-07-09 17:29:27 +03:00
|
|
|
- xfslibs-dev
|
2023-05-02 18:54:54 +03:00
|
|
|
- zlib1g-dev
|
2021-07-09 17:29:27 +03:00
|
|
|
state: present
|
|
|
|
when:
|
|
|
|
- ansible_facts['distribution'] == 'Ubuntu'
|
2023-05-02 18:54:54 +03:00
|
|
|
- ansible_facts['distribution_version'] == '22.04'
|
2021-07-09 17:29:27 +03:00
|
|
|
|
2023-05-02 18:54:54 +03:00
|
|
|
- name: Install armhf cross-compile packages to build QEMU on AArch64 Ubuntu 22.04
|
2022-02-25 20:20:10 +03:00
|
|
|
package:
|
|
|
|
name:
|
|
|
|
- binutils-arm-linux-gnueabihf
|
|
|
|
- gcc-arm-linux-gnueabihf
|
|
|
|
- libblkid-dev:armhf
|
|
|
|
- libc6-dev:armhf
|
|
|
|
- libffi-dev:armhf
|
|
|
|
- libglib2.0-dev:armhf
|
|
|
|
- libmount-dev:armhf
|
|
|
|
- libpcre2-dev:armhf
|
|
|
|
- libpixman-1-dev:armhf
|
|
|
|
- zlib1g-dev:armhf
|
|
|
|
when:
|
|
|
|
- ansible_facts['distribution'] == 'Ubuntu'
|
2023-05-02 18:54:54 +03:00
|
|
|
- ansible_facts['distribution_version'] == '22.04'
|
2022-02-25 20:20:10 +03:00
|
|
|
- ansible_facts['architecture'] == 'aarch64'
|
|
|
|
|
2023-01-19 17:02:30 +03:00
|
|
|
- name: Enable EPEL repo on EL8
|
|
|
|
dnf:
|
|
|
|
name:
|
|
|
|
- epel-release
|
|
|
|
state: present
|
|
|
|
when:
|
|
|
|
- ansible_facts['distribution_file_variety'] in ['RedHat', 'CentOS']
|
|
|
|
- ansible_facts['distribution_major_version'] == '8'
|
|
|
|
|
2023-01-19 16:23:09 +03:00
|
|
|
- name: Enable PowerTools repo on CentOS 8
|
|
|
|
ini_file:
|
|
|
|
path: /etc/yum.repos.d/CentOS-Stream-PowerTools.repo
|
|
|
|
section: powertools
|
|
|
|
option: enabled
|
|
|
|
value: "1"
|
|
|
|
when:
|
|
|
|
- ansible_facts['distribution_file_variety'] == 'CentOS'
|
|
|
|
- ansible_facts['distribution_major_version'] == '8'
|
|
|
|
|
2021-11-15 17:29:14 +03:00
|
|
|
- name: Install basic packages to build QEMU on EL8
|
|
|
|
dnf:
|
|
|
|
# This list of packages start with tests/docker/dockerfiles/centos8.docker
|
|
|
|
# but only include files that are common to all distro variants and present
|
|
|
|
# in the standard repos (no add-ons)
|
|
|
|
name:
|
|
|
|
- bzip2
|
|
|
|
- bzip2-devel
|
2023-01-19 17:02:30 +03:00
|
|
|
- capstone-devel
|
2021-11-15 17:29:14 +03:00
|
|
|
- dbus-daemon
|
2023-01-19 16:31:24 +03:00
|
|
|
- device-mapper-multipath-devel
|
2021-11-15 17:29:14 +03:00
|
|
|
- diffutils
|
|
|
|
- gcc
|
|
|
|
- gcc-c++
|
|
|
|
- genisoimage
|
|
|
|
- gettext
|
|
|
|
- git
|
|
|
|
- glib2-devel
|
2023-01-19 16:31:24 +03:00
|
|
|
- glusterfs-api-devel
|
|
|
|
- gnutls-devel
|
2021-11-15 17:29:14 +03:00
|
|
|
- libaio-devel
|
2023-01-19 16:31:24 +03:00
|
|
|
- libcap-ng-devel
|
|
|
|
- libcurl-devel
|
2021-11-15 17:29:14 +03:00
|
|
|
- libepoxy-devel
|
2023-01-19 16:31:24 +03:00
|
|
|
- libfdt-devel
|
2021-11-15 17:29:14 +03:00
|
|
|
- libgcrypt-devel
|
2023-01-19 16:31:24 +03:00
|
|
|
- libiscsi-devel
|
|
|
|
- libpmem-devel
|
|
|
|
- librados-devel
|
|
|
|
- librbd-devel
|
|
|
|
- libseccomp-devel
|
|
|
|
- libssh-devel
|
|
|
|
- libxkbcommon-devel
|
2021-11-15 17:29:14 +03:00
|
|
|
- lzo-devel
|
|
|
|
- make
|
|
|
|
- mesa-libEGL-devel
|
|
|
|
- nettle-devel
|
2022-09-29 14:41:41 +03:00
|
|
|
- ninja-build
|
2021-11-15 17:29:14 +03:00
|
|
|
- nmap-ncat
|
2023-01-19 16:31:24 +03:00
|
|
|
- numactl-devel
|
2021-11-15 17:29:14 +03:00
|
|
|
- pixman-devel
|
2023-01-19 16:35:26 +03:00
|
|
|
- python38
|
2023-01-19 16:31:24 +03:00
|
|
|
- python3-sphinx
|
2021-11-15 17:29:14 +03:00
|
|
|
- rdma-core-devel
|
2023-01-19 16:31:24 +03:00
|
|
|
- redhat-rpm-config
|
|
|
|
- snappy-devel
|
2021-11-15 17:29:14 +03:00
|
|
|
- spice-glib-devel
|
2023-01-19 16:31:24 +03:00
|
|
|
- systemd-devel
|
2021-11-15 17:29:14 +03:00
|
|
|
- systemtap-sdt-devel
|
|
|
|
- tar
|
|
|
|
- zlib-devel
|
|
|
|
state: present
|
|
|
|
when:
|
2023-01-19 16:23:09 +03:00
|
|
|
- ansible_facts['distribution_file_variety'] in ['RedHat', 'CentOS']
|
2021-11-15 17:29:14 +03:00
|
|
|
- ansible_facts['distribution_version'] == '8'
|
2022-09-29 14:41:43 +03:00
|
|
|
|
|
|
|
- name: Install packages only available on x86 and aarch64
|
|
|
|
dnf:
|
|
|
|
# Spice server not available in ppc64le
|
|
|
|
name:
|
|
|
|
- spice-server
|
2023-01-19 16:31:24 +03:00
|
|
|
- spice-server-devel
|
2022-09-29 14:41:43 +03:00
|
|
|
state: present
|
|
|
|
when:
|
2023-01-19 16:23:09 +03:00
|
|
|
- ansible_facts['distribution_file_variety'] in ['RedHat', 'CentOS']
|
2022-09-29 14:41:43 +03:00
|
|
|
- ansible_facts['distribution_version'] == '8'
|
|
|
|
- ansible_facts['architecture'] == 'aarch64' or ansible_facts['architecture'] == 'x86_64'
|
2023-01-19 16:35:26 +03:00
|
|
|
|
|
|
|
- name: Check whether the Python runtime version is managed by alternatives
|
|
|
|
stat:
|
|
|
|
path: /etc/alternatives/python3
|
|
|
|
register: python3
|
|
|
|
|
|
|
|
- name: Set default Python runtime to 3.8 on EL8
|
|
|
|
command: alternatives --set python3 /usr/bin/python3.8
|
|
|
|
when:
|
|
|
|
- ansible_facts['distribution_file_variety'] in ['RedHat', 'CentOS']
|
|
|
|
- ansible_facts['distribution_version'] == '8'
|
|
|
|
- python3.stat.islnk and python3.stat.lnk_target != '/usr/bin/python3.8'
|