This repository has been archived by the owner on Jun 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 196
/
setup_env_opensuse.sh
executable file
·92 lines (75 loc) · 2.75 KB
/
setup_env_opensuse.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/bash
#
# Copyright (c) 2019 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
set -e
cidir=$(dirname "$0")
source "/etc/os-release" || source "/usr/lib/os-release"
source "${cidir}/lib.sh"
# This is related with https://bugzilla.suse.com/show_bug.cgi?id=1165519
echo "Remove openSUSE cloud repo"
sudo zypper rr openSUSE-Leap-Cloud-Tools
echo "Install chronic"
sudo -E zypper -n install moreutils
declare -A minimal_packages=( \
[spell-check]="hunspell myspell-en_GB myspell-en_US" \
[xml_validator]="libxml2-tools" \
[yaml_validator_dependencies]="python-setuptools" \
)
declare -A packages=( \
[general_dependencies]="curl git libcontainers-common libdevmapper1_03 util-linux expect" \
[kata_containers_dependencies]="libtool automake autoconf bc perl-Alien-SDL libpixman-1-0-devel coreutils python2-pkgconfig" \
[qemu_dependencies]="libcap-devel libattr1 libcap-ng-devel librbd-devel ninja" \
[kernel_dependencies]="libelf-devel flex glibc-devel-static thin-provisioning-tools" \
[crio_dependencies]="libglib-2_0-0 libseccomp-devel libapparmor-devel libgpg-error-devel go-md2man libgpgme-devel libassuan-devel glib2-devel glibc-devel" \
[gperf_dependencies]="gcc-c++" \
[bison_binary]="bison" \
[build_tools]="gcc python pkg-config zlib-devel" \
[os_tree]="libostree-devel" \
[libudev-dev]="libudev-devel" \
[metrics_dependencies]="smemstat jq" \
[cri-containerd_dependencies]="libseccomp-devel libapparmor-devel make pkg-config libbtrfs-devel patterns-base-apparmor" \
[crudini]="crudini" \
[haveged]="haveged" \
[libsystemd]="systemd-devel" \
[redis]="redis" \
[agent_shutdown_test]="tmux" \
[virtiofsd_dependencies]="unzip" \
)
if [ "${arch}" == "x86_64" ] || [ "${arch}" == "ppc64le" ]; then
packages[qemu_dependencies]+=" libpmem-devel"
fi
if [ "$(uname -m)" == "ppc64le" ] || [ "$(uname -m)" == "s390x" ]; then
packages[kata_containers_dependencies]+=" protobuf-devel"
fi
if [ "$(uname -m)" == "s390x" ]; then
packages[kernel_dependencies]+=" libopenssl-devel"
fi
main()
{
local setup_type="$1"
[ -z "$setup_type" ] && die "need setup type"
local pkgs_to_install
local pkgs
for pkgs in "${minimal_packages[@]}"; do
info "The following package will be installed: $pkgs"
pkgs_to_install+=" $pkgs"
done
if [ "$setup_type" = "default" ]; then
for pkgs in "${packages[@]}"; do
info "The following package will be installed: $pkgs"
pkgs_to_install+=" $pkgs"
done
fi
chronic sudo -E zypper -n install $pkgs_to_install
# Pandoc currently unavailable in openSUSE s390x repos
# Allow install failure, is not required for mainstream CI workflow
echo "Try to install pandoc"
sudo -E zypper -n install pandoc || true
echo "Install YAML validator"
chronic sudo -E easy_install pip
chronic sudo -E pip install yamllint
}
main "$@"