diff --git a/src/modules/partition/PartitionViewStep.cpp b/src/modules/partition/PartitionViewStep.cpp index 01dd7098b..f1ed1f41f 100644 --- a/src/modules/partition/PartitionViewStep.cpp +++ b/src/modules/partition/PartitionViewStep.cpp @@ -528,6 +528,7 @@ PartitionViewStep::onLeave() const bool okType = esp && PartUtils::isEfiFilesystemSuitableType( esp ); const bool okSize = esp && PartUtils::isEfiFilesystemSuitableSize( esp ); + const bool okMinimumSize = esp && PartUtils::isEfiFilesystemSuitableMinimumSize( esp ); const bool okFlag = esp && PartUtils::isEfiBootable( esp ); if ( !esp ) diff --git a/src/modules/partition/core/PartUtils.cpp b/src/modules/partition/core/PartUtils.cpp index 8c646e312..ad39bba37 100644 --- a/src/modules/partition/core/PartUtils.cpp +++ b/src/modules/partition/core/PartUtils.cpp @@ -485,7 +485,29 @@ isEfiFilesystemSuitableSize( const Partition* candidate ) } else { - cWarning() << "Filesystem for EFI is too small (" << size << "bytes)"; + cWarning() << "Filesystem for EFI is smaller than recommended (" << size << "bytes)"; + return false; + } +} + +bool +isEfiFilesystemSuitableMinimumSize( const Partition* candidate ) +{ + using Calamares::Units::operator""_MiB; + + auto size = candidate->capacity(); // bytes + if ( size <= 0 ) + { + return false; + } + + if ( size >= 32_MiB ) + { + return true; + } + else + { + cWarning() << "Filesystem for EFI is below minimum (" << size << "bytes)"; return false; } } diff --git a/src/modules/partition/core/PartUtils.h b/src/modules/partition/core/PartUtils.h index a6f036710..98a1c1ab3 100644 --- a/src/modules/partition/core/PartUtils.h +++ b/src/modules/partition/core/PartUtils.h @@ -99,6 +99,12 @@ bool isEfiFilesystemSuitableType( const Partition* candidate ); */ bool isEfiFilesystemSuitableSize( const Partition* candidate ); +/** + * @brief Is the @p candidate suitable as an EFI boot partition? + * This checks the bonkers-small minimum of 32MiB. + */ +bool isEfiFilesystemSuitableMinimumSize( const Partition* candidate ); + /** @brief Returns the minimum size of an EFI boot partition in bytes. * * This is determined as 300MiB, based on the FAT32 standard