From f4afbcd3aadfc7184a948cd92a3d98f17c43deac Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Wed, 16 Oct 2019 12:48:30 +0200 Subject: [PATCH] Add support for Alpine Linux 3 Based on https://github.com/xenserver/xe-guest-utilities/pull/53 --- mk/install.sh | 4 ++++ mk/xe-linux-distribution | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/mk/install.sh b/mk/install.sh index 73ca7bf..889f1f0 100755 --- a/mk/install.sh +++ b/mk/install.sh @@ -137,6 +137,9 @@ select_pkgs_rhel() rhel8|centos8|oracle8|scientific8|neokylin8) # No additional kernel package ;; + alpine3*) + # No additional kernel package + ;; rhel3|fedora*) # Not officially supported therefore no additional packages required. ;; @@ -510,6 +513,7 @@ install_coreos() case "${os_distro}" in rhel|centos|oracle|fedora) select_pkgs_rhel ;; scientific|neokylin|asianux|turbo) select_pkgs_rhel ;; + alpine) select_pkgs_rhel ;; sles|"suse linux") select_pkgs_sles ;; debian|ubuntu|linx|yinhe) select_pkgs_debian ;; xe-ddk|xe-sdk) select_pkgs_xe ;; diff --git a/mk/xe-linux-distribution b/mk/xe-linux-distribution index 7cebc68..73d5d90 100755 --- a/mk/xe-linux-distribution +++ b/mk/xe-linux-distribution @@ -494,6 +494,23 @@ identify_boot2docker() } +identify_alpine() +{ + # only tested with Alpine 3.7+ + alpine_release="$1" + local major + local minor + + if [ ! -f "${alpine_release}" ]; then + return 1 + fi + + major=$(awk -F. '{printf("%s", $1)}' ${alpine_release}) + minor=$(awk -F. '{printf("%s.%s", $2, $3)}' ${alpine_release}) + + write_to_output "alpine" "${major}" "${minor}" "Alpine Linux $(head -n 1 ${alpine_release})" +} + if [ $# -eq 1 ] ; then exec 1>"$1" fi @@ -517,6 +534,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_alpine /etc/alpine-release && exit 0 if [ $# -eq 1 ] ; then