From ef0760561e2a846909466ab08e348fa89325f0b2 Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Wed, 16 Oct 2019 15:23:59 +0200 Subject: [PATCH] Add support for Sangoma Linux (FreePBX), CentOS-based Based on https://github.com/xenserver/xe-guest-utilities/pull/57 Refs https://github.com/xcp-ng/xcp/issues/243 --- mk/install.sh | 5 ++++- mk/xe-linux-distribution | 30 ++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/mk/install.sh b/mk/install.sh index 32706dc..4faae79 100755 --- a/mk/install.sh +++ b/mk/install.sh @@ -138,6 +138,9 @@ select_pkgs_rhel() rhel8|oracle8|centos8|rocky8|cloudlinux8) # No additional kernel package ;; + sangoma*) + # No additional kernel package + ;; rhel3|fedora*) # Not officially supported therefore no additional packages required. ;; @@ -517,7 +520,7 @@ install_coreos() case "${os_distro}" in rhel|centos|oracle|fedora|rocky) select_pkgs_rhel ;; scientific|neokylin|asianux|turbo) select_pkgs_rhel ;; - cloudlinux) select_pkgs_rhel ;; + cloudlinux|sangoma) select_pkgs_rhel ;; sles|"suse linux") select_pkgs_sles ;; debian|ubuntu|linx|yinhe|Gooroom) select_pkgs_debian ;; xe-ddk|xe-sdk) select_pkgs_xe ;; diff --git a/mk/xe-linux-distribution b/mk/xe-linux-distribution index b6b846d..ee568dc 100755 --- a/mk/xe-linux-distribution +++ b/mk/xe-linux-distribution @@ -402,6 +402,35 @@ identify_asianux() write_to_output "${distro}" "${major}" "${minor}" "$(head -n 1 ${asianux_release})" } +identify_sangoma() +{ + sangoma_release="$1" + local distro + local major + local minor + + # distro + # 'Sangoma Linux (FreePBX)' + + if [ ! -f "${sangoma_release}" ] ; then + return 1 + fi + + eval $(sed -rn \ + 's/^Sangoma Linux release \([0-9]*\)\.\([0-9]*\)\(\.[0-9]*\)\? (.*)/distro=sangoma;major=\1;minor=\2/gp;' \ + "${sangoma_release}") + + if [ -z "${major}" -o -z "${distro}" ] ; then + return 1 + fi + + if [ -z "${minor}" ] ; then + minor=0 + fi + + write_to_output "${distro}" "${major}" "${minor}" "$(head -n 1 ${sangoma_release})" +} + identify_turbo() { turbo_release="$1" @@ -568,6 +597,7 @@ if [ -z "${TEST}" ] ; then identify_lsb lsb_release && exit 0 identify_debian /etc/debian_version && exit 0 identify_boot2docker /etc/boot2docker && exit 0 + identify_sangoma /etc/centos-release && exit 0 identify_os_release /etc/os-release && exit 0