From e7bea0df45d034e7142cd0e9e402092ea9479613 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 6 Jun 2022 13:10:22 -0400 Subject: [PATCH] Advance work on EL9 diskless support --- confluent_osdeploy/confluent_osdeploy.spec.tmpl | 1 - imgutil/imgutil | 12 +++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/confluent_osdeploy/confluent_osdeploy.spec.tmpl b/confluent_osdeploy/confluent_osdeploy.spec.tmpl index 983792ba..1fb3bdcd 100644 --- a/confluent_osdeploy/confluent_osdeploy.spec.tmpl +++ b/confluent_osdeploy/confluent_osdeploy.spec.tmpl @@ -29,7 +29,6 @@ cp confluent_imginfo copernicus clortho autocons ../opt/confluent/bin cp start_root urlmount ../stateless-bin/ cd .. ln -s el8 el9 -ln -s el8-diskless el9-diskless for os in rhvh4 el7 genesis el8 suse15 ubuntu20.04 ubuntu22.04 coreos el9; do mkdir ${os}out cd ${os}out diff --git a/imgutil/imgutil b/imgutil/imgutil index a5706814..c5f2bb91 100644 --- a/imgutil/imgutil +++ b/imgutil/imgutil @@ -904,7 +904,7 @@ def fingerprint_source_suse(files, sourcepath, args): def fingerprint_source_el(files, sourcepath, args): for filen in files: - if '-release-8' in filen or '-release-7' in filen: + if '-release-8' in filen or '-release-7' in filen or '-release-9' in filen: parts = filen.split('-') osname = '_'.join(parts[:-3]) if osname == 'centos_linux': @@ -929,6 +929,7 @@ def fingerprint_source(sourcepath, args): return oshandler def fingerprint_host_el(args, hostpath='/'): + release = '' if hostpath[0] != '/': hostpath = os.path.join(os.getcwd(), hostpath) try: @@ -936,7 +937,7 @@ def fingerprint_host_el(args, hostpath='/'): ts = rpm.TransactionSet(hostpath) rpms = ts.dbMatch('provides', 'system-release') for inf in rpms: - if 'el8' not in inf.release and 'el7' not in inf.release: + if 'el8' not in inf.release and 'el7' not in inf.release and 'el9' not in inf.release: continue osname = inf.name version = inf.version @@ -960,7 +961,7 @@ def fingerprint_host_el(args, hostpath='/'): version = v except subprocess.SubprocessError: return None - if 'el8' not in release and 'el7' not in release: + if 'el8' not in release and 'el7' not in release and 'el9' not in release: return None osname = osname.replace('-release', '').replace('-', '_') if osname == 'centos_linux': @@ -1267,6 +1268,11 @@ def gather_bootloader(outdir, rootpath='/'): grubbin = os.path.join(rootpath, 'usr/lib64/efi/grub.efi') if not os.path.exists(grubbin): grubbin = os.path.join(rootpath, 'usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed') + if not os.path.exists(grubbin): + grubs = os.path.join(rootpath, 'boot/efi/EFI/*/grubx64.efi') + grubs = glob.glob(grubs) + if len(grubs) == 1: + grubbin = grubs[0] shutil.copyfile(grubbin, os.path.join(outdir, 'boot/efi/boot/grubx64.efi')) shutil.copyfile(grubbin, os.path.join(outdir, 'boot/efi/boot/grub.efi'))