1# Copyright (c) 2021 Red Hat, Inc. 2# 3# Author: 4# Cleber Rosa <crosa@redhat.com> 5# 6# This work is licensed under the terms of the GNU GPL, version 2 or 7# later. See the COPYING file in the top-level directory. 8# 9# This is an ansible playbook file. Run it to set up systems with the 10# environment needed to build QEMU. 11--- 12- name: Installation of basic packages to build QEMU 13 hosts: all 14 tasks: 15 - name: Check for suitable ansible version 16 delegate_to: localhost 17 assert: 18 that: 19 - '((ansible_version.major == 2) and (ansible_version.minor >= 8)) or (ansible_version.major >= 3)' 20 msg: "Unsuitable ansible version, please use version 2.8.0 or later" 21 22 - name: Add armhf foreign architecture to aarch64 hosts 23 command: dpkg --add-architecture armhf 24 when: 25 - ansible_facts['distribution'] == 'Ubuntu' 26 - ansible_facts['architecture'] == 'aarch64' 27 - ansible_facts['distribution_version'] == '20.04' 28 29 - name: Update apt cache / upgrade packages via apt 30 apt: 31 update_cache: yes 32 upgrade: yes 33 when: 34 - ansible_facts['distribution'] == 'Ubuntu' 35 36 - name: Install basic packages to build QEMU on Ubuntu 20.04 37 package: 38 name: 39 - ccache 40 - gcc 41 - gettext 42 - git 43 - glusterfs-common 44 - libaio-dev 45 - libattr1-dev 46 - libbrlapi-dev 47 - libbz2-dev 48 - libcacard-dev 49 - libcap-ng-dev 50 - libcurl4-gnutls-dev 51 - libdrm-dev 52 - libepoxy-dev 53 - libfdt-dev 54 - libgbm-dev 55 - libgtk-3-dev 56 - libibverbs-dev 57 - libiscsi-dev 58 - libjemalloc-dev 59 - libjpeg-turbo8-dev 60 - liblzo2-dev 61 - libncurses5-dev 62 - libncursesw5-dev 63 - libnfs-dev 64 - libnss3-dev 65 - libnuma-dev 66 - libpixman-1-dev 67 - librados-dev 68 - librbd-dev 69 - librdmacm-dev 70 - libsasl2-dev 71 - libsdl2-dev 72 - libseccomp-dev 73 - libsnappy-dev 74 - libspice-protocol-dev 75 - libssh-dev 76 - libusb-1.0-0-dev 77 - libusbredirhost-dev 78 - libvdeplug-dev 79 - libvte-2.91-dev 80 - libzstd-dev 81 - make 82 - python3-yaml 83 - python3-sphinx 84 - python3-sphinx-rtd-theme 85 - ninja-build 86 - sparse 87 - xfslibs-dev 88 state: present 89 when: 90 - ansible_facts['distribution'] == 'Ubuntu' 91 92 - name: Install packages to build QEMU on Ubuntu 20.04 on non-s390x 93 package: 94 name: 95 - libspice-server-dev 96 - libxen-dev 97 state: present 98 when: 99 - ansible_facts['distribution'] == 'Ubuntu' 100 - ansible_facts['architecture'] == 'aarch64' or ansible_facts['architecture'] == 'x86_64' 101 102 - name: Install basic packages to build QEMU on Ubuntu 20.04 103 package: 104 name: 105 # Originally from tests/docker/dockerfiles/ubuntu2004.docker 106 - clang-10 107 - genisoimage 108 - liblttng-ust-dev 109 - libslirp-dev 110 - netcat-openbsd 111 when: 112 - ansible_facts['distribution'] == 'Ubuntu' 113 - ansible_facts['distribution_version'] == '20.04' 114 115 - name: Install armhf cross-compile packages to build QEMU on AArch64 Ubuntu 20.04 116 package: 117 name: 118 - binutils-arm-linux-gnueabihf 119 - gcc-arm-linux-gnueabihf 120 - libblkid-dev:armhf 121 - libc6-dev:armhf 122 - libffi-dev:armhf 123 - libglib2.0-dev:armhf 124 - libmount-dev:armhf 125 - libpcre2-dev:armhf 126 - libpixman-1-dev:armhf 127 - zlib1g-dev:armhf 128 when: 129 - ansible_facts['distribution'] == 'Ubuntu' 130 - ansible_facts['distribution_version'] == '20.04' 131 - ansible_facts['architecture'] == 'aarch64' 132 133 - name: Install basic packages to build QEMU on EL8 134 dnf: 135 # This list of packages start with tests/docker/dockerfiles/centos8.docker 136 # but only include files that are common to all distro variants and present 137 # in the standard repos (no add-ons) 138 name: 139 - bzip2 140 - bzip2-devel 141 - dbus-daemon 142 - diffutils 143 - gcc 144 - gcc-c++ 145 - genisoimage 146 - gettext 147 - git 148 - glib2-devel 149 - libaio-devel 150 - libepoxy-devel 151 - libgcrypt-devel 152 - lzo-devel 153 - make 154 - mesa-libEGL-devel 155 - nettle-devel 156 - ninja-build 157 - nmap-ncat 158 - perl-Test-Harness 159 - pixman-devel 160 - python36 161 - rdma-core-devel 162 - spice-glib-devel 163 - systemtap-sdt-devel 164 - tar 165 - zlib-devel 166 state: present 167 when: 168 - ansible_facts['distribution_file_variety'] == 'RedHat' 169 - ansible_facts['distribution_version'] == '8' 170 171 - name: Install packages only available on x86 and aarch64 172 dnf: 173 # Spice server not available in ppc64le 174 name: 175 - spice-server 176 state: present 177 when: 178 - ansible_facts['distribution_file_variety'] == 'RedHat' 179 - ansible_facts['distribution_version'] == '8' 180 - ansible_facts['architecture'] == 'aarch64' or ansible_facts['architecture'] == 'x86_64' 181