From a1d5e04952725f64e268aa12b089841825a5f2b5 Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Fri, 29 Nov 2019 11:35:21 +0100 Subject: Add --bootloader flag to specify path to a custom u-boot rom. Also should work for other bootloaders. This is intended to help with keeping around older versions of images with a similarly old bootloader. Signed-off-by: Patrick Vacek --- lib/oeqa/selftest/cases/testutils.py | 1 + scripts/qemucommand.py | 2 ++ scripts/run-qemu-ota | 1 + 3 files changed, 4 insertions(+) diff --git a/lib/oeqa/selftest/cases/testutils.py b/lib/oeqa/selftest/cases/testutils.py index 802d665..ea7781b 100644 --- a/lib/oeqa/selftest/cases/testutils.py +++ b/lib/oeqa/selftest/cases/testutils.py @@ -33,6 +33,7 @@ def qemu_boot_image(imagename, **kwargs): # subdirectory. args.dir = 'tmp/deploy/images' args.efi = kwargs.get('efi', False) + args.bootloader = kwargs.get('bootloader', None) args.machine = kwargs.get('machine', None) args.mem = kwargs.get('mem', '128M') qemu_use_kvm = get_bb_var("QEMU_USE_KVM") diff --git a/scripts/qemucommand.py b/scripts/qemucommand.py index 9b23c54..cef434d 100644 --- a/scripts/qemucommand.py +++ b/scripts/qemucommand.py @@ -58,6 +58,8 @@ class QemuCommand(object): if args.efi: self.bios = 'OVMF.fd' else: + if args.bootloader: + uboot_path = args.bootloader uboot_path = abspath(join(args.dir, self.machine, 'u-boot-qemux86-64.rom')) if self.overlay: new_uboot_path = self.overlay + '.u-boot.rom' diff --git a/scripts/run-qemu-ota b/scripts/run-qemu-ota index 232ee11..e2a4103 100755 --- a/scripts/run-qemu-ota +++ b/scripts/run-qemu-ota @@ -20,6 +20,7 @@ def main(): help='Boot using UEFI rather than U-Boot. This requires the image to be built with ' + 'OSTREE_BOOTLOADER = "grub" and OVMF.fd firmware to be installed (try "apt install ovmf")', action='store_true') + parser.add_argument('--bootloader', default=None, help="Path to bootloader, e.g. a u-boot ROM") parser.add_argument('--machine', default=None, help="Target MACHINE") kvm_group = parser.add_argument_group() kvm_group.add_argument('--force-kvm', help='Force use of KVM (default is to autodetect)', -- cgit v1.2.3-54-g00ecf