Skip to contentSkip to conversation

runqemu: decouple bios and kernel options

PATCH In review Matthias Klein 2 participants 2 messages Aug 4, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 runqemu: decouple bios and kernel options

This will allow the use of a bios (e.g. U-Boot) in combination with a WIC file (from which U-Boot loads the kernel).

---
 scripts/runqemu | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
scripts/runqemu +4 -2
index 9c92eec030..0976273eb0 100755
@@ -1443,12 +1443,14 @@ class BaseConfig(object):
             kernel_opts = "-kernel %s -append '%s %s %s %s'" % (self.kernel, self.kernel_cmdline,
                                                                 self.kernel_cmdline_script, self.get('QB_KERNEL_CMDLINE_APPEND'),
                                                                 self.bootparams)
-            if self.bios:
-                kernel_opts += " -bios %s" % self.bios
             if self.dtb:
                 kernel_opts += " -dtb %s" % self.dtb
         else:
             kernel_opts = ""
+
+        if self.bios:
+            self.qemu_opt += " -bios %s" % self.bios
+
         cmd = "%s %s" % (self.qemu_opt, kernel_opts)
         cmds = shlex.split(cmd)
         logger.info('Running %s\n' % cmd)
Signature · 1 line
2.30.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 19 lines · Matthias Klein

This will allow the use of a bios (e.g. U-Boot) in combination with a WIC file (from which U-Boot loads the kernel).

---
 scripts/runqemu | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
scripts/runqemu +0 -2
index 9c92eec030..0976273eb0 100755
@@ -1443,12 +1443,14 @@ class BaseConfig(object):
             kernel_opts = "-kernel %s -append '%s %s %s %s'" % (self.kernel, self.kernel_cmdline,
                                                                 self.kernel_cmdline_script, self.get('QB_KERNEL_CMDLINE_APPEND'),
                                                                 self.bootparams)
-            if self.bios:
-                kernel_opts += " -bios %s" % self.bios
             if self.dtb:

scripts/runqemu class BaseConfig(object): · line 1456

Quoted 10 lines
scripts/runqemu +4 -0
                 kernel_opts += " -dtb %s" % self.dtb
         else:
             kernel_opts = ""
+
+        if self.bios:
+            self.qemu_opt += " -bios %s" % self.bios
+
         cmd = "%s %s" % (self.qemu_opt, kernel_opts)
         cmds = shlex.split(cmd)
         logger.info('Running %s\n' % cmd)

Thanks!

Signature · 3 lines
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com