Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proper support for Oracle Linux native packages to installer. #12101

Merged
merged 1 commit into from Feb 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 26 additions & 5 deletions packaging/installer/kickstart.sh
Expand Up @@ -412,7 +412,7 @@ get_system_info() {
SYSCODENAME="${VERSION_CODENAME}"
SYSARCH="$(uname -m)"

supported_compat_names="debian ubuntu centos fedora opensuse"
supported_compat_names="debian ubuntu centos fedora opensuse ol"

if str_in_list "${DISTRO}" "${supported_compat_names}"; then
DISTRO_COMPAT_NAME="${DISTRO}"
Expand All @@ -423,13 +423,18 @@ get_system_info() {
;;
rocky|rhel)
DISTRO_COMPAT_NAME="centos"
SYSVERSION=$(echo "$SYSVERSION" | cut -d'.' -f1)
;;
*)
DISTRO_COMPAT_NAME="unknown"
;;
esac
fi

case "${DISTRO_COMPAT_NAME}" in
centos|ol)
SYSVERSION=$(echo "$SYSVERSION" | cut -d'.' -f1)
;;
esac
else
DISTRO="unknown"
DISTRO_COMPAT_NAME="unknown"
Expand Down Expand Up @@ -772,7 +777,7 @@ pkg_installed() {
dpkg-query --show --showformat '${Status}' "${1}" 2>&1 | cut -f 1 -d ' ' | grep -q '^install$'
return $?
;;
centos|fedora|opensuse)
centos|fedora|opensuse|ol)
rpm -q "${1}" > /dev/null 2>&1
return $?
;;
Expand All @@ -789,7 +794,7 @@ netdata_avail_check() {
env DEBIAN_FRONTEND=noninteractive apt-cache policy netdata | grep -q packagecloud.io/netdata/netdata;
return $?
;;
centos|fedora)
centos|fedora|ol)
# shellcheck disable=SC2086
${pm_cmd} search -v netdata | grep -qE 'Repo *: netdata(-edge)?$'
return $?
Expand Down Expand Up @@ -831,7 +836,7 @@ check_special_native_deps() {
}

try_package_install() {
if [ -z "${DISTRO}" ]; then
if [ -z "${DISTRO}" ] || [ "${DISTRO}" = "unknown" ]; then
warning "Unable to determine Linux distribution for native packages."
return 1
fi
Expand Down Expand Up @@ -923,6 +928,22 @@ try_package_install() {
uninstall_subcmd="remove"
INSTALL_TYPE="binpkg-rpm"
;;
ol)
if command -v dnf > /dev/null; then
pm_cmd="dnf"
repo_subcmd="makecache"
else
pm_cmd="yum"
fi
repo_prefix="ol/${SYSVERSION}"
pkg_type="rpm"
pkg_suffix=".noarch"
pkg_vsep="-"
pkg_install_opts="${interactive_opts}"
repo_update_opts="${interactive_opts}"
uninstall_subcmd="remove"
INSTALL_TYPE="binpkg-rpm"
;;
*)
warning "We do not provide native packages for ${DISTRO}."
return 2
Expand Down
2 changes: 1 addition & 1 deletion packaging/installer/methods/kickstart.md
Expand Up @@ -136,7 +136,7 @@ To use `md5sum` to verify the integrity of the `kickstart.sh` script you will do
run the following:

```bash
[ "0cfdc04fd4004f77ebc3c1e564ee6476" = "$(curl -Ss https://my-netdata.io/kickstart.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID"
[ "22039cdffef3eef21238c26605085ede" = "$(curl -Ss https://my-netdata.io/kickstart.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID"
```

If the script is valid, this command will return `OK, VALID`.
Expand Down