From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 642064F86; Fri, 12 Dec 2025 21:55:00 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 8C5C34EED; Fri, 12 Dec 2025 21:54:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_MISSING,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 Received: from fhigh-a1-smtp.messagingengine.com (fhigh-a1-smtp.messagingengine.com [103.168.172.152]) by atuin.qyliss.net (Postfix) with ESMTPS id 084A54EEA for ; Fri, 12 Dec 2025 21:54:55 +0000 (UTC) Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfhigh.phl.internal (Postfix) with ESMTP id DA9881400248 for ; Fri, 12 Dec 2025 16:54:52 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Fri, 12 Dec 2025 16:54:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1765576492; x= 1765662892; bh=kbEOmZDdwEdwNd/4g3XrznM3GA0EBFh91J+30rJJFqk=; b=O 7xhyp8ursbrPvwh8YE75ByVDiQexH6gOsmHkDqQIP59JTAEm0440Hm+16W7sqY6Z qINhDxMX0bHaaaLTZCdC3R3Zscd4SS5CgUsU4fjBPcU29k3jNnlqucPo4y7RaC0W RAl91ArqQxt+b9H/tJg+9ZjI1afYWqjwgtTZY47bR1+qS4qi4gn18c5LdNWzuU5j ouM3I7h4C+VIuajPbKz4vIpsRkkgDMWJhO0fEKhV72HvXMVZInd0rdL4gagi7no0 DC8bYfEZob4g3vDE89cjMoofbFWO+AAyNf2DpXPXMSPvwbhxMP/mS6sSe+I2fUOj q5JvdBnj66YUs3GmbI4hQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1765576492; x=1765662892; bh=kbEOmZDdwEdwNd/4g3XrznM3GA0E BFh91J+30rJJFqk=; b=VIxIZ4JGzJy9LWtBEyrG1jwKxiEuLCWkXmIWkcZ4qhnP DECnwgCfB1vQBjBUXR3yeO/1DapkEJ+dfSQhHAMpW+cLLzy6cgFXhYPcfhD8y8Aw +ullu+H9Yj9fvyR6jLZBwlUh/fZLzXOYoYPA6ePLq67SJNZUtcADL5bDe/o2OHHN hU9ZR3Z4wwYTONUOyMddnGLoLLyGjPoJ1J3bxTaRdCk0QJxuAfQl32BW7J2odl10 IUDncG3clkZTEZPlBiT2IR062bKIdtkAbTL1nQMA8ABBdU8JihJK2RC2N2vKPEaQ Pd0+AVIo93KcY69vQ8UP8OrQafrC83YkfekSCWhYvA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvleefudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertd dtnecuhfhrohhmpeetlhihshhsrgcutfhoshhsuceohhhisegrlhihshhsrgdrihhsqeen ucggtffrrghtthgvrhhnpefgfedukedvleeileeludefveehgeelgfegvddujedvtdffue euveffheeljeekvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpehhihesrghlhihsshgrrdhishdpnhgspghrtghpthhtohepuddpmhhouggvpe hsmhhtphhouhhtpdhrtghpthhtohepuggvvhgvlhesshhpvggtthhruhhmqdhoshdrohhr gh X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Fri, 12 Dec 2025 16:54:52 -0500 (EST) Received: by fw12.qyliss.net (Postfix, from userid 1000) id EA19977E3F53; Fri, 12 Dec 2025 22:54:40 +0100 (CET) From: Alyssa Ross To: devel@spectrum-os.org Subject: [PATCH 2/2] img/app: move virtio-fs mountpoint to /host Date: Fri, 12 Dec 2025 22:54:15 +0100 Message-ID: <20251212215415.390812-2-hi@alyssa.is> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251212215415.390812-1-hi@alyssa.is> References: <20251212215415.390812-1-hi@alyssa.is> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: KLHCZBAO7MIIXL7E7QYELTMJ5EAWHVFF X-Message-ID-Hash: KLHCZBAO7MIIXL7E7QYELTMJ5EAWHVFF X-MailFrom: hi@alyssa.is X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-devel.spectrum-os.org-0; header-match-devel.spectrum-os.org-1; header-match-devel.spectrum-os.org-2; header-match-devel.spectrum-os.org-3; header-match-devel.spectrum-os.org-4; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: It doesn't really make sense for this to be under /run, and "virtiofs0" is not a very descriptive name, especially now that it's no longer used on the host side. Signed-off-by: Alyssa Ross --- Documentation/using-spectrum/vm-file-access.adoc | 8 ++++---- .../image/etc/vm-sysupdate.d/50-verity.transfer | 2 +- .../image/etc/vm-sysupdate.d/60-root.transfer | 2 +- .../image/etc/vm-sysupdate.d/70-kernel.transfer | 2 +- img/app/Makefile | 2 +- .../image/etc/flatpak/installations.d/extra.conf | 2 +- img/app/image/etc/mdev/virtiofs | 8 ++------ img/app/image/etc/s6-rc/app/run | 16 ++++++++-------- tools/default.nix | 2 +- vm/app/systemd-sysupdate/download-update | 6 +++--- 10 files changed, 23 insertions(+), 27 deletions(-) diff --git a/Documentation/using-spectrum/vm-file-access.adoc b/Documentation/using-spectrum/vm-file-access.adoc index 1b4fe9a5..a76272f1 100644 --- a/Documentation/using-spectrum/vm-file-access.adoc +++ b/Documentation/using-spectrum/vm-file-access.adoc @@ -37,10 +37,10 @@ the portal. When using an application that doesn't implement the File Chooser API, you can still give it access to files manually. Each VM has xref:creating-custom-vms.adoc#filesystem[access] to the -/run/vm/by-id/_VM ID_/fs directory on the host (mounted at -/run/virtiofs/virtiofs0 in the default Spectrum VM image). For the -VM, this directory is read-only, but writeable files and directories -can be bind-mounted into it: +/run/vm/by-id/_VM ID_/fs directory on the host (mounted at /host in +the default Spectrum VM image). For the VM, this directory is +read-only, but writeable files and directories can be bind-mounted +into it: [example] ==== diff --git a/host/rootfs/image/etc/vm-sysupdate.d/50-verity.transfer b/host/rootfs/image/etc/vm-sysupdate.d/50-verity.transfer index ab4997c8..8c764fbd 100644 --- a/host/rootfs/image/etc/vm-sysupdate.d/50-verity.transfer +++ b/host/rootfs/image/etc/vm-sysupdate.d/50-verity.transfer @@ -13,6 +13,6 @@ MatchPattern=Spectrum_@v_@u.verity [Target] Type=regular-file -Path=/run/virtiofs/virtiofs0/updates +Path=/host/updates MatchPattern=Spectrum_@v_@u.verity Mode=0644 diff --git a/host/rootfs/image/etc/vm-sysupdate.d/60-root.transfer b/host/rootfs/image/etc/vm-sysupdate.d/60-root.transfer index 8a317568..93af34ac 100644 --- a/host/rootfs/image/etc/vm-sysupdate.d/60-root.transfer +++ b/host/rootfs/image/etc/vm-sysupdate.d/60-root.transfer @@ -13,6 +13,6 @@ MatchPattern=Spectrum_@v_@u.root [Target] Type=regular-file -Path=/run/virtiofs/virtiofs0/updates +Path=/host/updates MatchPattern=Spectrum_@v_@u.root Mode=0644 diff --git a/host/rootfs/image/etc/vm-sysupdate.d/70-kernel.transfer b/host/rootfs/image/etc/vm-sysupdate.d/70-kernel.transfer index cb181239..90d26874 100644 --- a/host/rootfs/image/etc/vm-sysupdate.d/70-kernel.transfer +++ b/host/rootfs/image/etc/vm-sysupdate.d/70-kernel.transfer @@ -13,6 +13,6 @@ MatchPattern=Spectrum_@v.efi [Target] Type=regular-file -Path=/run/virtiofs/virtiofs0/updates +Path=/host/updates MatchPattern=Spectrum_@v.efi Mode=0644 diff --git a/img/app/Makefile b/img/app/Makefile index 69c85bba..7e3d05b2 100644 --- a/img/app/Makefile +++ b/img/app/Makefile @@ -30,7 +30,7 @@ $(imgdir)/appvm/blk/root.img: ../../scripts/make-gpt.sh ../../scripts/sfdisk-fie build/rootfs.erofs:root:5460386f-2203-4911-8694-91400125c604:root mv $@.tmp $@ -DIRS = dev home/user run mnt proc sys tmp \ +DIRS = dev home/user host run mnt proc sys tmp \ etc/s6-linux-init/run-image/pipewire \ etc/s6-linux-init/run-image/service \ etc/s6-linux-init/run-image/user \ diff --git a/img/app/image/etc/flatpak/installations.d/extra.conf b/img/app/image/etc/flatpak/installations.d/extra.conf index 448902b4..4b3bd5e6 100644 --- a/img/app/image/etc/flatpak/installations.d/extra.conf +++ b/img/app/image/etc/flatpak/installations.d/extra.conf @@ -2,4 +2,4 @@ # SPDX-FileCopyrightText: 2025 Alyssa Ross [Installation "virtiofs"] -Path=/run/virtiofs/virtiofs0/config/flatpak +Path=/host/config/flatpak diff --git a/img/app/image/etc/mdev/virtiofs b/img/app/image/etc/mdev/virtiofs index bda77483..a0b9dd7d 100755 --- a/img/app/image/etc/mdev/virtiofs +++ b/img/app/image/etc/mdev/virtiofs @@ -3,10 +3,6 @@ # SPDX-FileCopyrightText: 2022-2023 Alyssa Ross background { - # There's currently no kernel mechanism to let us enumerate available - # virtiofs filesystems, so we only supported a single, hardcoded - # filesystem tag for now. - if { mkdir -p /run/virtiofs/virtiofs0 } - if { mount -t virtiofs -o nodev host /run/virtiofs/virtiofs0 } - /etc/mdev/listen virtiofs0 + if { mount -t virtiofs -o nodev host /host } + /etc/mdev/listen virtiofs-host } diff --git a/img/app/image/etc/s6-rc/app/run b/img/app/image/etc/s6-rc/app/run index 997897de..f91877d4 100755 --- a/img/app/image/etc/s6-rc/app/run +++ b/img/app/image/etc/s6-rc/app/run @@ -7,27 +7,27 @@ export TMPDIR /run export HOME /home/user cd /home/user -if { /etc/mdev/wait virtiofs0 } +if { /etc/mdev/wait virtiofs-host } foreground { - redirfd -r 0 /run/virtiofs/virtiofs0/config/type + redirfd -r 0 /host/config/type withstdinas -E type case $type { appimage { if { modprobe loop } if { - backtick -E offset { /run/virtiofs/virtiofs0/config/run --appimage-offset } - mount -o offset=${offset},nodev /run/virtiofs/virtiofs0/config/run /mnt + backtick -E offset { /host/config/run --appimage-offset } + mount -o offset=${offset},nodev /host/config/run /mnt } s6-setuidgid user - export APPIMAGE /run/virtiofs/virtiofs0/config/run + export APPIMAGE /host/config/run export APPDIR /mnt export ARGV0 /mnt/AppRun export LD_LIBRARY_PATH /lib64 /mnt/AppRun } flatpak { - s6-envdir -fnL /run/virtiofs/virtiofs0/config/params + s6-envdir -fnL /host/config/params s6-setuidgid user multisubstitute { importas -iu id id @@ -42,12 +42,12 @@ foreground { nix { if { mount -t overlay - -o ro,nosuid,nodev,lowerdir=/nix/store:/run/virtiofs/virtiofs0/config/nix/store + -o ro,nosuid,nodev,lowerdir=/nix/store:/host/config/nix/store store /nix/store } s6-setuidgid user - /run/virtiofs/virtiofs0/config/run + /host/config/run } } fdmove -c 1 2 diff --git a/tools/default.nix b/tools/default.nix index da82f075..56f41cd9 100644 --- a/tools/default.nix +++ b/tools/default.nix @@ -101,7 +101,7 @@ stdenv.mkDerivation (finalAttrs: { (lib.mesonBool "app" appSupport) (lib.mesonBool "host" hostSupport) (lib.mesonBool "driver" driverSupport) - "-Dhostfsrootdir=/run/virtiofs/virtiofs0" + "-Dhostfsrootdir=/host" "-Dtests=false" "-Dunwind=false" "-Dwerror=true" diff --git a/vm/app/systemd-sysupdate/download-update b/vm/app/systemd-sysupdate/download-update index 40fde88d..b76c9deb 100755 --- a/vm/app/systemd-sysupdate/download-update +++ b/vm/app/systemd-sysupdate/download-update @@ -5,7 +5,7 @@ export LC_ALL C export LANGUAGE C unshare -mr -if { mount -toverlay -o nosuid,nodev,noexec,nosymfollow,lowerdir=/run/virtiofs/virtiofs0/etc:/etc -- overlay /etc } +if { mount -toverlay -o nosuid,nodev,noexec,nosymfollow,lowerdir=/host/etc:/etc -- overlay /etc } backtick tmpdir { mktemp -d /tmp/sysupdate-XXXXXX } # Not a useless use of cat: if there are NUL bytes in the URL # busybox's awk might misbehave. @@ -70,6 +70,6 @@ if { # they cause globbing in the curl command-line tool by default. Use --globoff # to disable this feature. if { $CURL_PATH -L --proto-redir =http,https --globoff - -o /run/virtiofs/virtiofs0/updates/SHA256SUMS -- ${update_url}/SHA256SUMS } + -o /host/updates/SHA256SUMS -- ${update_url}/SHA256SUMS } $CURL_PATH -L --proto-redir =http,https --globoff - -o /run/virtiofs/virtiofs0/updates/SHA256SUMS.sha256.asc -- ${update_url}/SHA256SUMS.sha256.asc + -o /host/updates/SHA256SUMS.sha256.asc -- ${update_url}/SHA256SUMS.sha256.asc -- 2.51.0