diff --git a/diskimage_builder/elements/rhel/pre-install.d/03-reset-bls-entries b/diskimage_builder/elements/rhel/pre-install.d/03-reset-bls-entries new file mode 100755 index 00000000..d2bd4f6d --- /dev/null +++ b/diskimage_builder/elements/rhel/pre-install.d/03-reset-bls-entries @@ -0,0 +1,39 @@ +#!/bin/bash + +if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then + set -x +fi +set -eu +set -o pipefail + +if [[ ! '9' =~ ${DIB_RELEASE} ]]; then + exit 0 +fi + +# This is a workaround for the grub issue reported upstream with +# https://bugzilla.redhat.com/show_bug.cgi?id=2032680 + +# This renames the BLS entries from the upstream .qcow2 image in +# /boot/loader/entries with the current machine-id. This means that in the +# bootloader setup, grub2-mkconfig will update config options as required. + +pushd /boot/loader/entries + +machine_id=$(