Add support for Oracle Linux 7 and later.
Most of the changes revolves around using MySQL rather than MariaDB,
plus enabling the addon repos on public-yum.oracle.com.
The patch just touch the areas where there is a divergence between the
Fedora and Oracle distributions and in all other cases the is_fedora
will result in the correct decision to be made and left as is.
Collapsed the is_suse and is_oraclelinux into a single check in
configure_database_mysql and cleanup_database_mysql
Added Oracle Linux to MAINTAINERS.rst
Rather than duplicating most of the Redhat version check code, added
a check in the block to do the determination if it is Oracle Linux
Change-Id: I5f1f15106329eec67aa008b17847fa44863f243f
diff --git a/functions-common b/functions-common
index 3dae814..d00d4a7 100644
--- a/functions-common
+++ b/functions-common
@@ -246,6 +246,7 @@
# CentOS Linux release 6.0 (Final)
# Fedora release 16 (Verne)
# XenServer release 6.2.0-70446c (xenenterprise)
+ # Oracle Linux release 7
os_CODENAME=""
for r in "Red Hat" CentOS Fedora XenServer; do
os_VENDOR=$r
@@ -259,6 +260,9 @@
fi
os_VENDOR=""
done
+ if [ "$os_VENDOR" = "Red Hat" ] && [[ -r /etc/oracle-release ]]; then
+ os_VENDOR=OracleLinux
+ fi
os_PACKAGE="rpm"
elif [[ -r /etc/SuSE-release ]]; then
for r in openSUSE "SUSE Linux"; do
@@ -310,7 +314,7 @@
fi
elif [[ "$os_VENDOR" =~ (Red Hat) || \
"$os_VENDOR" =~ (CentOS) || \
- "$os_VENDOR" =~ (OracleServer) ]]; then
+ "$os_VENDOR" =~ (OracleLinux) ]]; then
# Drop the . release as we assume it's compatible
DISTRO="rhel${os_RELEASE::1}"
elif [[ "$os_VENDOR" =~ (XenServer) ]]; then
@@ -328,6 +332,17 @@
[[ "$(uname -m)" == "$1" ]]
}
+# Determine if current distribution is an Oracle distribution
+# is_oraclelinux
+function is_oraclelinux {
+ if [[ -z "$os_VENDOR" ]]; then
+ GetOSVersion
+ fi
+
+ [ "$os_VENDOR" = "OracleLinux" ]
+}
+
+
# Determine if current distribution is a Fedora-based distribution
# (Fedora, RHEL, CentOS, etc).
# is_fedora
@@ -337,7 +352,7 @@
fi
[ "$os_VENDOR" = "Fedora" ] || [ "$os_VENDOR" = "Red Hat" ] || \
- [ "$os_VENDOR" = "CentOS" ] || [ "$os_VENDOR" = "OracleServer" ]
+ [ "$os_VENDOR" = "CentOS" ] || [ "$os_VENDOR" = "OracleLinux" ]
}