From c31518201c56725548fc16a742a0f87afb1fc1f2 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Sat, 26 Apr 2025 11:59:36 -0400 Subject: [PATCH] disk: In "superfloppy" mode, create a fake partition entry We normally create a table of the partition sizes/types present on a drive. Howeever, if the drive is set up as a "superfloppy", where there is no partition table and a single filesystem starting at sector 0, this "pinfo" table is not populated. So now, populate the pinfo table with a single entry that matches the filesystem type, start, and size. Change-Id: Ifa8760909109d67ff96481b1fc7f26c64280a00a --- firmware/common/disk.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/firmware/common/disk.c b/firmware/common/disk.c index d409c68ee1..8aefa66750 100644 --- a/firmware/common/disk.c +++ b/firmware/common/disk.c @@ -396,6 +396,13 @@ int disk_mount(int drive) mounted = 1; init_volume(&volumes[volume], drive, 0); volume_onmount_internal(IF_MV(volume)); + + struct storage_info info; + storage_get_info(drive, &info); + + pinfo[0].type = PARTITION_TYPE_FAT32_LBA; + pinfo[0].start = 0; + pinfo[0].size = info.num_sectors; } if (mounted == 0 && volume != -1) /* not a "superfloppy"? */