diff mbox series

runqemu: parse QB_GRAPHICS for nographic flag

Message ID 20260131211111.1189479-1-charles.embedded@gmail.com
State New
Headers show
Series runqemu: parse QB_GRAPHICS for nographic flag | expand

Commit Message

charles.embedded@gmail.com Jan. 31, 2026, 9:11 p.m. UTC
From: Charles Dias <charlesdias.cd@outlook.com>

The setup_vga() function was ignoring -nographic in QB_GRAPHICS
because it only checked the command-line self.nographic flag.
This caused QB_GRAPHICS to be appended after display autodetection,
resulting in conflicting options like "-device virtio-vga -display sdl"
and "-nographic" in the same command.

Add a check after reading qemuboot.conf to detect -nographic in
QB_GRAPHICS and set self.nographic accordingly. This prevents
unnecessary display autodetection for BSPs that specify -nographic
in their machine configuration, as happens in meta-zephyr layer.

Signed-off-by: Charles Dias <charlesdias.cd@outlook.com>
---
 scripts/runqemu | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/scripts/runqemu b/scripts/runqemu
index 32a3d6296a..b791abfda3 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -986,6 +986,12 @@  to your build configuration.
                 v = os.path.dirname(self.qemuboot)
             self.set(k_upper, v)
 
+        # Parse QB_GRAPHICS to set internal flags if not already set by command-line
+        if not self.nographic and self.get('QB_GRAPHICS'):
+            if '-nographic' in self.get('QB_GRAPHICS'):
+                logger.debug('Detected -nographic in QB_GRAPHICS, setting nographic mode')
+                self.nographic = True
+
     def validate_paths(self):
         """Ensure all relevant path variables are set"""
         # When we're started with a *.qemuboot.conf arg assume that image