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 51AF7C8E8; Sun, 14 Dec 2025 01:48:15 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id C4456C95C; Sun, 14 Dec 2025 01:48:09 +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-a2-smtp.messagingengine.com (fhigh-a2-smtp.messagingengine.com [103.168.172.153]) by atuin.qyliss.net (Postfix) with ESMTPS id 9F75DC955 for ; Sun, 14 Dec 2025 01:48:08 +0000 (UTC) Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfhigh.phl.internal (Postfix) with ESMTP id 74B7514000A1; Sat, 13 Dec 2025 20:48:06 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Sat, 13 Dec 2025 20:48:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :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=1765676886; x= 1765763286; bh=cWywdWQZiyo5PibxADBaH1rxCeNDhpowPuQzcwFgIAo=; b=K 4EUyDYsvO42ryCt+CbKgTBPzmLLBU0K/0lYW1uAhqQ1cZs28imPBVrX0yjzKdMsl G3IylL+iEX25zVr6GOj949I3Mj8DAeasDfFlGCs9BWTkN9EmAEForzcwFhoYSi1v z9POTY9Qwxe25kCmTwKWu3H/FUUrO9X1uWjWBN+K/56zXZ35TohaJmI0yC3clPTS 2itvEIlS+tbLHvm7R4GWpHFBdH05TIKWdyDV+a73ZsNeU958nRZW/aCvHwjwodQO f1umbmGXT+6jeqbe9I1iyeuynZin3EYkuU9AxppikIGDslFaysCFMkIK9MbcUkCk ugCp+CW57BOE9OtUB5qXA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=1765676886; x=1765763286; bh=c WywdWQZiyo5PibxADBaH1rxCeNDhpowPuQzcwFgIAo=; b=NYAtzUgP4wXHHjylE JKrA26r0F+YZCk/UfVuuRLBD0AuoLZGw3CQ8N57SYWVEA70hkkGa6zgpDjX9NhN6 Vejz0pKkYp1qEQCj5n4Vvi25RXl23/aHRgdqXYsB2nsPVksBDaRqXtZjEjjowCBe jn1g4uJ2oT1bJ7zRLcYUqj3YOBIkQvzaOlznJc6CcJy05FhSLj2Q2saevs3BkhXn JZKsrhPyVkUcIYe1OcoBjP1qEcKJIXIjqlHNgwPbws4A2XMKSmnf6+L8nlQaTuZE JROcZL2rApDMfrLFjj+XNYM/oYyKbfbLHT8eeTFJJbmiC/Ilk9Er8cAiUYCkv6ok wTcrA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdefvdeiiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeetlhihshhsrgcu tfhoshhsuceohhhisegrlhihshhsrgdrihhsqeenucggtffrrghtthgvrhhnpeegueeiud eukeekiedvteffgeekudfhudevvdelvdekhfefieetkeduudejffefgeenucevlhhushht vghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehhihesrghlhihsshgrrd hishdpnhgspghrtghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohep uggvmhhiohgsvghnohhurhesghhmrghilhdrtghomhdprhgtphhtthhopeguvghvvghlse hsphgvtghtrhhumhdqohhsrdhorhhg X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 13 Dec 2025 20:48:06 -0500 (EST) Received: by fw12.qyliss.net (Postfix, from userid 1000) id 7C74E7BF7220; Sun, 14 Dec 2025 02:48:04 +0100 (CET) From: Alyssa Ross To: devel@spectrum-os.org Subject: [PATCH v2 6/7] host/rootfs: run transient VMs with persistence Date: Sun, 14 Dec 2025 02:42:34 +0100 Message-ID: <20251214014229.775825-12-hi@alyssa.is> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251214014229.775825-2-hi@alyssa.is> References: <20251214014229.775825-2-hi@alyssa.is> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: L2QGXZKWLRIZCJ55XRED45TLLLQPRFSF X-Message-ID-Hash: L2QGXZKWLRIZCJ55XRED45TLLLQPRFSF 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 CC: Demi Marie Obenour 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: This allows run-appimage and run-flatpak to be given the name of a previously saved persistent directory. Further writes by the application to that directory will also be persisted. Signed-off-by: Alyssa Ross --- v2: new this round host/rootfs/image/usr/bin/run-appimage | 16 +++++++++++++--- host/rootfs/image/usr/bin/run-flatpak | 15 +++++++++++++-- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/host/rootfs/image/usr/bin/run-appimage b/host/rootfs/image/usr/bin/run-appimage index de851c52..24621065 100755 --- a/host/rootfs/image/usr/bin/run-appimage +++ b/host/rootfs/image/usr/bin/run-appimage @@ -26,13 +26,23 @@ if { } backtick diskdir { - s6-setuidgid fs - - backtick -E mountpoint { + backtick mountpoint { importas -Siu 1 findmnt -no TARGET -T $1 } + if -tn { + redirfd -w 2 /dev/null + multisubstitute { + importas -Siu mountpoint + importas -Siu 2 + } + printf "%s/Spectrum/data/spectrum/storage/persist.%s\n" $mountpoint $2 + } + + s6-setuidgid fs + + importas -Siu mountpoint if { mkdir -p -- ${mountpoint}/Spectrum/data/spectrum/storage } mktemp -d -- ${mountpoint}/Spectrum/data/spectrum/storage/tmp.XXXXXX } diff --git a/host/rootfs/image/usr/bin/run-flatpak b/host/rootfs/image/usr/bin/run-flatpak index b47204c9..4123d329 100755 --- a/host/rootfs/image/usr/bin/run-flatpak +++ b/host/rootfs/image/usr/bin/run-flatpak @@ -26,6 +26,15 @@ if { } backtick diskdir { + if -tn { + redirfd -w 2 /dev/null + multisubstitute { + importas -Siu 1 + importas -Siu 4 + } + printf "%s/Spectrum/data/spectrum/storage/persist.%s\n" $1 $4 + } + s6-setuidgid fs importas -Siu 1 @@ -41,7 +50,9 @@ if { multisubstitute { importas -Siu id importas -Siu diskdir - elgetpositionals + importas -Siu 1 + importas -Siu 2 + importas -Siu 3 } nsenter --preserve-credentials -S0 @@ -50,7 +61,7 @@ if { cd /run/fs/${id}/config if { redirfd -w 1 type echo flatpak } - if { mount-flatpak $@ } + if { mount-flatpak $1 $2 $3 } mount --bind -- $diskdir /run/fs/${id}/disk } -- 2.51.0