mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH master] efi: loader: disk: don't install a file system on raw disks
@ 2026-11-03 14:30 Ahmad Fatoum
  0 siblings, 0 replies; only message in thread
From: Ahmad Fatoum @ 2026-11-03 14:30 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

From: Ahmad Fatoum <a.fatoum@barebox.org>

efi_fs_exists() matches the detected type of a cdev against the type of
every registered file system driver. Drivers not backed by a cdev, like
ramfs, devfs or tftp, leave their type at filetype_unknown, so every
disk with unrecognized content matches one of them.

Let's skip filetype_unknown like fs_detect() does, so raw disks only
export Block I/O.

Fixes: 3146c70b0f8b ("efi: loader: protocol: add Block IO support")
Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
 efi/loader/protocols/disk.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/efi/loader/protocols/disk.c b/efi/loader/protocols/disk.c
index 493be8c5aafe..d56c9116460d 100644
--- a/efi/loader/protocols/disk.c
+++ b/efi/loader/protocols/disk.c
@@ -163,7 +163,8 @@ static bool efi_fs_exists(struct cdev *cdev)
 	enum filetype filetype;
 	struct driver *drv;
 
-	if (cdev_detect_type(cdev, &filetype))
+	/* drivers not backed by a cdev, e.g. ramfs, have no type to match */
+	if (cdev_detect_type(cdev, &filetype) || filetype == filetype_unknown)
 		return false;
 
 	bus_for_each_driver(&fs_bus, drv) {
-- 
2.47.3




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-03 14:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-03 14:30 [PATCH master] efi: loader: disk: don't install a file system on raw disks Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox