partition: add checks for absolute minimum size of EFI
This commit is contained in:
parent
b7545fded3
commit
026d1cb5e4
@ -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 )
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user