public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Felix Moessbauer <felix.moessbauer@siemens.com>
To: <isar-users@googlegroups.com>
Cc: <amikan@ilbers.de>, <henning.schild@siemens.com>,
	<jan.kiszka@siemens.com>, <adriaan.schmidt@siemens.com>,
	Felix Moessbauer <felix.moessbauer@siemens.com>
Subject: [PATCH v3 6/7] Add pcbios option to start_vm
Date: Tue, 22 Mar 2022 17:45:24 +0100	[thread overview]
Message-ID: <20220322164525.3950970-7-felix.moessbauer@siemens.com> (raw)
In-Reply-To: <20220322164525.3950970-1-felix.moessbauer@siemens.com>

This patch adds the --pcbios option to the start_vm script to
enforce that any -bios QEMU options are removed.
By that, QEMU is forced to use a pc bios (like seabios).

This helps to test combined efi + pcbios disks as these can be
bootet with both efi and pc bios.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 testsuite/start_vm.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/testsuite/start_vm.py b/testsuite/start_vm.py
index 8fd3e16c..708520f7 100755
--- a/testsuite/start_vm.py
+++ b/testsuite/start_vm.py
@@ -21,7 +21,7 @@ def get_bitbake_var(output, var):
             ret = line.split('"')[1]
     return ret
 
-def format_qemu_cmdline(arch, build, distro, out, pid):
+def format_qemu_cmdline(arch, build, distro, out, pid, enforce_pcbios=False):
     bb_output = get_bitbake_env(arch, distro).decode()
 
     rootfs_image = ''
@@ -66,6 +66,9 @@ def format_qemu_cmdline(arch, build, distro, out, pid):
         extra_args.extend(['-pidfile', pid])
 
     qemu_disk_args = qemu_disk_args.replace('##ROOTFS_IMAGE##', deploy_dir_image + '/' + rootfs_image).split()
+    if enforce_pcbios and '-bios' in qemu_disk_args:
+        bios_idx = qemu_disk_args.index('-bios')
+        del qemu_disk_args[bios_idx : bios_idx+2]
 
     cmd = ['qemu-system-' + qemu_arch, '-m', '1024M']
 
@@ -80,8 +83,8 @@ def format_qemu_cmdline(arch, build, distro, out, pid):
 
     return cmd
 
-def start_qemu(arch, build, distro, out, pid):
-    cmdline = format_qemu_cmdline(arch, build, distro, out, pid)
+def start_qemu(arch, build, distro, out, pid, enforce_pcbios):
+    cmdline = format_qemu_cmdline(arch, build, distro, out, pid, enforce_pcbios)
     cmdline.insert(1, '-nographic')
 
     print(cmdline)
@@ -94,6 +97,7 @@ if __name__ == "__main__":
     parser.add_argument('-d', '--distro', choices=['jessie', 'stretch', 'buster', 'bullseye', 'bookworm'], help='set isar Debian distribution.', default='stretch')
     parser.add_argument('-o', '--out', help='Route QEMU console output to specified file.')
     parser.add_argument('-p', '--pid', help='Store QEMU pid to specified file.')
+    parser.add_argument('--pcbios', action="store_true", help='remove any bios options to enforce use of pc bios')
     args = parser.parse_args()
 
-    start_qemu(args.arch, args.build, args.distro, args.out, args.pid)
+    start_qemu(args.arch, args.build, args.distro, args.out, args.pid, args.pcbios)
-- 
2.30.2


  parent reply	other threads:[~2022-03-22 16:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-22 16:45 [PATCH v3 0/7] Add support for dual bios + efi disk generation Felix Moessbauer
2022-03-22 16:45 ` [PATCH v3 1/7] Copy efi-plus-pcbios script from OE Felix Moessbauer
2022-03-22 16:45 ` [PATCH v3 2/7] Add ISAR version of biosplusefi WIC plugin Felix Moessbauer
2022-03-28  8:51   ` Henning Schild
2022-03-28  9:11     ` Moessbauer, Felix
2022-03-28  9:20       ` Henning Schild
2022-03-22 16:45 ` [PATCH v3 3/7] wic: make import isarpluginbase work when plugins use each other Felix Moessbauer
2022-03-22 16:45 ` [PATCH v3 4/7] test: add target for efi-plus-pcbios image type Felix Moessbauer
2022-03-22 16:45 ` [PATCH v3 5/7] add support for current debian distros in start_vm.py Felix Moessbauer
2022-03-22 16:45 ` Felix Moessbauer [this message]
2022-03-22 16:45 ` [PATCH v3 7/7] run vm_boot_test against EFI and PC BIOS Felix Moessbauer
2022-04-12 12:56 ` [PATCH v3 0/7] Add support for dual bios + efi disk generation Moessbauer, Felix
2022-04-13  8:34 ` Anton Mikanovich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220322164525.3950970-7-felix.moessbauer@siemens.com \
    --to=felix.moessbauer@siemens.com \
    --cc=adriaan.schmidt@siemens.com \
    --cc=amikan@ilbers.de \
    --cc=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox