Bug#1036589: hw-detect: Investigate expanding virtualization detection
I wrote:
> Untested patch attached.
An alternative patch with fewer quotation marks attached, also untested.
Thank you!
Daniel Lewart
Urbana, Illinois
diff -ru a/hw-detect.finish-install.d/08hw-detect b/hw-detect.finish-install.d/08hw-detect
--- a/hw-detect.finish-install.d/08hw-detect 2023-03-13 05:43:20.000000000 -0500
+++ b/hw-detect.finish-install.d/08hw-detect 2024-12-25 00:00:00.000000000 -0600
@@ -9,16 +9,24 @@
if [ ! -e "$entry" ]; then
return
fi
- case "$(cat $entry)" in
- KVM*) echo "kvm";;
- QEMU*) echo "qemu";;
- VMware*) echo "vmware";;
- VMW*) echo "vmware";;
- innotek*) echo "oracle";;
- Xen*) echo "xen";;
- Bochs*) echo "bochs";;
- Parallels*) echo "parallels";;
- BHYVE*) echo "bhyve";;
+ case "$(cat "$entry")" in
+ KVM*) echo kvm;;
+ OpenStack*) echo kvm;;
+ KubeVirt*) echo kvm;;
+ Amazon*) echo amazon;;
+ QEMU*) echo qemu;;
+ VMware*) echo vmware;;
+ VMW*) echo vmware;;
+ innotek*) echo oracle;;
+ VirtualBox*) echo oracle;;
+ Oracle*) echo oracle;;
+ Xen*) echo xen;;
+ Bochs*) echo bochs;;
+ Parallels*) echo parallels;;
+ BHYVE*) echo bhyve;;
+ Hyper-V*) echo microsoft;;
+ Apple*) echo apple;;
+ Google*) echo google;;
esac
}
@@ -26,9 +34,10 @@
local path
local result
for path in /sys/class/dmi/id/product_name \
- /sys/class/dmi/id/sys_vendor \
+ /sys/class/dmi/id/sys_vendor \
/sys/class/dmi/id/board_vendor \
- /sys/class/dmi/id/bios_vendor; do
+ /sys/class/dmi/id/bios_vendor \
+ /sys/class/dmi/id/product_version; do
result=$(detect_virt_dmi_entry $path)
if [ -n "$result" ]; then
echo "$result"
Reply to: