Disk (Linux): revisits 78c6d71049

This commit is contained in:
李通洲
2025-10-11 18:20:56 +08:00
parent 78c6d71049
commit 1631f74700
3 changed files with 7 additions and 8 deletions
+2
View File
@@ -13,6 +13,8 @@ Features:
* Adds basic support for Wine (Windows)
* Adds basic support for hppa and sh architectures (CPU, Linux)
* Improves T-Head SoC name detection from the device tree (#1997, CPU, Linux)
* `Disk.hideFolders` now supports glob patterns (Disk)
* For example, `/boot/*` will match both `/boot/efi` and `/boot/firmware`
Bugfixes:
* Avoids integer overflow when calculating swap size (#1988, Swap, Windows)
+2 -2
View File
@@ -2326,7 +2326,7 @@
]
},
"hideFolders": {
"description": "A list of folder paths to hide from the disk output",
"description": "A list of folder paths (or glob patterns) to hide from the disk output",
"oneOf": [
{
"type": "string",
@@ -2342,7 +2342,7 @@
"uniqueItems": true
}
],
"default": "/efi:/boot:/boot/efi:/boot/firmware"
"default": "/efi:/boot:/boot/*"
},
"hideFS": {
"description": "A list of file systems to hide from the disk output",
+3 -6
View File
@@ -230,11 +230,8 @@ bool ffPrintDisk(FFDiskOptions* options)
if(__builtin_expect(options->folders.length == 0, 1) && (disk->type & ~options->showTypes))
continue;
if (options->hideFolders.length)
{
if (isMatchFolders(&options->hideFolders, &disk->mountpoint, FF_DISK_FOLDER_SEPARATOR))
continue;
}
if (options->hideFolders.length && isMatchFolders(&options->hideFolders, &disk->mountpoint, FF_DISK_FOLDER_SEPARATOR))
continue;
if (options->hideFS.length && ffStrbufSeparatedContain(&options->hideFS, &disk->filesystem, ':'))
continue;
@@ -482,7 +479,7 @@ void ffInitDiskOptions(FFDiskOptions* options)
#if _WIN32 || __APPLE__ || __ANDROID__
ffStrbufInit(&options->hideFolders);
#else
ffStrbufInitS(&options->hideFolders, "/efi:/boot:/boot/efi:/boot/firmware");
ffStrbufInitS(&options->hideFolders, "/efi:/boot:/boot/*");
#endif
ffStrbufInit(&options->hideFS);
options->showTypes = FF_DISK_VOLUME_TYPE_REGULAR_BIT | FF_DISK_VOLUME_TYPE_EXTERNAL_BIT | FF_DISK_VOLUME_TYPE_READONLY_BIT;