diff --git a/src/modules/partition/Config.cpp b/src/modules/partition/Config.cpp index 4a84046b3..ff59a7626 100644 --- a/src/modules/partition/Config.cpp +++ b/src/modules/partition/Config.cpp @@ -291,10 +291,10 @@ fillGSConfigurationEFI( Calamares::GlobalStorage* gs, const QVariantMap& configu // Assign long long int to long unsigned int to prevent compilation warning auto byte_part_size = part_size.toBytes(); - if ( byte_part_size != PartUtils::efiFilesystemMinimumSize() ) + if ( byte_part_size != PartUtils::efiFilesystemRecommendedSize() ) { cWarning() << "EFI partition size" << sizeString << "has been adjusted to" - << PartUtils::efiFilesystemMinimumSize() << "bytes"; + << PartUtils::efiFilesystemRecommendedSize() << "bytes"; } } else diff --git a/src/modules/partition/PartitionViewStep.cpp b/src/modules/partition/PartitionViewStep.cpp index a012938bf..c8c138ff7 100644 --- a/src/modules/partition/PartitionViewStep.cpp +++ b/src/modules/partition/PartitionViewStep.cpp @@ -527,8 +527,8 @@ PartitionViewStep::onLeave() Logger::Once o; const bool okType = esp && PartUtils::isEfiFilesystemSuitableType( esp ); - const bool okRecommendedSize = esp && PartUtils::isEfiFilesystemSuitableSize( esp ); - const bool okMinimumSize = esp && PartUtils::isEfiFilesystemSuitableMinimumSize( esp ); + const bool okRecommendedSize = esp && PartUtils::isEfiFilesystemRecommendedSize( esp ); + const bool okMinimumSize = esp && PartUtils::isEfiFilesystemMinimumSize( esp ); const bool okFlag = esp && PartUtils::isEfiBootable( esp ); const bool espExistsButIsWrong = esp && !( okType && okMinimumSize && okFlag ); @@ -555,7 +555,7 @@ PartitionViewStep::onLeave() // Three flavors of size-is-wrong using Calamares::Units::operator""_MiB; - const qint64 atLeastBytes = static_cast< qint64 >( PartUtils::efiFilesystemMinimumSize() ); + const qint64 atLeastBytes = static_cast< qint64 >( PartUtils::efiFilesystemRecommendedSize() ); const auto atLeastMiB = Calamares::BytesToMiB( atLeastBytes ); const QString requireConfiguredSize diff --git a/src/modules/partition/core/PartUtils.cpp b/src/modules/partition/core/PartUtils.cpp index ad39bba37..2b61c6d9e 100644 --- a/src/modules/partition/core/PartUtils.cpp +++ b/src/modules/partition/core/PartUtils.cpp @@ -471,7 +471,7 @@ isEfiFilesystemSuitableType( const Partition* candidate ) } bool -isEfiFilesystemSuitableSize( const Partition* candidate ) +isEfiFilesystemRecommendedSize( const Partition* candidate ) { auto size = candidate->capacity(); // bytes if ( size <= 0 ) @@ -479,7 +479,7 @@ isEfiFilesystemSuitableSize( const Partition* candidate ) return false; } - if ( size >= efiFilesystemMinimumSize() ) + if ( size >= efiFilesystemRecommendedSize() ) { return true; } @@ -491,7 +491,7 @@ isEfiFilesystemSuitableSize( const Partition* candidate ) } bool -isEfiFilesystemSuitableMinimumSize( const Partition* candidate ) +isEfiFilesystemMinimumSize( const Partition* candidate ) { using Calamares::Units::operator""_MiB; @@ -522,9 +522,8 @@ isEfiBootable( const Partition* candidate ) return flags.testFlag( KPM_PARTITION_FLAG_ESP ); } -// TODO: this is configurable via the config file **already** qint64 -efiFilesystemMinimumSize() +efiFilesystemRecommendedSize() { using Calamares::Units::operator""_MiB; diff --git a/src/modules/partition/core/PartUtils.h b/src/modules/partition/core/PartUtils.h index 98a1c1ab3..d7d62ed5e 100644 --- a/src/modules/partition/core/PartUtils.h +++ b/src/modules/partition/core/PartUtils.h @@ -95,15 +95,15 @@ bool isEfiFilesystemSuitableType( const Partition* candidate ); /** * @brief Is the @p partition suitable as an EFI boot partition? - * Checks for filesystem size (300MiB, see efiFilesystemMinimumSize). + * Checks for filesystem size (300MiB, see efi.recommendedSize). */ -bool isEfiFilesystemSuitableSize( const Partition* candidate ); +bool isEfiFilesystemRecommendedSize( const Partition* candidate ); /** * @brief Is the @p candidate suitable as an EFI boot partition? - * This checks the bonkers-small minimum of 32MiB. + * Checks for filesystem size (32MiB at least, see efi.minimumSize). */ -bool isEfiFilesystemSuitableMinimumSize( const Partition* candidate ); +bool isEfiFilesystemMinimumSize( const Partition* candidate ); /** @brief Returns the minimum size of an EFI boot partition in bytes. * @@ -113,12 +113,12 @@ bool isEfiFilesystemSuitableMinimumSize( const Partition* candidate ); * by the standard and how all of those are different). * * This can be configured through the `partition.conf` file, - * key *efiSystemPartitionSize*, which will then apply to both + * key *efi.recommendedSize*, which will then apply to both * automatic partitioning **and** the warning for manual partitioning. * * A minimum of 32MiB (which is bonkers-small) is enforced. */ -qint64 efiFilesystemMinimumSize(); +qint64 efiFilesystemRecommendedSize(); /** * @brief Is the given @p partition bootable in EFI? Depending on diff --git a/src/modules/partition/core/PartitionActions.cpp b/src/modules/partition/core/PartitionActions.cpp index 25e4a01a5..b5fb0cafb 100644 --- a/src/modules/partition/core/PartitionActions.cpp +++ b/src/modules/partition/core/PartitionActions.cpp @@ -118,7 +118,7 @@ doAutopartition( PartitionCoreModule* core, Device* dev, Choices::AutoPartitionO if ( isEfi ) { - qint64 uefisys_part_sizeB = PartUtils::efiFilesystemMinimumSize(); + qint64 uefisys_part_sizeB = PartUtils::efiFilesystemRecommendedSize(); qint64 efiSectorCount = Calamares::bytesToSectors( uefisys_part_sizeB, dev->logicalSize() ); Q_ASSERT( efiSectorCount > 0 );