patches and low-level development discussion
 help / color / mirror / code / Atom feed
From: Alyssa Ross <alyssa.ross@unikie.com>
To: devel@spectrum-os.org
Cc: Puck Meerburg <puck@puckipedia.com>,
	Ville Ilvonen <ville.ilvonen@unikie.com>
Subject: [RFC PATCH v2 09/10] vm/app: add hello-wayland demo VM
Date: Fri, 30 Sep 2022 21:35:32 +0000	[thread overview]
Message-ID: <20220930213533.1710618-10-alyssa.ross@unikie.com> (raw)
In-Reply-To: <20220930213533.1710618-1-alyssa.ross@unikie.com>

hello-wayland is the simplest possible Wayland client.  This VM is
used to demonstrate Spectrum's new Wayland capabilities.

Signed-off-by: Alyssa Ross <alyssa.ross@unikie.com>
---
 host/initramfs/extfs.nix |  3 +++
 vm/app/hello-wayland.nix | 25 +++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 vm/app/hello-wayland.nix

diff --git a/host/initramfs/extfs.nix b/host/initramfs/extfs.nix
index bfaaf17..3c4ac1c 100644
--- a/host/initramfs/extfs.nix
+++ b/host/initramfs/extfs.nix
@@ -10,6 +10,7 @@ let
   };
 
   appvm-catgirl = import ../../vm/app/catgirl.nix { inherit config; };
+  appvm-hello-wayland = import ../../vm/app/hello-wayland.nix { inherit config; };
   appvm-lynx = import ../../vm/app/lynx.nix { inherit config; };
 in
 
@@ -22,6 +23,8 @@ runCommand "ext.ext4" {
   chmod +w svc/data
   tar -C ${appvm-catgirl} -c data | tar -C svc -x
   chmod +w svc/data
+  tar -C ${appvm-hello-wayland} -c data | tar -C svc -x
+  chmod +w svc/data
   tar -C ${appvm-lynx} -c data | tar -C svc -x
 
   tar -cf ext.tar svc
diff --git a/vm/app/hello-wayland.nix b/vm/app/hello-wayland.nix
new file mode 100644
index 0000000..410220d
--- /dev/null
+++ b/vm/app/hello-wayland.nix
@@ -0,0 +1,25 @@
+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2022 Unikie
+
+{ config ? import ../../../nix/eval-config.nix {} }:
+
+import ../../vm-lib/make-vm.nix { inherit config; } {
+  name = "appvm-hello-wayland";
+  wayland = true;
+  run = config.pkgs.callPackage (
+    { writeScript, hello-wayland, wayland-proxy-virtwl }:
+    writeScript "run-hello-wayland" ''
+      #!/bin/execlineb -P
+      if { modprobe virtio-gpu }
+      foreground { ln -ns /run/ext /run/opengl-driver }
+      foreground { mkdir /run/user }
+      foreground {
+        umask 077
+        mkdir /run/user/0
+      }
+      export XDG_RUNTIME_DIR /run/user/0
+      ${wayland-proxy-virtwl}/bin/wayland-proxy-virtwl --virtio-gpu
+      ${hello-wayland}/bin/hello-wayland
+    ''
+  ) { };
+}
-- 
2.37.1



  parent reply	other threads:[~2022-09-30 21:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-30 21:35 [RFC PATCH v2 00/10] Initial support for VM Wayland Alyssa Ross
2022-09-30 21:35 ` [RFC PATCH v2 01/10] host/start-vm: use MAP_SHARED memory for VMs Alyssa Ross
2022-09-30 21:35 ` [RFC PATCH v2 02/10] img/app: don't block app startup on network online Alyssa Ross
2022-09-30 21:35 ` [RFC PATCH v2 03/10] img/app: add Wayland over virtio-gpu support to kernel Alyssa Ross
2022-09-30 21:35 ` [RFC PATCH v2 04/10] vm-lib: add mesa drivers to VM Alyssa Ross
2022-09-30 21:35 ` [RFC PATCH v2 05/10] img/app: add support for testing virtio-gpu Alyssa Ross
2022-09-30 21:35 ` [RFC PATCH v2 06/10] img/app: add support for testing in crosvm Alyssa Ross
2022-09-30 21:35 ` [RFC PATCH v2 07/10] host/start-vm: factor out VM definition path Alyssa Ross
2022-09-30 21:35 ` [RFC PATCH v2 08/10] host: add support for Wayland in VMs Alyssa Ross
2022-09-30 21:35 ` Alyssa Ross [this message]
2022-09-30 21:38 ` [RFC PATCH v2 10/10] host/start-vm: disable cloud-hypervisor sandbox Alyssa Ross
2022-09-30 21:44   ` Alyssa Ross

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=20220930213533.1710618-10-alyssa.ross@unikie.com \
    --to=alyssa.ross@unikie.com \
    --cc=devel@spectrum-os.org \
    --cc=puck@puckipedia.com \
    --cc=ville.ilvonen@unikie.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.
Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).