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 B4EA9C8A7; Sun, 14 Dec 2025 01:47:53 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id D9BB8C926; Sun, 14 Dec 2025 01:47:49 +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 16D14C925 for ; Sun, 14 Dec 2025 01:47:49 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfhigh.phl.internal (Postfix) with ESMTP id CFA7D14000A1; Sat, 13 Dec 2025 20:47:46 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Sat, 13 Dec 2025 20:47:46 -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=1765676866; x= 1765763266; bh=iT351EcPV33ssymwH7YF9yNA36Pv1IBit18cctBb6aE=; b=O s/aDcsKLlrKpzb67WA0Xewdp9p/hcqgdK5qwNJHnpoNvqCqz88eOeeai07654PvQ ynsvYrET9DrNk1gL8cUcXqGCgGQmfr6L2Mi536rOY54qMSj/zL3bK9e26bqKmVQw DX9AqVbcnO4RiIMSrkiPDHrAA2mqg3ap4J8iUMi1XTML2mwMjtjDPQU/DtNYmXAo vC6vpZYChCmGdyUVTAFCW4QaE4PgozZ0HfZQLPEolLuEyffV2QYhivmQ3IXfXmbi aOWuXYcojvmPo6CJRVylOKev8mMqGYbB/PXCEi+b7WuWRlgG+bRPyMZXpXE36yVV ypJ+2m6KXiw7yCQkMK+6Q== 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=1765676866; x=1765763266; bh=i T351EcPV33ssymwH7YF9yNA36Pv1IBit18cctBb6aE=; b=VN7yrPZRt7g4DCWVp MLylkP8NwYRWpD5kFAbrU1jXRI9158QSj4vZeiPkuOKypPiojpU2zkjIluSvYjwR iTZxyYaHGv4fc/VPd42TKEUnUkyEpUlmQPFw8EQMLOK8MyDSHbEjdGHwSPO8j/Sl 0yXA038l4cXDW+4Uo19gWWTUJMtiK88cr/k4WiCH7ZmwtGH95N/12K8yW+/br9Vc FjWENgE21ab+aOszH6AAtvFUH+MHRJGJf5Va+ztYn7bGBCCDQAmS+C2qIxKJiNiI 0orFkU3Xq2J3GA5WzUyJxfguW4rnbLowx/YSO8MtO3RkFMVxrGg5kQJoiwHmGdoe k1RkQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdefvdeihecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeetlhihshhsrgcu tfhoshhsuceohhhisegrlhihshhsrgdrihhsqeenucggtffrrghtthgvrhhnpeethfegie ffffelteduueeltdelueethfeuteevieetuefggeefuddvlefgtdefvdenucffohhmrghi nhepshhpvggtthhruhhmqdhoshdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehhihesrghlhihsshgrrdhishdpnhgspghrtghpthht ohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepuggvmhhiohgsvghnohhurh esghhmrghilhdrtghomhdprhgtphhtthhopeguvghvvghlsehsphgvtghtrhhumhdqohhs rdhorhhg X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 13 Dec 2025 20:47:46 -0500 (EST) Received: by fw12.qyliss.net (Postfix, from userid 1000) id 5BD6B7BF7218; Sun, 14 Dec 2025 02:47:44 +0100 (CET) From: Alyssa Ross To: devel@spectrum-os.org Subject: [PATCH v2 4/7] host/rootfs: clean up obsolete tmp dirs on mount Date: Sun, 14 Dec 2025 02:42:30 +0100 Message-ID: <20251214014229.775825-8-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: B3GY4E66WRRTEAWWWZRVYEIMUK5UB55O X-Message-ID-Hash: B3GY4E66WRRTEAWWWZRVYEIMUK5UB55O 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: In the ideal case, these will be cleaned up when the VM running them exits, but there's always the possibility that there are some left over, in which case mount time is the perfect time to clean up, when we can be reasonably sure nothing else is still accessing them. Signed-off-by: Alyssa Ross --- v2: no change, but thanks to rebase no longer fails to exit after outputting error message as identified last time. v1: https://spectrum-os.org/lists/archives/spectrum-devel/20251213161637.510752-4-hi@alyssa.is/ host/rootfs/image/usr/bin/mount-userdata | 42 ++++++++++++++++-------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/host/rootfs/image/usr/bin/mount-userdata b/host/rootfs/image/usr/bin/mount-userdata index 71f12c55..4b9dc8a1 100755 --- a/host/rootfs/image/usr/bin/mount-userdata +++ b/host/rootfs/image/usr/bin/mount-userdata @@ -7,21 +7,35 @@ backtick -D "" uuid { blkid -o value -s UUID -- $1 } -multisubstitute { - importas -Siu 0 - importas -Siu 1 - importas -Siu uuid -} - -case $uuid { - "" { - if { - fdmove -c 1 2 - printf "%s: '%s' does not have a UUID\n" $0 $1 - } - exit 1 +if { + multisubstitute { + importas -Siu 0 + importas -Siu 1 + importas -Siu uuid } + + case $uuid { + "" { + if { + fdmove -c 1 2 + printf "%s: '%s' does not have a UUID\n" $0 $1 + } + exit 1 + } + } + + mount -m -t btrfs -o nosuid,nodev,noexec,nosymfollow -- $1 /media/${uuid} +} + +importas -Siu uuid + +foreground { + if -t { test -d /media/${uuid}/Spectrum/data/spectrum/storage } + find /media/${uuid}/Spectrum/data/spectrum/storage + -mindepth 1 + -maxdepth 1 + -name tmp.* + -exec rm -rf -- {} ; } -if { mount -m -t btrfs -o nosuid,nodev,noexec,nosymfollow -- $1 /media/${uuid} } printf "%s\n" /media/${uuid} -- 2.51.0