[Concept,08/11] scripts: build-efi: Support spice integration

Message ID 20251023094308.3406453-9-sjg@u-boot.org
State New
Headers
Series Bootstage and script enhancements |

Commit Message

Simon Glass Oct. 23, 2025, 9:42 a.m. UTC
  From: Simon Glass <sjg@chromium.org>

Add a -c/--spice flag to enable spice, so that copy/paste works between
the guest and host.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 scripts/build-efi | 8 ++++++++
 1 file changed, 8 insertions(+)
  

Patch

diff --git a/scripts/build-efi b/scripts/build-efi
index fffe699e80a..359f8ff4052 100755
--- a/scripts/build-efi
+++ b/scripts/build-efi
@@ -47,6 +47,8 @@  def parse_args():
                         help='Package up the payload instead of the app')
     parser.add_argument('-P', '--partition', action='store_true',
                         help='Create a partition table')
+    parser.add_argument('-c', '--spice', action='store_true',
+                        help='Enable SPICE for clipboard sharing')
     parser.add_argument('-v', '--verbose', action='store_true',
                         help='Show executed commands')
 
@@ -115,6 +117,12 @@  class BuildEfi:
             else:  # x86
                 extra += ['-device', 'qemu-xhci', '-device', 'usb-kbd',
                           '-device', 'usb-mouse']
+
+            # This uses QEMU's GTK clipboard integration with SPICE vdagent
+            if self.args.spice:
+                extra += ['-device', 'virtio-serial-pci']
+                extra += ['-chardev', 'qemu-vdagent,id=spicechannel0,name=vdagent,clipboard=on']
+                extra += ['-device', 'virtserialport,chardev=spicechannel0,name=com.redhat.spice.0']
             extra += ['-serial', 'mon:stdio']
             serial_msg = ''
         if self.args.kvm: