summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnshul Makkar <anshul.makkar@citrix.com>2016-11-02 11:56:47 +0000
committerAnshul Makkar <anshul.makkar@citrix.com>2016-11-02 15:06:36 +0000
commit4eb91d4e30ea6f02fba1f12250c7d77804a1080f (patch)
tree03495875aa8807b6300a206bfbaa0ebfac06b072
parent83de5710c11f156c42648947a7e69604f62497df (diff)
downloadvyos-xe-guest-utilities-4eb91d4e30ea6f02fba1f12250c7d77804a1080f.tar.gz
vyos-xe-guest-utilities-4eb91d4e30ea6f02fba1f12250c7d77804a1080f.zip
CA-227810: Modify the guest agent to report OS type as Kylin for kylin guest.
-rwxr-xr-xmk/xe-linux-distribution32
1 files changed, 32 insertions, 0 deletions
diff --git a/mk/xe-linux-distribution b/mk/xe-linux-distribution
index 2d06c39..a71b5f8 100755
--- a/mk/xe-linux-distribution
+++ b/mk/xe-linux-distribution
@@ -276,6 +276,36 @@ identify_lsb()
write_to_output "${distro}" "${major}" "${minor}" "${description}"
}
+identify_kylin()
+{
+ kylin_release="$1"
+ local distro
+ local major
+ local minor
+
+ # distro
+ # NeoKylin Linux Advanced Server release 6.5 (Berryllium)
+ # NeoKylin Linux Advanced Server release 7.0
+
+ if [ ! -f "${kylin_release}" ] ; then
+ return 1
+ fi
+
+ eval $(sed -n -e \
+ 's/^NeoKylin Linux Advanced Server release \([0-9]*\)\.\([0-9]*\) (.*)$/distro=neokylin;major=\1;minor=\2;/gp;' \
+ "${kylin_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 ${kylin_release})"
+}
+
identify_boot2docker()
{
boot2docker_release="$1"
@@ -298,6 +328,8 @@ if [ $# -eq 1 ] ; then
fi
if [ -z "${TEST}" ] ; then
+ #identify kylin disto before redhat, as kylin has both kylin_release and redhat_release.
+ identify_kylin /etc/neokylin-release && exit 0
identify_redhat /etc/oracle-release && exit 0
identify_redhat /etc/enterprise-release && exit 0
identify_redhat /etc/centos-release && exit 0