blockdev-list,repart: optionally hide zero-size block devices

Block devices with removable media (e.g. SD card readers) indicate a
missing medium with a zero size. Optionally ignore such block devices
that carry no medium currently.
This commit is contained in:
Lennart Poettering
2025-09-23 09:25:11 +02:00
parent ed90a0cdc9
commit ba793df4b9
4 changed files with 27 additions and 12 deletions
+1
View File
@@ -9,6 +9,7 @@ typedef enum BlockDevListFlags {
BLOCKDEV_LIST_IGNORE_ZRAM = 1 << 2, /* Ignore ZRAM */
BLOCKDEV_LIST_REQUIRE_LUKS = 1 << 3, /* Only consider block devices with LUKS superblocks */
BLOCKDEV_LIST_IGNORE_ROOT = 1 << 4, /* Ignore the block device we are currently booted from */
BLOCKDEV_LIST_IGNORE_EMPTY = 1 << 5, /* Ignore disks of zero size (usually drives without a medium) */
} BlockDevListFlags;
typedef struct BlockDevice {