From patchwork Fri Apr 3 14:04:24 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2087 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1775225153; bh=WEytO3NksblilTmjbUvaJQAE7p/WXxBhZAwPAWdXMFk=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=IfPRAxUH1PPQXifQMQVvjbCTFh2yuJwXHu69HaBassNykS6w+F2/gKG+rrs5BDp/h 2ZVxKcX5/DAmb8elZq7PXWvjUncHpPOfK6HTkXH74pC5/UopBSN9JLFwt+QQhYf6YS CJw5piWRZS2u4rCmeOnYdPNT7VBBZISOz7LFoZIvFje1jDqfmnDbvBfSzryazzqryG P4t9oQd0OlclUfoKHS0+DAw7t7tM4crL5MkmefAhhhFg5/m0w/JpTYo4bkV/Xxeuzs UK156G2NJMAzOVevn5QVpXWkIWk1vJJJVDcGep1vZi1zwh76H7lZmpKXxOhTxlge0C o50b3BDMd1I7A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1DC826A34E for ; Fri, 3 Apr 2026 08:05:53 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id WUvMXsPDwyxD for ; Fri, 3 Apr 2026 08:05:53 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1775225151; bh=WEytO3NksblilTmjbUvaJQAE7p/WXxBhZAwPAWdXMFk=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=i/uEINhbw0+7p6D0RWSS4gRg3LLo2p070COutkUmSQ9Ym+gNs1sxupDcfCwIde3pj Ild0+ppVaPk2f4fiU16wNinkRkCOVPWPjg8H2M66JbPFYnIktxKuLYvH+3Cd8kv3r7 sZ7gc8Cy6TmSJoPOstR3ZvbE51k+ilnF8xwupX6X81p0f4YIy7S9N3nRwPvgqIiS2e lHafHUO36GfQWH3lMEzchpYtA2/GcUteH8C7ZckhelJ5H+dmgp7Q6C0okc5xWk3vdx ZZ1oQ58zo2DRfqMnFrL3qbhz1wfPXbvJKix1RK2IKKRRRlRQ+NOcfggOfa+7pilky7 aJlsceSFv81NA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 989226A347 for ; Fri, 3 Apr 2026 08:05:51 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1775225148; bh=q/tvbT82iEHH3Nm8P5KQ0JM2FQx+oMGfLXrcyqWrn5Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D+fshww5IpwV+SWMTEV6Syb2Ad9NOMMquPWe9d3PWiH3OQ5drlKPOkI72KVv3LxRz mseQ1ZSnHerIJ3EY0yDYixMsHXcSIIK+VY9C0kSSRynIAe9Ivt+43jgulne3Nsdkka Y9YdSuORT+vCCHy3Vp6BDfiAiMPXhbyl9j5HqR7HZ/yUeJ88VGkvbit8uzS+WkZtJn 5lLfORnkL6InWguSZ1JldoVJXFEacDr1S+y9BDq3f59rYk4JIDC3JxcFj96aW7HbQT U1gw+vRWQnzsRlB6HaiJ0pfE1RCxewTzN+jyIG6lU1piW8pnFJFVMQvdK76vY5zfdJ 8VdC/wIQ7ojIQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AACCF6A34F; Fri, 3 Apr 2026 08:05:48 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id ZDJqcID68Gmy; Fri, 3 Apr 2026 08:05:48 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1775225148; bh=1BFE58sMWbSkD/Is8qsRe1r3wPLkAgRsTWONqotcEwc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZAjXPhg4Vtqxnd7RZt6v1zaJzT/hO6ym3Or/oEqIQljdt9b+xGyEbDD3Z8jgxmuFQ 6K+Xyai3M6N2Mw4/8EyD9adyyn1oZ8X058nSA/3pED24LNTy4MGIek1QkX8ritoKZy 9Kii+buHutMK8ZT2dq/PtAGME3w+lK5xGJmNVrOTB+G/XlPEaAU3GSkY3TIbwO+XEp qTP1g/ynI7uabU/CoCtW+sL1GmODeIdKlHRWUBWMEu3aQEn+JLoninMkXN1CpEgaMu 0KEEDLvwKMnReLaCOvZ5+g647KyE650pwynrooqVLfkepwdgOa5WcFkHf5HWM2lkOo cx/kWJvlXyPzw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E26916A347; Fri, 3 Apr 2026 08:05:47 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Fri, 3 Apr 2026 08:04:24 -0600 Message-ID: <20260403140523.1998228-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260403140523.1998228-1-sjg@u-boot.org> References: <20260403140523.1998228-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 4ZS6SEBYJYO6NDKFMRKFWU6TPZG55PLQ X-Message-ID-Hash: 4ZS6SEBYJYO6NDKFMRKFWU6TPZG55PLQ X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 02/34] sandbox: Rename the sandbox filesystem List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The name for this comes from the devicetree node. The 'fs' name is to generic, so rename it to 'hostfs'. Signed-off-by: Simon Glass --- arch/sandbox/dts/test.dts | 2 +- fs/sandbox/sandboxfs.c | 5 +++++ test/dm/fs.c | 6 +++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index 68e3d35a183..c49dcdf4a23 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -589,7 +589,7 @@ compatible = "denx,u-boot-devres-test"; }; - fs { + hostfs { compatible = "sandbox,fs"; }; diff --git a/fs/sandbox/sandboxfs.c b/fs/sandbox/sandboxfs.c index 5b8f4f50a8e..494af0d373a 100644 --- a/fs/sandbox/sandboxfs.c +++ b/fs/sandbox/sandboxfs.c @@ -179,10 +179,15 @@ int fs_write_sandbox(const char *filename, void *buf, loff_t offset, static int sandbox_fs_mount(struct udevice *dev) { struct fs_priv *uc_priv = dev_get_uclass_priv(dev); + struct fs_plat *plat = dev_get_uclass_plat(dev); if (uc_priv->mounted) return log_msg_ret("vfi", -EISCONN); + /* Reject block-device mounts - sandboxfs uses the host OS */ + if (plat->desc) + return log_msg_ret("vfb", -ENODEV); + uc_priv->mounted = true; return 0; diff --git a/test/dm/fs.c b/test/dm/fs.c index 31712617d09..6cb5f74db35 100644 --- a/test/dm/fs.c +++ b/test/dm/fs.c @@ -46,7 +46,7 @@ static int dm_test_fs_dir(struct unit_test_state *uts) ut_asserteq(-ENOENT, fs_lookup_dir(fsdev, "does-not-exit", &dir)); ut_assertok(fs_lookup_dir(fsdev, "", &dir)); ut_assertnonnull(dir); - ut_asserteq_str("fs.dir", dir->name); + ut_asserteq_str("hostfs.dir", dir->name); ut_assertok(dir_open(dir, &strm)); found = 0; @@ -81,12 +81,12 @@ static int dm_test_fs_file(struct unit_test_state *uts) ut_assertok(fs_lookup_dir(fsdev, "", &dir)); ut_assertnonnull(dir); - ut_asserteq_str("fs.dir", dir->name); + ut_asserteq_str("hostfs.dir", dir->name); /* check the start and end of the README, which perhaps won't change */ ut_assertok(dir_open_file(dir, "README", DIR_O_RDONLY, &fil)); ut_assertnonnull(fil); - ut_asserteq_str("fs.dir.file.1", fil->name); + ut_asserteq_str("hostfs.dir.file.1", fil->name); uc_priv = dev_get_uclass_priv(fil); ut_asserteq_str("README", uc_priv->leaf); ut_asserteq(0, uc_priv->pos);