Skip to content

Commit b4d43d6

Browse files
author
Eugene Kovalenko
authored
More fixes for installation on OL7 from Oracle Cloud (#75)
1. rpm import of EPEL and Elastio GPG keys in advance before packages installation. 2. Fix `modules/build` symlink to the source directory after installation of an ancient `kernel-uek-devel-4.14.35-2047.510.5.5.el7uek.x86_64`. 3. Temporary remove versionlock from `zlib` during `dkms` installation. Closes https://github.com/elastio/elastio/issues/7300 Continuation for #74
1 parent 86fe6fc commit b4d43d6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

scripts/install-elastio.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,24 @@ cent_fedora_kernel_devel_install()
2020
[[ "$1" == "CentOS" ]] && echo "Or enable Vault repo and try again."
2121
exit 1
2222
fi
23+
24+
# Kernel devel package on the old UEK kernels may not create 'build' dir in 'modules'.
25+
if [ ! -d /usr/lib/modules/$(uname -r)/build/ ]; then
26+
ln -sn /usr/src/kernels/$(uname -r) /usr/lib/modules/$(uname -r)/build
27+
fi
2328
}
2429

2530
cent7_amazon_install()
2631
{
2732
if [ ! -z "$driver" ]; then
2833
cent_fedora_kernel_devel_install $1
34+
# Hack around zlib package updae on OL7 with versionlock in Oracle Cloud.
35+
# dkms-elastio-snap depends on dkms. And dkms depends on zlib-1.2.7-21 which may be necessary to update.
36+
zlib_locked=0
37+
rpm -qa | grep -q versionlock && yum versionlock list | grep -q zlib && zlib_locked=1
38+
[ $zlib_locked -ne 0 ] && yum versionlock delete zlib || true
2939
yum install -y dkms-elastio-snap elastio-snap-utils
40+
[ $zlib_locked -ne 0 ] && yum versionlock zlib || true
3041
fi
3142
if [ ! -z "$cli" ]; then
3243
yum install -y elastio
@@ -52,6 +63,7 @@ cent8_fedora_install()
5263
cent_fedora_install()
5364
{
5465
if [ "$1" = "CentOS" ] && grep "Red Hat" -q /etc/redhat-release 2>/dev/null && ! rpm -qa | grep -q epel-release ; then
66+
rpm --import http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-$2
5567
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-$2.noarch.rpm
5668
elif [ "$1" = "Amazon" ]; then
5769
amazon-linux-extras install -y epel
@@ -65,6 +77,8 @@ cent_fedora_install()
6577
if (($(curl -s -I -L -m 2 "$url" | grep -E "^HTTP" | awk '{ print $2 }' | tail -1) != 200)) ; then
6678
url=$repo_url/rpm/$1/$2/x86_64/Packages/elastio-repo-0.0.2-1.$3$2.noarch.rpm
6779
fi
80+
81+
rpm --import https://repo.assur.io/GPG-KEY-elastio
6882
yum localinstall -y $url
6983
which dnf >/dev/null 2>&1 &&
7084
cent8_fedora_install $1 $2 $3 ||

0 commit comments

Comments
 (0)