Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
virt: Improve detection of EC2 metal instances
The current detection code relies on /sys/firmware/dmi/entries/0-0/raw to disambiguate Amazon EC2 virtualized from metal instances. Unfortunately this file is root only. Thus on a c6g.metal instance (aarch64), we observe something like this: $ systemd-detect-virt amazon $ sudo systemd-detect-virt none Only the latter is correct. The right long term fix is to extend the kernel to expose the SMBIOS BIOS Characteristics properly via /sys/class/dmi, but until this happens (and for backwards compatibility when it does), we need a plan B. This change implements such a workaround by falling back to using the instance type from DMI and looking at the ".metal" string present on metal instances. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
- Loading branch information