mirror of
https://github.com/edera-dev/sprout.git
synced 2025-12-19 18:40:18 +00:00
fix(filesystem-device-match): bail early if no criteria is provided
This commit is contained in:
@@ -88,6 +88,15 @@ pub fn extract(
|
|||||||
context: Rc<SproutContext>,
|
context: Rc<SproutContext>,
|
||||||
extractor: &FilesystemDeviceMatchExtractor,
|
extractor: &FilesystemDeviceMatchExtractor,
|
||||||
) -> Result<String> {
|
) -> Result<String> {
|
||||||
|
// If no criteria are provided, bail with an error.
|
||||||
|
if extractor.has_label.is_none()
|
||||||
|
&& extractor.has_item.is_none()
|
||||||
|
&& extractor.has_partition_uuid.is_none()
|
||||||
|
&& extractor.has_partition_type_uuid.is_none()
|
||||||
|
{
|
||||||
|
bail!("at least one criteria is required for filesystem-device-match");
|
||||||
|
}
|
||||||
|
|
||||||
// Find all the filesystems inside the UEFI stack.
|
// Find all the filesystems inside the UEFI stack.
|
||||||
let handles = uefi::boot::find_handles::<SimpleFileSystem>()
|
let handles = uefi::boot::find_handles::<SimpleFileSystem>()
|
||||||
.context("unable to find filesystem handles")?;
|
.context("unable to find filesystem handles")?;
|
||||||
|
|||||||
Reference in New Issue
Block a user