From ab5e6a198b3110a7f42bc67da5833f28e6c7c019 Mon Sep 17 00:00:00 2001 From: Jon Maloy Date: Fri, 6 Dec 2024 16:44:39 -0500 Subject: [PATCH] * Fri Dec 06 2024 Jon Maloy - 20220126gitbb1bba3d77-13.el8.7 - edk2-redhat-Fix-ovmf-vars-generator-RH-only.patch [RHEL-66236] - Resolves: RHEL-66236 ([Regression] HTTP Boot fails to work with edk2-ovmf-20231122-6.el9_4.2 and greater [rhel-8.10]) --- edk2.spec | 7 ++++++- ovmf-vars-generator | 37 +++++++++++++++++++------------------ 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/edk2.spec b/edk2.spec index d1262b2..3095a93 100644 --- a/edk2.spec +++ b/edk2.spec @@ -7,7 +7,7 @@ ExclusiveArch: x86_64 aarch64 Name: edk2 Version: %{GITDATE}git%{GITCOMMIT} -Release: 13%{?dist}.6 +Release: 13%{?dist}.7 Summary: UEFI firmware for 64-bit virtual machines Group: Applications/Emulators License: BSD-2-Clause-Patent and OpenSSL and MIT @@ -840,6 +840,11 @@ true %endif %changelog +* Fri Dec 06 2024 Jon Maloy - 20220126gitbb1bba3d77-13.el8.7 +- edk2-redhat-Fix-ovmf-vars-generator-RH-only.patch [RHEL-66236] +- Resolves: RHEL-66236 + ([Regression] HTTP Boot fails to work with edk2-ovmf-20231122-6.el9_4.2 and greater [rhel-8.10]) + * Fri Nov 29 2024 Jon Maloy - 20220126gitbb1bba3d77-13.el8.6 - edk2-OvmfPkg-Rerun-dispatcher-after-initializing-virtio-r.patch [RHEL-66188] - Resolves: RHEL-66188 diff --git a/ovmf-vars-generator b/ovmf-vars-generator index 111e438..fe92d10 100755 --- a/ovmf-vars-generator +++ b/ovmf-vars-generator @@ -46,6 +46,7 @@ def generate_qemu_cmd(args, readonly, *extra_args): args.qemu_binary, '-machine', machinetype, '-display', 'none', + '-no-reboot', '-no-user-config', '-nodefaults', '-m', '768', @@ -104,20 +105,18 @@ def enroll_keys(args): stdout=subprocess.PIPE, stderr=subprocess.STDOUT) logging.info('Performing enrollment') - # Wait until the UEFI shell starts (first line is printed) - read = p.stdout.readline() - if b'char device redirected' in read: + + while True: read = p.stdout.readline() - # Skip passed QEMU warnings, like the following one we see in Ubuntu: - # qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.01H:ECX.vmx [bit 5] - while b'qemu-system-x86_64: warning:' in read: - read = p.stdout.readline() - if args.print_output: - print(strip_special(read), end='') - print() - # Send the escape char to enter the UEFI shell early - p.stdin.write(b'\x1b') - p.stdin.flush() + if args.print_output: + print(strip_special(read), end='') + print() + # due to line buffering this actually waits until the 5 sec + # delay is over and the efi shell is ready to accept input. + if b'Press' in read: + break + + # # And then run the following three commands from the UEFI shell: # change into the first file system device; install the default # keys and certificates, and reboot @@ -127,11 +126,13 @@ def enroll_keys(args): p.stdin.flush() while True: read = p.stdout.readline() - if args.print_output: + if args.print_output and len(read): print('OUT: %s' % strip_special(read), end='') print() if b'info: success' in read: break + elif b'Reset with ' in read: + break p.wait() if args.print_output: print(strip_special(p.stdout.read()), end='') @@ -157,7 +158,7 @@ def test_keys(args): logging.info('Performing verification') while True: read = p.stdout.readline() - if args.print_output: + if args.print_output and len(read): print('OUT: %s' % strip_special(read), end='') print() if b'Secure boot disabled' in read: @@ -212,9 +213,9 @@ def parse_args(): help='Fedora version to get kernel for checking', default='27') parser.add_argument('--kernel-url', help='Kernel URL', - default='https://download.fedoraproject.org/pub/fedora' - '/linux/releases/%(version)s/Everything/x86_64' - '/os/images/pxeboot/vmlinuz') + default='https://archives.fedoraproject.org/pub' + '/archive/fedora/linux/releases/%(version)s' + '/Everything/x86_64/os/images/pxeboot/vmlinuz') parser.add_argument('--disable-smm', help=('Don\'t restrict varstore pflash writes to ' 'guest code that executes in SMM. Use this '