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
... | ... |
@@ -246,6 +246,7 @@ function GetOSVersion { |
246 | 246 |
# CentOS Linux release 6.0 (Final) |
247 | 247 |
# Fedora release 16 (Verne) |
248 | 248 |
# XenServer release 6.2.0-70446c (xenenterprise) |
249 |
+ # Oracle Linux release 7 |
|
249 | 250 |
os_CODENAME="" |
250 | 251 |
for r in "Red Hat" CentOS Fedora XenServer; do |
251 | 252 |
os_VENDOR=$r |
... | ... |
@@ -259,6 +260,9 @@ function GetOSVersion { |
259 | 259 |
fi |
260 | 260 |
os_VENDOR="" |
261 | 261 |
done |
262 |
+ if [ "$os_VENDOR" = "Red Hat" ] && [[ -r /etc/oracle-release ]]; then |
|
263 |
+ os_VENDOR=OracleLinux |
|
264 |
+ fi |
|
262 | 265 |
os_PACKAGE="rpm" |
263 | 266 |
elif [[ -r /etc/SuSE-release ]]; then |
264 | 267 |
for r in openSUSE "SUSE Linux"; do |
... | ... |
@@ -310,7 +314,7 @@ function GetDistro { |
310 | 310 |
fi |
311 | 311 |
elif [[ "$os_VENDOR" =~ (Red Hat) || \ |
312 | 312 |
"$os_VENDOR" =~ (CentOS) || \ |
313 |
- "$os_VENDOR" =~ (OracleServer) ]]; then |
|
313 |
+ "$os_VENDOR" =~ (OracleLinux) ]]; then |
|
314 | 314 |
# Drop the . release as we assume it's compatible |
315 | 315 |
DISTRO="rhel${os_RELEASE::1}" |
316 | 316 |
elif [[ "$os_VENDOR" =~ (XenServer) ]]; then |
... | ... |
@@ -328,6 +332,17 @@ function is_arch { |
328 | 328 |
[[ "$(uname -m)" == "$1" ]] |
329 | 329 |
} |
330 | 330 |
|
331 |
+# Determine if current distribution is an Oracle distribution |
|
332 |
+# is_oraclelinux |
|
333 |
+function is_oraclelinux { |
|
334 |
+ if [[ -z "$os_VENDOR" ]]; then |
|
335 |
+ GetOSVersion |
|
336 |
+ fi |
|
337 |
+ |
|
338 |
+ [ "$os_VENDOR" = "OracleLinux" ] |
|
339 |
+} |
|
340 |
+ |
|
341 |
+ |
|
331 | 342 |
# Determine if current distribution is a Fedora-based distribution |
332 | 343 |
# (Fedora, RHEL, CentOS, etc). |
333 | 344 |
# is_fedora |
... | ... |
@@ -337,7 +352,7 @@ function is_fedora { |
337 | 337 |
fi |
338 | 338 |
|
339 | 339 |
[ "$os_VENDOR" = "Fedora" ] || [ "$os_VENDOR" = "Red Hat" ] || \ |
340 |
- [ "$os_VENDOR" = "CentOS" ] || [ "$os_VENDOR" = "OracleServer" ] |
|
340 |
+ [ "$os_VENDOR" = "CentOS" ] || [ "$os_VENDOR" = "OracleLinux" ] |
|
341 | 341 |
} |
342 | 342 |
|
343 | 343 |
|
... | ... |
@@ -16,7 +16,7 @@ register_database mysql |
16 | 16 |
|
17 | 17 |
# Linux distros, thank you for being incredibly consistent |
18 | 18 |
MYSQL=mysql |
19 |
-if is_fedora; then |
|
19 |
+if is_fedora && ! is_oraclelinux; then |
|
20 | 20 |
MYSQL=mariadb |
21 | 21 |
fi |
22 | 22 |
|
... | ... |
@@ -32,12 +32,12 @@ function cleanup_database_mysql { |
32 | 32 |
sudo rm -rf /var/lib/mysql |
33 | 33 |
sudo rm -rf /etc/mysql |
34 | 34 |
return |
35 |
+ elif is_suse || is_oraclelinux; then |
|
36 |
+ uninstall_package mysql-community-server |
|
37 |
+ sudo rm -rf /var/lib/mysql |
|
35 | 38 |
elif is_fedora; then |
36 | 39 |
uninstall_package mariadb-server |
37 | 40 |
sudo rm -rf /var/lib/mysql |
38 |
- elif is_suse; then |
|
39 |
- uninstall_package mysql-community-server |
|
40 |
- sudo rm -rf /var/lib/mysql |
|
41 | 41 |
else |
42 | 42 |
return |
43 | 43 |
fi |
... | ... |
@@ -56,12 +56,12 @@ function configure_database_mysql { |
56 | 56 |
if is_ubuntu; then |
57 | 57 |
my_conf=/etc/mysql/my.cnf |
58 | 58 |
mysql=mysql |
59 |
+ elif is_suse || is_oraclelinux; then |
|
60 |
+ my_conf=/etc/my.cnf |
|
61 |
+ mysql=mysql |
|
59 | 62 |
elif is_fedora; then |
60 | 63 |
mysql=mariadb |
61 | 64 |
my_conf=/etc/my.cnf |
62 |
- elif is_suse; then |
|
63 |
- my_conf=/etc/my.cnf |
|
64 |
- mysql=mysql |
|
65 | 65 |
else |
66 | 66 |
exit_distro_not_supported "mysql configuration" |
67 | 67 |
fi |
... | ... |
@@ -140,14 +140,14 @@ EOF |
140 | 140 |
chmod 0600 $HOME/.my.cnf |
141 | 141 |
fi |
142 | 142 |
# Install mysql-server |
143 |
- if is_fedora; then |
|
144 |
- install_package mariadb-server |
|
145 |
- elif is_ubuntu; then |
|
146 |
- install_package mysql-server |
|
147 |
- elif is_suse; then |
|
143 |
+ if is_suse || is_oraclelinux; then |
|
148 | 144 |
if ! is_package_installed mariadb; then |
149 | 145 |
install_package mysql-community-server |
150 | 146 |
fi |
147 |
+ elif is_fedora; then |
|
148 |
+ install_package mariadb-server |
|
149 |
+ elif is_ubuntu; then |
|
150 |
+ install_package mysql-server |
|
151 | 151 |
else |
152 | 152 |
exit_distro_not_supported "mysql installation" |
153 | 153 |
fi |