partition: introduce accessor for minimum-size EFI

This commit is contained in:
Adriaan de Groot 2023-11-07 23:37:31 +01:00
parent 45529ebdc1
commit d0ae922439
3 changed files with 16 additions and 2 deletions

View File

@ -561,7 +561,8 @@ PartitionViewStep::onLeave()
const QString requireConfiguredSize
= tr( "The filesystem must be at least %1 MiB in size." ).arg( atLeastMiB );
const QString requiredMinimumSize
= tr( "The filesystem must be at least %1 MiB in size." ).arg( Calamares::BytesToMiB( 32_MiB ) );
= tr( "The filesystem must be at least %1 MiB in size." )
.arg( Calamares::BytesToMiB( PartUtils::efiFilesystemMinimumSize() ) );
const QString suggestConfiguredSize
= tr( "The minimum recommended size for the filesystem is %1 MiB." ).arg( atLeastMiB );
@ -569,7 +570,7 @@ PartitionViewStep::onLeave()
const QString mayFail = tr( "You can continue without setting up an EFI system "
"partition but your system may fail to start." );
const QString possibleFail = tr( "You can continue with this EFI system "
"partition configuration but your system may fail to start." );
"partition configuration but your system may fail to start." );
const QString startList = QStringLiteral( "<br/><br/><ul>" );
const QString endList = QStringLiteral( "</ul><br/><br/>" );

View File

@ -545,6 +545,13 @@ efiFilesystemRecommendedSize()
return uefisys_part_sizeB;
}
qint64
efiFilesystemMinimumSize()
{
using Calamares::Units::operator""_MiB;
return 32_MiB;
}
QString
canonicalFilesystemName( const QString& fsName, FileSystem::Type* fsType )
{

View File

@ -120,6 +120,12 @@ bool isEfiFilesystemMinimumSize( const Partition* candidate );
*/
qint64 efiFilesystemRecommendedSize();
/** @brief Returns the hard-minimum size of an EFI boot partition in bytes.
*
* This is 32MiB, based on the FAT32 standard and EFI documentation.
*/
qint64 efiFilesystemMinimumSize();
/**
* @brief Is the given @p partition bootable in EFI? Depending on
* the partition table layout, this may mean different flags.