Add proper support for Oracle Linux native packages to installer. (#12101)
They got missed somehow in the initial implementation.
Austin S. Hemmelgarn committed
Feb 10, 2022 at 09:37 UTC
b70f83b42b98706a47dd9e17cbcc89c099c508d6
2 files changed
+27
-6
packaging/installer/kickstart.sh
+26
-5
@@ -412,7 +412,7 @@ get_system_info() {
412
SYSCODENAME="${VERSION_CODENAME}"
413
SYSARCH="$(uname -m)"
414
415
- supported_compat_names="debian ubuntu centos fedora opensuse"
415
+ supported_compat_names="debian ubuntu centos fedora opensuse ol"
416
417
if str_in_list "${DISTRO}" "${supported_compat_names}"; then
418
DISTRO_COMPAT_NAME="${DISTRO}"
@@ -423,13 +423,18 @@ get_system_info() {
423
;;
424
rocky|rhel)
425
DISTRO_COMPAT_NAME="centos"
426
- SYSVERSION=$(echo "$SYSVERSION" | cut -d'.' -f1)
426
;;
427
*)
428
DISTRO_COMPAT_NAME="unknown"
429
;;
430
esac
431
fi
432
+
433
+ case "${DISTRO_COMPAT_NAME}" in
434
+ centos|ol)
435
+ SYSVERSION=$(echo "$SYSVERSION" | cut -d'.' -f1)
436
+ ;;
437
+ esac
438
else
439
DISTRO="unknown"
440
DISTRO_COMPAT_NAME="unknown"
@@ -772,7 +777,7 @@ pkg_installed() {
777
dpkg-query --show --showformat '${Status}' "${1}" 2>&1 | cut -f 1 -d ' ' | grep -q '^install$'
778
return $?
779
;;
775
- centos|fedora|opensuse)
780
+ centos|fedora|opensuse|ol)
781
rpm -q "${1}" > /dev/null 2>&1
782
return $?
783
;;
@@ -789,7 +794,7 @@ netdata_avail_check() {
794
env DEBIAN_FRONTEND=noninteractive apt-cache policy netdata | grep -q packagecloud.io/netdata/netdata;
795
return $?
796
;;
792
- centos|fedora)
797
+ centos|fedora|ol)
798
# shellcheck disable=SC2086
799
${pm_cmd} search -v netdata | grep -qE 'Repo *: netdata(-edge)?$'
800
return $?
@@ -831,7 +836,7 @@ check_special_native_deps() {
836
}
837
838
try_package_install() {
834
- if [ -z "${DISTRO}" ]; then
839
+ if [ -z "${DISTRO}" ] || [ "${DISTRO}" = "unknown" ]; then
840
warning "Unable to determine Linux distribution for native packages."
841
return 1
842
fi
@@ -923,6 +928,22 @@ try_package_install() {
928
uninstall_subcmd="remove"
929
INSTALL_TYPE="binpkg-rpm"
930
;;
931
+ ol)
932
+ if command -v dnf > /dev/null; then
933
+ pm_cmd="dnf"
934
+ repo_subcmd="makecache"
935
+ else
936
+ pm_cmd="yum"
937
+ fi
938
+ repo_prefix="ol/${SYSVERSION}"
939
+ pkg_type="rpm"
940
+ pkg_suffix=".noarch"
941
+ pkg_vsep="-"
942
+ pkg_install_opts="${interactive_opts}"
943
+ repo_update_opts="${interactive_opts}"
944
+ uninstall_subcmd="remove"
945
+ INSTALL_TYPE="binpkg-rpm"
946
+ ;;
947
*)
948
warning "We do not provide native packages for ${DISTRO}."
949
return 2
packaging/installer/methods/kickstart.md
+1
-1
@@ -136,7 +136,7 @@ To use `md5sum` to verify the integrity of the `kickstart.sh` script you will do
136
run the following:
137
138
```bash
139
-[ "0cfdc04fd4004f77ebc3c1e564ee6476" = "$(curl -Ss https://my-netdata.io/kickstart.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID"
139
+[ "22039cdffef3eef21238c26605085ede" = "$(curl -Ss https://my-netdata.io/kickstart.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID"
140
```
141
142
If the script is valid, this command will return `OK, VALID`.