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 18.04/20.04 37 package: 38 name: 39 # Originally from tests/docker/dockerfiles/ubuntu1804.docker 40 - ccache 41 - gcc 42 - gettext 43 - git 44 - glusterfs-common 45 - libaio-dev 46 - libattr1-dev 47 - libbrlapi-dev 48 - libbz2-dev 49 - libcacard-dev 50 - libcap-ng-dev 51 - libcurl4-gnutls-dev 52 - libdrm-dev 53 - libepoxy-dev 54 - libfdt-dev 55 - libgbm-dev 56 - libgtk-3-dev 57 - libibverbs-dev 58 - libiscsi-dev 59 - libjemalloc-dev 60 - libjpeg-turbo8-dev 61 - liblzo2-dev 62 - libncurses5-dev 63 - libncursesw5-dev 64 - libnfs-dev 65 - libnss3-dev 66 - libnuma-dev 67 - libpixman-1-dev 68 - librados-dev 69 - librbd-dev 70 - librdmacm-dev 71 - libsasl2-dev 72 - libsdl2-dev 73 - libseccomp-dev 74 - libsnappy-dev 75 - libspice-protocol-dev 76 - libssh-dev 77 - libusb-1.0-0-dev 78 - libusbredirhost-dev 79 - libvdeplug-dev 80 - libvte-2.91-dev 81 - libzstd-dev 82 - make 83 - python3-yaml 84 - python3-sphinx 85 - python3-sphinx-rtd-theme 86 - ninja-build 87 - sparse 88 - xfslibs-dev 89 state: present 90 when: 91 - ansible_facts['distribution'] == 'Ubuntu' 92 93 - name: Install packages to build QEMU on Ubuntu 18.04/20.04 on non-s390x 94 package: 95 name: 96 - libspice-server-dev 97 - libxen-dev 98 state: present 99 when: 100 - ansible_facts['distribution'] == 'Ubuntu' 101 - ansible_facts['architecture'] != 's390x' 102 103 - name: Install basic packages to build QEMU on Ubuntu 18.04 104 package: 105 name: 106 # Originally from tests/docker/dockerfiles/ubuntu1804.docker 107 - clang 108 when: 109 - ansible_facts['distribution'] == 'Ubuntu' 110 - ansible_facts['distribution_version'] == '18.04' 111 112 - name: Install basic packages to build QEMU on Ubuntu 20.04 113 package: 114 name: 115 # Originally from tests/docker/dockerfiles/ubuntu2004.docker 116 - clang-10 117 - genisoimage 118 - liblttng-ust-dev 119 - libslirp-dev 120 - netcat-openbsd 121 when: 122 - ansible_facts['distribution'] == 'Ubuntu' 123 - ansible_facts['distribution_version'] == '20.04' 124 125 - name: Install armhf cross-compile packages to build QEMU on AArch64 Ubuntu 20.04 126 package: 127 name: 128 - binutils-arm-linux-gnueabihf 129 - gcc-arm-linux-gnueabihf 130 - libblkid-dev:armhf 131 - libc6-dev:armhf 132 - libffi-dev:armhf 133 - libglib2.0-dev:armhf 134 - libmount-dev:armhf 135 - libpcre2-dev:armhf 136 - libpixman-1-dev:armhf 137 - zlib1g-dev:armhf 138 when: 139 - ansible_facts['distribution'] == 'Ubuntu' 140 - ansible_facts['distribution_version'] == '20.04' 141 - ansible_facts['architecture'] == 'aarch64' 142 143 - name: Install basic packages to build QEMU on EL8 144 dnf: 145 # This list of packages start with tests/docker/dockerfiles/centos8.docker 146 # but only include files that are common to all distro variants and present 147 # in the standard repos (no add-ons) 148 name: 149 - bzip2 150 - bzip2-devel 151 - dbus-daemon 152 - diffutils 153 - gcc 154 - gcc-c++ 155 - genisoimage 156 - gettext 157 - git 158 - glib2-devel 159 - libaio-devel 160 - libepoxy-devel 161 - libgcrypt-devel 162 - lzo-devel 163 - make 164 - mesa-libEGL-devel 165 - nettle-devel 166 - nmap-ncat 167 - perl-Test-Harness 168 - pixman-devel 169 - python36 170 - rdma-core-devel 171 - spice-glib-devel 172 - spice-server 173 - systemtap-sdt-devel 174 - tar 175 - zlib-devel 176 state: present 177 when: 178 - ansible_facts['distribution_file_variety'] == 'RedHat' 179 - ansible_facts['distribution_version'] == '8' 180