From 3991e6f066e47cf185bc214361de8a8e092b6e7f Mon Sep 17 00:00:00 2001 From: Huijing Hei Date: Fri, 26 Aug 2022 15:19:32 +0800 Subject: [PATCH] cmd-buildextend-live: always change dir `EFI/{vendor}/` to correct vendor id Fix https://github.com/openshift/os/issues/954 --- src/cmd-buildextend-live | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cmd-buildextend-live b/src/cmd-buildextend-live index 412f0e30a0..06bf2ad5fa 100755 --- a/src/cmd-buildextend-live +++ b/src/cmd-buildextend-live @@ -524,6 +524,14 @@ def generate_iso(): if len(vendor_ids) != 1: raise Exception(f"did not find exactly one EFI vendor ID: {vendor_ids}") + # Always replace live/EFI/{vendor} to actual live/EFI/{vendor_id[0]} + # https://github.com/openshift/os/issues/954 + grubfilepath = ensure_glob(os.path.join(tmpdir, 'live/EFI/*/grub.cfg')) + if len(grubfilepath) != 1: + raise Exception(f'Found != 1 grub.cfg files: {grubfilepath}') + srcpath = os.path.dirname(grubfilepath[0]) + os.renames(srcpath, os.path.join(os.path.dirname(srcpath), vendor_ids[0])) + # Delete fallback and its CSV file. Its purpose is to create # EFI boot variables, which we don't want when booting from # removable media.