Skip to content

Commit 86fe6fc

Browse files
author
Eugene Kovalenko
authored
Fix elastio installation on Oracle Linux (#74)
Fixed typo and kernel-uek-devel installation. And added check for epel-release package. It should not be installed if it's already installed. Closes https://github.com/elastio/elastio/issues/7300
1 parent 1e59329 commit 86fe6fc

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

scripts/install-elastio.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ MAX_LINUX_MAJOR_REV=0
88

99
cent_fedora_kernel_devel_install()
1010
{
11-
if ! yum install -y kernel-devel-$(uname -r) kernel-devel ; then
11+
kernel_devel="kernel-devel"
12+
# This is for Oracle Linux support. Oracle Linux may use UEK kernel or regular CentOS's kernel.
13+
# We'll install appropriate kernel devel package depending on the currently loaded kernel.
14+
uname -r | grep -q uek && kernel_devel="kernel-uek-devel"
15+
if ! yum install -y $kernel_devel-$(uname -r) $kernel_devel ; then
1216
echo
13-
echo "Failed to install package kernel-devel-$(uname -r) for the current running kernel."
17+
echo "Failed to install package $kernel_devel-$(uname -r) for the current running kernel."
1418
echo "This package is dependency of the Elastio-Snap kernel driver."
1519
echo "Please update current kernel to the most recent version, reboot machine into it and try again."
1620
[[ "$1" == "CentOS" ]] && echo "Or enable Vault repo and try again."
@@ -47,7 +51,7 @@ cent8_fedora_install()
4751

4852
cent_fedora_install()
4953
{
50-
if [ "$1" = "CentOS" ] && grep "Red Hat" -q /etc/redhat-release 2>/dev/null ; then
54+
if [ "$1" = "CentOS" ] && grep "Red Hat" -q /etc/redhat-release 2>/dev/null && ! rpm -qa | grep -q epel-release ; then
5155
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-$2.noarch.rpm
5256
elif [ "$1" = "Amazon" ]; then
5357
amazon-linux-extras install -y epel
@@ -265,7 +269,7 @@ case ${dist_name} in
265269
;;
266270

267271
scientific | sl | oracle | ol )
268-
echo "Warning: Oracle Linix and Scientific Linux are not officially supported!"
272+
echo "Warning: Oracle Linux and Scientific Linux are not officially supported!"
269273
if [ -z $force ]; then
270274
echo "We can try to install packages for CentOS on your system."
271275
echo "Add '--force' to insist on the installation. But beware this isn't officially supported!"

0 commit comments

Comments
 (0)