summaryrefslogtreecommitdiff
path: root/mk/xe-linux-distribution
diff options
context:
space:
mode:
authorCheng Zhang <cheng.zhang@citrix.com>2017-05-31 17:46:26 +0800
committerGitHub <noreply@github.com>2017-05-31 17:46:26 +0800
commitb16378be793648a31c7ce4bcb96e1b9c6dea8d05 (patch)
tree80b06a06e8335536752b817891806433c1444646 /mk/xe-linux-distribution
parentd5f5ea84568e4bdd192f16e250bcb7899570ff34 (diff)
parent447814e87f1a58a60e81e55096361facb28c121d (diff)
downloadvyos-xe-guest-utilities-b16378be793648a31c7ce4bcb96e1b9c6dea8d05.tar.gz
vyos-xe-guest-utilities-b16378be793648a31c7ce4bcb96e1b9c6dea8d05.zip
Merge pull request #36 from xiewei20082008/private/weix/redflag-turbov7.5.0
Add support for Redflag and Turbo Linux
Diffstat (limited to 'mk/xe-linux-distribution')
-rwxr-xr-xmk/xe-linux-distribution63
1 files changed, 63 insertions, 0 deletions
diff --git a/mk/xe-linux-distribution b/mk/xe-linux-distribution
index 81f8fbf..8bf1b55 100755
--- a/mk/xe-linux-distribution
+++ b/mk/xe-linux-distribution
@@ -308,6 +308,67 @@ identify_kylin()
write_to_output "${distro}" "${major}" "${minor}" "$(head -n 1 ${kylin_release})"
}
+identify_asianux()
+{
+ asianux_release="$1"
+ local distro
+ local major
+ local minor
+
+ # distro
+ # 'Asianux Server 4.5 (Final)'
+ # 'Asianux Server 4 (Hiranya SP2)'
+ # 'Asianux Server 4 (Hiranya SP4)'
+
+ if [ ! -f "${asianux_release}" ] ; then
+ return 1
+ fi
+
+ eval $(sed -rn \
+ 's/^Asianux Server ([0-9]*)\.([0-9]*) .*$/distro=asianux;major=\1;minor=\2;/gp;'`
+ `'s/^Asianux Server ([0-9]*) \([^0-9]*([0-9]*)\)$/distro=asianux;major=\1;minor=\2;/gp;' \
+ "${asianux_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 ${asianux_release})"
+}
+
+identify_turbo()
+{
+ turbo_release="$1"
+ local distro
+ local major
+ local minor
+
+ # distro
+ # GreatTurbo Enterprise Server release 12.2 (Theseus)
+
+ if [ ! -f "${turbo_release}" ] ; then
+ return 1
+ fi
+
+ eval $(sed -rn \
+ 's/^GreatTurbo[^0-9]*([0-9]*)\.?([0-9]*)?.*$/distro=turbo;major=\1;minor=\2;/gp;' \
+ "${turbo_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 ${turbo_release})"
+}
+
identify_boot2docker()
{
boot2docker_release="$1"
@@ -331,6 +392,8 @@ fi
if [ -z "${TEST}" ] ; then
#identify kylin disto before redhat, as kylin has both kylin_release and redhat_release.
+ identify_asianux /etc/asianux-release && exit 0
+ identify_turbo /etc/turbo-release && exit 0
identify_kylin /etc/neokylin-release && exit 0
identify_redhat /etc/oracle-release && exit 0
identify_redhat /etc/enterprise-release && exit 0