github.com/containers/libpod@v1.9.4-0.20220419124438-4284fd425507/contrib/cirrus/packer/fedora_setup.sh (about) 1 #!/bin/bash 2 3 # This script is called by packer on the subject fedora VM, to setup the podman 4 # build/test environment. It's not intended to be used outside of this context. 5 6 set -e 7 8 # Load in library (copied by packer, before this script was run) 9 source /tmp/libpod/$SCRIPT_BASE/lib.sh 10 11 req_env_var SCRIPT_BASE PACKER_BUILDER_NAME GOSRC FEDORA_BASE_IMAGE OS_RELEASE_ID OS_RELEASE_VER 12 13 install_ooe 14 15 export GOPATH="$(mktemp -d)" 16 trap "sudo rm -rf $GOPATH" EXIT 17 18 $BIGTO ooe.sh sudo dnf update -y 19 20 # Do not enable update-stesting on the previous Fedora release 21 if [[ "$FEDORA_BASE_IMAGE" =~ "${OS_RELEASE_ID}-cloud-base-${OS_RELEASE_VER}" ]]; then 22 warn "Enabling updates-testing repository for image based on $FEDORA_BASE_IMAGE" 23 $LILTO ooe.sh sudo dnf install -y 'dnf-command(config-manager)' 24 $LILTO ooe.sh sudo dnf config-manager --set-enabled updates-testing 25 else 26 warn "NOT enabling updates-testing repository for image based on $PRIOR_FEDORA_BASE_IMAGE" 27 fi 28 29 REMOVE_PACKAGES=() 30 INSTALL_PACKAGES=(\ 31 autoconf 32 automake 33 bash-completion 34 bats 35 bridge-utils 36 btrfs-progs-devel 37 bzip2 38 conmon 39 container-selinux 40 containernetworking-plugins 41 containers-common 42 criu 43 device-mapper-devel 44 dnsmasq 45 emacs-nox 46 file 47 findutils 48 fuse3 49 fuse3-devel 50 gcc 51 git 52 glib2-devel 53 glibc-static 54 gnupg 55 go-md2man 56 golang 57 gpgme-devel 58 iproute 59 iptables 60 jq 61 libassuan-devel 62 libcap-devel 63 libmsi1 64 libnet 65 libnet-devel 66 libnl3-devel 67 libseccomp 68 libseccomp-devel 69 libselinux-devel 70 libtool 71 libvarlink-util 72 lsof 73 make 74 msitools 75 nmap-ncat 76 ostree-devel 77 pandoc 78 podman 79 procps-ng 80 protobuf 81 protobuf-c 82 protobuf-c-devel 83 protobuf-devel 84 protobuf-python 85 python 86 python3-dateutil 87 python3-psutil 88 python3-pytoml 89 rsync 90 runc 91 selinux-policy-devel 92 skopeo 93 skopeo-containers 94 slirp4netns 95 unzip 96 vim 97 wget 98 which 99 xz 100 zip 101 ) 102 case "$OS_RELEASE_VER" in 103 30) 104 INSTALL_PACKAGES+=(\ 105 atomic-registries 106 golang-github-cpuguy83-go-md2man 107 python2-future 108 runc 109 ) 110 REMOVE_PACKAGES+=(crun) 111 ;; 112 31) 113 INSTALL_PACKAGES+=(crun) 114 REMOVE_PACKAGES+=(runc) 115 ;; 116 *) 117 bad_os_id_ver ;; 118 esac 119 120 echo "Installing general build/test dependencies for Fedora '$OS_RELEASE_VER'" 121 $BIGTO ooe.sh sudo dnf install -y ${INSTALL_PACKAGES[@]} 122 123 install_buildah_packages 124 125 [[ "${#REMOVE_PACKAGES[@]}" -eq "0" ]] || \ 126 $LILTO ooe.sh sudo dnf erase -y ${REMOVE_PACKAGES[@]} 127 128 echo "Enabling cgroup management from containers" 129 ooe.sh sudo setsebool container_manage_cgroup true 130 131 ooe.sh sudo /tmp/libpod/hack/install_catatonit.sh 132 133 # Ensure there are no disruptive periodic services enabled by default in image 134 systemd_banish 135 136 rh_finalize 137 138 echo "SUCCESS!"