virt-what/SOURCES/0030-Check-for-Alibaba-Clou...

50 lines
1.5 KiB
Diff

From 579addba79dccf0cfc84ee80ffb1f8c678be46ee Mon Sep 17 00:00:00 2001
From: Weisson <hanxiaobupt@bupt.edu.cn>
Date: Tue, 1 Jun 2021 20:49:17 +0800
Subject: [PATCH 30/36] Check for Alibaba Cloud X-Dragon Architecture
Thanks to Richard W.M. Jones' Super Powerful Bash Script
(cherry picked from commit b7cc3d93a613ef6d0ac5ccd6e32cc3d66e057243)
---
virt-what.in | 9 +++++++--
virt-what.pod | 2 ++
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/virt-what.in b/virt-what.in
index 3dac91a..520f7b0 100644
--- a/virt-what.in
+++ b/virt-what.in
@@ -114,8 +114,13 @@ dmi=$(LANG=C dmidecode 2>&1)
arch=$(uname -m | sed -e 's/i.86/i386/' | sed -e 's/arm.*/arm/')
# Check for Alibaba Cloud
-if echo "$dmi" | grep -q 'Manufacturer: Alibaba Cloud'; then
- echo "alibaba_cloud"
+if echo "$dmi" | grep -q 'Manufacturer: Alibaba'; then
+ # Check for Alibaba Cloud X-Dragon Architecture
+ if ( { echo -e "GET /latest/meta-datainstance/instance-type HTTP/1.0\r\nHost: 100.100.100.200\r\n\r" >&3; grep -sq 'ebm' <&3 ; } 3<> /dev/tcp/100.100.100.200/80 ) 2>/dev/null ; then
+ echo "alibaba_cloud-x_dragon"
+ else
+ echo "alibaba_cloud"
+ fi
fi
# Check for VMware.
diff --git a/virt-what.pod b/virt-what.pod
index 9f8bea2..6e29570 100644
--- a/virt-what.pod
+++ b/virt-what.pod
@@ -27,6 +27,8 @@ don't know about or cannot detect.
=item B<alibaba_cloud>
+=item B<alibaba_cloud-x_dragon>
+
This is a cloud computing service based on Alibaba Cloud.
Status: contributed by Weisson.
--
2.31.1