Skip to content

Commit

Permalink
Add support for Alpine Linux 3
Browse files Browse the repository at this point in the history
Based on xenserver#53
  • Loading branch information
stormi committed Sep 25, 2020
1 parent 9f0a480 commit 85ed4e9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mk/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
;;
Expand Down Expand Up @@ -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 ;;
Expand Down
18 changes: 18 additions & 0 deletions mk/xe-linux-distribution
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 85ed4e9

Please sign in to comment.