From 1f2a874e8e21ef1f2c53b8ee9adc93f5b40eb6cc Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Wed, 7 Aug 2019 18:18:34 +1000 Subject: [PATCH] Create /etc/machine-id for RHEL images Per the inline comment, a machine-id is required for kernels to install correctly (this may well be a bug, but the linked issue remained inconclusive). Add a call to make the machine-id before install packages. Change-Id: If75d04376e62bfdfe14ee3ca4d0bd5c8b383c1b0 Redhat-Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1737355 --- .../rhel/pre-install.d/02-set-machine-id | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 diskimage_builder/elements/rhel/pre-install.d/02-set-machine-id diff --git a/diskimage_builder/elements/rhel/pre-install.d/02-set-machine-id b/diskimage_builder/elements/rhel/pre-install.d/02-set-machine-id new file mode 100755 index 00000000..76ef05a5 --- /dev/null +++ b/diskimage_builder/elements/rhel/pre-install.d/02-set-machine-id @@ -0,0 +1,23 @@ +#!/bin/bash + +if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then + set -x +fi +set -eu +set -o pipefail + +# Set a machine-id. The .qcow2 image doesn't have one, and sometimes +# one will get made (if systemd is upgraded as part of the build +# process) and sometimes not. The problem is that certain kernel +# install scripts bail silently without it; kernel packages end up +# being installed but the initramfs etc isn't copied into place. +# +# Note this is cleared out in the sysprep role. +# +# See also: +# 768c5e188c1b4bff01da14a49b96b51301db4c03 : similar thing for fedora +# https://bugzilla.redhat.com/show_bug.cgi?id=1737355 : upstream bug +# https://bugzilla.redhat.com/show_bug.cgi?id=1486124 : unresolved +# bug about kernel install requiring machine-id + +systemd-machine-id-setup