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: <henning.schild@siemens.com>, <adriaan.schmidt@siemens.com>,
	<jan.kiszka@siemens.com>,
	Felix Moessbauer <felix.moessbauer@siemens.com>
Subject: [PATCH v2 5/6] Add pcbios option to start_vm
Date: Mon, 7 Mar 2022 07:42:50 +0100	[thread overview]
Message-ID: <20220307064252.651695-6-felix.moessbauer@siemens.com> (raw)
In-Reply-To: <20220307064252.651695-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-07  6:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-07  6:42 [PATCH v2 0/6] Add support for dual bios + efi disk generation Felix Moessbauer
2022-03-07  6:42 ` [PATCH v2 1/6] Add ISAR version of biosplusefi WIC plugin Felix Moessbauer
2022-03-07  6:42 ` [PATCH v2 2/6] wic: make import isarpluginbase work when plugins use each other Felix Moessbauer
2022-03-07  6:42 ` [PATCH v2 3/6] test: add target for efi-plus-pcbios image type Felix Moessbauer
2022-03-07  6:42 ` [PATCH v2 4/6] add support for current debian distros in start_vm.py Felix Moessbauer
2022-03-07  6:42 ` Felix Moessbauer [this message]
2022-03-07  6:42 ` [PATCH v2 6/6] run vm_boot_test against EFI and PC BIOS Felix Moessbauer
2022-03-07  9:50 ` [PATCH v2 0/6] Add support for dual bios + efi disk generation Henning Schild
2022-03-22 14:01 ` 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=20220307064252.651695-6-felix.moessbauer@siemens.com \
    --to=felix.moessbauer@siemens.com \
    --cc=adriaan.schmidt@siemens.com \
    --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