Rearrange lxc test to avoid use of cat
[virt-what.git] / virt-what.in
index ad82e22..170bc24 100644 (file)
@@ -175,7 +175,8 @@ fi
 # Added by Marc Fournier
 
 if [ -e "${root}/proc/1/environ" ] &&
-    cat "${root}/proc/1/environ" | tr '\000' '\n' | grep -Eiq '^container=lxc'; then
+    tr '\000' '\n' < "${root}/proc/1/environ" |
+        grep -Eiq '^container=lxc'; then
     echo lxc
 fi
 
@@ -326,6 +327,14 @@ if ! "$skip_qemu_kvm"; then
     elif echo "$dmi" | grep -q 'Product Name: KVM'; then
         echo kvm
         skip_lkvm=true
+    elif echo "$dmi" | grep -q 'Manufacturer: KVM'; then
+        echo kvm
+        skip_lkvm=true
+    elif echo "$dmi" | grep -q 'Manufacturer: Amazon EC2' &&
+        echo "$dmi" | grep -q 'System is a virtual machine'; then
+        # This is for AWS Graviton (Arm) systems which don't have CPUID.
+        echo kvm
+        skip_lkvm=true
     elif echo "$dmi" | grep -q 'Manufacturer: QEMU'; then
         # The test for KVM above failed, so now we know we're
         # not using KVM acceleration.