diff options
author | Wei Xie <wei.xie@citrix.com> | 2017-05-27 17:09:27 +0800 |
---|---|---|
committer | Wei Xie <wei.xie@citrix.com> | 2017-06-08 09:28:50 +0800 |
commit | bbf37c460ecca7a395eb32a560423e0dab3054fa (patch) | |
tree | 13922990444521653bebaaa50207f9542037f801 /mk | |
parent | c955ee06b1729154167dd9464c0e106cc191026b (diff) | |
download | vyos-xe-guest-utilities-bbf37c460ecca7a395eb32a560423e0dab3054fa.tar.gz vyos-xe-guest-utilities-bbf37c460ecca7a395eb32a560423e0dab3054fa.zip |
Add support for Yinhe Kylin 4.0.
Signed-off-by: Wei Xie <wei.xie@citrix.com>
Diffstat (limited to 'mk')
-rwxr-xr-x | mk/xe-linux-distribution | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/mk/xe-linux-distribution b/mk/xe-linux-distribution index 7777e68..dccb7f4 100755 --- a/mk/xe-linux-distribution +++ b/mk/xe-linux-distribution @@ -369,7 +369,6 @@ identify_turbo() write_to_output "${distro}" "${major}" "${minor}" "$(head -n 1 ${turbo_release})" } - identify_linx() { linx_release="$1" @@ -402,6 +401,36 @@ identify_linx() write_to_output "${distro}" "${major}" "${minor}" "${linx_osname}" } +identify_yinhe() +{ + yinhe_release="$1" + local distro + local major + local minor + + # distro + # Kylin 4.0 + + if [ ! -f "${yinhe_release}" ] ; then + return 1 + fi + + eval $(sed -rn \ + 's/^Kylin ([0-9]).([0-9])$/distro=yinhe;major=\1;minor=\2;/gp;' \ + "${yinhe_release}") + + if [ -z "${major}" -o -z "${distro}" ] ; then + return 1 + fi + + if [ -z "${minor}" ] ; then + minor=0 + fi + + yinhe_osname="Yinhe Kylin Linux ${major}.${minor}" + write_to_output "${distro}" "${major}" "${minor}" "${yinhe_osname}" +} + identify_boot2docker() { boot2docker_release="$1" @@ -434,6 +463,7 @@ if [ -z "${TEST}" ] ; then identify_redhat /etc/redhat-release && exit 0 identify_sles /etc/SuSE-release && exit 0 #identify Linx disto before debian, as Linx has both linx_release and debian_version. + identify_yinhe /etc/kylin-build && exit 0 identify_linx /etc/linx-release && exit 0 identify_lsb lsb_release && exit 0 identify_debian /etc/debian_version && exit 0 |