diff options
author | Wei Xie <wei.xie@citrix.com> | 2017-04-21 15:16:58 +0800 |
---|---|---|
committer | Wei Xie <wei.xie@citrix.com> | 2017-05-31 09:27:37 +0800 |
commit | b467af09a66af86d82dc7430d149a299a5b50f7c (patch) | |
tree | 8b04cd930b0ed10798d7d312ef5ccb0ecbfeb889 | |
parent | d5f5ea84568e4bdd192f16e250bcb7899570ff34 (diff) | |
download | vyos-xe-guest-utilities-b467af09a66af86d82dc7430d149a299a5b50f7c.tar.gz vyos-xe-guest-utilities-b467af09a66af86d82dc7430d149a299a5b50f7c.zip |
CP-21862: Make guest tools identify RedFlag Linux.
Signed-off-by: Wei Xie <wei.xie@citrix.com>
-rwxr-xr-x | mk/xe-linux-distribution | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/mk/xe-linux-distribution b/mk/xe-linux-distribution index 81f8fbf..35a8a87 100755 --- a/mk/xe-linux-distribution +++ b/mk/xe-linux-distribution @@ -308,6 +308,38 @@ 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_boot2docker() { boot2docker_release="$1" @@ -331,6 +363,7 @@ 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_kylin /etc/neokylin-release && exit 0 identify_redhat /etc/oracle-release && exit 0 identify_redhat /etc/enterprise-release && exit 0 |