scripts: build-qemu: Support running qboot
Qboot is a good demonstration of the fastest possible boot on x86. Add a way to run Qboot instead of U-Boot, for easy comparison. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -63,6 +63,8 @@ def parse_args():
|
||||
help='Kernel to run using -kernel')
|
||||
parser.add_argument('-o', '--os', metavar='NAME', choices=['ubuntu'],
|
||||
help='Run a specified Operating System')
|
||||
parser.add_argument('-Q', '--use-qboot', action='store_true',
|
||||
help='Run qboot instead of U-Boot')
|
||||
parser.add_argument('-r', '--run', action='store_true',
|
||||
help='Run QEMU with the built/specified image')
|
||||
parser.add_argument('-x', '--xpl', action='store_true',
|
||||
@@ -104,6 +106,7 @@ class BuildQemu:
|
||||
self.sctdir = Path(self.helper.get_setting('sct_dir', '~/dev/efi/sct'))
|
||||
self.tiano = Path(self.helper.get_setting('tianocore_dir',
|
||||
'~/dev/tiano'))
|
||||
self.qboot = Path(self.helper.get_setting('qboot_dir', '~/dev/qboot'))
|
||||
self.mnt = Path(self.helper.get_setting('sct_mnt', '/mnt/sct'))
|
||||
|
||||
self.bitness = 32 if args.word_32bit else 64
|
||||
@@ -150,6 +153,12 @@ class BuildQemu:
|
||||
tout.fatal(
|
||||
'Error: Tianocore BIOS specified (-E) but not found at '
|
||||
f'{bios_override}')
|
||||
elif args.use_qboot:
|
||||
bios_override = Path(self.qboot, 'bios.bin')
|
||||
if not bios_override.exists():
|
||||
tout.fatal(
|
||||
'Error: qboot BIOS specified (-Q) but not found at '
|
||||
f'{bios_override}')
|
||||
|
||||
self.seq_fname = Path(args.sct_seq) if args.sct_seq else None
|
||||
self.img_fname = Path(args.disk) if args.disk else None
|
||||
@@ -301,7 +310,7 @@ class BuildQemu:
|
||||
qemu_cmd.extend(self.kvm_params)
|
||||
qemu_cmd.extend(['-m', self.mem])
|
||||
|
||||
if not self.args.sct_run:
|
||||
if not self.args.sct_run and not self.qboot:
|
||||
qemu_cmd.extend(['-netdev', 'user,id=net0,hostfwd=tcp::2222-:22',
|
||||
'-device', 'virtio-net-pci,netdev=net0'])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user