forked from Azure/iot-identity-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-runtime-deps.sh
executable file
·77 lines (58 loc) · 2.35 KB
/
install-runtime-deps.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
#!/bin/bash
# This script is meant to be sourced.
OS="$(. /etc/os-release; echo "${PLATFORM_ID:-$ID:$VERSION_ID}")"
case "$OS" in
'centos:7'|'platform:el8'|'platform:el9')
# openssl 1.0
# If using RHEL 8/9 UBI images without a subscription then they only have access to a
# subset of packages. Workaround to enable EPEL.
if [ "$OS" = 'platform:el8' ] && [ "$(. /etc/os-release; echo "$ID")" = 'rhel' ]; then
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
yum install -y curl jq openssl ca-certificates
elif [ "$OS" = 'platform:el9' ] && [ "$(. /etc/os-release; echo "$ID")" = 'rhel' ]; then
yum config-manager --add-repo http://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/
rpm --import http://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux-9
# curl is already installed on el9
yum install -y jq openssl ca-certificates
else
yum install -y epel-release
yum install -y curl jq openssl ca-certificates
fi
case "${PKCS11_BACKEND:-}" in
'softhsm')
yum install -y softhsm
export PKCS11_LIB_PATH='/usr/lib64/libsofthsm2.so'
mkdir -p /var/lib/softhsm/tokens
;;
'')
;;
*)
echo "Unsupported PKCS#11 backend $PKCS11_BACKEND" >&2
exit 1
;;
esac
;;
'debian:10'|'debian:11'|'ubuntu:18.04'|'ubuntu:20.04'|'ubuntu:22.04')
# openssl 1.1.0 for Debian 9, 1.1.1 for Debian 10/11 and Ubuntu 18.04/20.04
# openssl 3.0 for Ubuntu 22.04
apt-get update -y
DEBIAN_FRONTEND=noninteractive TZ=UTC apt-get install -y curl jq openssl ca-certificates
case "${PKCS11_BACKEND:-}" in
'softhsm')
DEBIAN_FRONTEND=noninteractive TZ=UTC apt-get install -y softhsm
export PKCS11_LIB_PATH='/usr/lib/softhsm/libsofthsm2.so'
mkdir -p /var/lib/softhsm/tokens
;;
'')
;;
*)
echo "Unsupported PKCS#11 backend $PKCS11_BACKEND" >&2
exit 1
;;
esac
;;
*)
echo "Unsupported OS $OS" >&2
exit 1
;;
esac