
From: Simon Glass <sjg@chromium.org> At present the root disk conflicts with the boot disk used to hold the app (or payload). Use virtio for this disk and number the others after that. Signed-off-by: Simon Glass <sjg@chromium.org> --- scripts/build-efi | 5 ++--- scripts/build_helper.py | 8 +++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/build-efi b/scripts/build-efi index adf37cd4aef..634d57e08ed 100755 --- a/scripts/build-efi +++ b/scripts/build-efi @@ -83,8 +83,7 @@ class BuildEfi: '-drive', f'if=pflash,format=raw,file={var_store}' ] extra += ['-drive', - f'id=hd0,file={self.img},if=none,format=raw', - '-device', 'virtio-blk-device,drive=hd0'] + f'if=virtio,file={self.img},format=raw,id=hd0'] else: # x86 if self.helper.bitness == 64: qemu_arch = 'x86_64' @@ -128,8 +127,8 @@ class BuildEfi: cmd = [qemu] cmd += '-m', mem cmd += '-nic', 'none' - self.helper.add_qemu_args(self.args, cmd) cmd += extra + self.helper.add_qemu_args(self.args, cmd, base_hd=1) tout.info(' '.join(cmd)) command.run(*cmd) diff --git a/scripts/build_helper.py b/scripts/build_helper.py index 52c84861ffe..57c900f251f 100644 --- a/scripts/build_helper.py +++ b/scripts/build_helper.py @@ -126,7 +126,7 @@ sct_mnt = /mnt/sct else: shutil.copy2(tmp.name, fname) - def add_qemu_args(self, args, cmd): + def add_qemu_args(self, args, cmd, base_hd=0): """Add QEMU arguments according to the selected options This helps in creating the command-line used to run QEMU. @@ -134,6 +134,7 @@ sct_mnt = /mnt/sct Args: args (list of str): Existing arguments to add to cmd (argparse.Namespace): Program arguments + base_hd (int): Base number to use for QEMU hd device """ cmdline = [] if args.kernel: @@ -171,10 +172,11 @@ sct_mnt = /mnt/sct cmd.extend([ '-device', f'virtio-scsi-pci,id=scsi0,{MODERN_PCI}', - '-device', f'scsi-hd,bus=scsi0.0,drive=hd{i}']) + '-device', + f'scsi-hd,bus=scsi0.0,drive=hd{base_hd + i}']) cmd.extend([ '-drive', - f'if={iface},file={disk},format=raw,id=hd{i}']) + f'if={iface},file={disk},format=raw,id=hd{base_hd + i}']) else: tout.warning(f"Disk image '{disk}' not found") -- 2.43.0