|
|
6f381c |
From e320f72150829228f10ec24f3fba34d5377c5120 Mon Sep 17 00:00:00 2001
|
|
|
6f381c |
From: Bertrand Jacquin <bertrand@jacquin.bzh>
|
|
|
6f381c |
Date: Sun, 11 Oct 2020 22:25:56 +0100
|
|
|
6f381c |
Subject: [PATCH] machine-id-setup: generate machine-id from DMI product ID on
|
|
|
6f381c |
Amazon EC2
|
|
|
6f381c |
|
|
|
6f381c |
Amazon EC2 Nitro hypervisor is technically based on KVM[1].
|
|
|
6f381c |
|
|
|
6f381c |
[1] https://aws.amazon.com/ec2/faqs/
|
|
|
6f381c |
|
|
|
6f381c |
(cherry picked from commit 382a46d129899ca9027b07c325102cab173dd563)
|
|
|
6f381c |
|
|
|
6f381c |
Related: #2117948
|
|
|
6f381c |
---
|
|
|
6f381c |
src/core/machine-id-setup.c | 8 ++++----
|
|
|
6f381c |
1 file changed, 4 insertions(+), 4 deletions(-)
|
|
|
6f381c |
|
|
|
6f381c |
diff --git a/src/core/machine-id-setup.c b/src/core/machine-id-setup.c
|
|
|
6f381c |
index 11528f83c4..fe2abc4e68 100644
|
|
|
6f381c |
--- a/src/core/machine-id-setup.c
|
|
|
6f381c |
+++ b/src/core/machine-id-setup.c
|
|
|
6f381c |
@@ -57,11 +57,11 @@ static int generate_machine_id(const char *root, sd_id128_t *ret) {
|
|
|
6f381c |
return 0;
|
|
|
6f381c |
}
|
|
|
6f381c |
|
|
|
6f381c |
- } else if (detect_vm() == VIRTUALIZATION_KVM) {
|
|
|
6f381c |
+ } else if (IN_SET(detect_vm(), VIRTUALIZATION_KVM, VIRTUALIZATION_AMAZON, VIRTUALIZATION_QEMU)) {
|
|
|
6f381c |
|
|
|
6f381c |
- /* If we are not running in a container, see if we are
|
|
|
6f381c |
- * running in qemu/kvm and a machine ID was passed in
|
|
|
6f381c |
- * via -uuid on the qemu/kvm command line */
|
|
|
6f381c |
+ /* If we are not running in a container, see if we are running in a VM that provides
|
|
|
6f381c |
+ * a system UUID via the SMBIOS/DMI interfaces. Such environments include QEMU/KVM
|
|
|
6f381c |
+ * with the -uuid on the qemu command line or the Amazon EC2 Nitro hypervisor. */
|
|
|
6f381c |
|
|
|
6f381c |
if (id128_read("/sys/class/dmi/id/product_uuid", ID128_UUID, ret) >= 0) {
|
|
|
6f381c |
log_info("Initializing machine ID from KVM UUID.");
|