From d6c373c48d6e229761432ad09b1212f785073b53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20PORTAY?= Date: Tue, 21 Apr 2020 18:11:16 -0400 Subject: [PATCH] [partition] Allow a configurable EFI System Partition name This commit adds the new configuration `efiSystemPartitionName` to the file partition.conf. This option sets the partition name to the EFI System Partition that is created. If this option is unset, the partition is left unnamed. --- src/modules/partition/core/PartitionActions.cpp | 4 ++++ src/modules/partition/gui/PartitionViewStep.cpp | 6 ++++++ src/modules/partition/partition.conf | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/src/modules/partition/core/PartitionActions.cpp b/src/modules/partition/core/PartitionActions.cpp index 5e785c9d1..d0de2c0d4 100644 --- a/src/modules/partition/core/PartitionActions.cpp +++ b/src/modules/partition/core/PartitionActions.cpp @@ -151,6 +151,10 @@ doAutopartition( PartitionCoreModule* core, Device* dev, Choices::AutoPartitionO KPM_PARTITION_FLAG( None ) ); PartitionInfo::setFormat( efiPartition, true ); PartitionInfo::setMountPoint( efiPartition, o.efiPartitionMountPoint ); + if ( gs->contains( "efiSystemPartitionName" ) ) + { + efiPartition->setLabel( gs->value( "efiSystemPartitionName" ).toString() ); + } core->createPartition( dev, efiPartition, KPM_PARTITION_FLAG_ESP ); firstFreeSector = lastSector + 1; } diff --git a/src/modules/partition/gui/PartitionViewStep.cpp b/src/modules/partition/gui/PartitionViewStep.cpp index ed35fafa4..48d250ca4 100644 --- a/src/modules/partition/gui/PartitionViewStep.cpp +++ b/src/modules/partition/gui/PartitionViewStep.cpp @@ -538,6 +538,12 @@ PartitionViewStep::setConfigurationMap( const QVariantMap& configurationMap ) gs->insert( "efiSystemPartitionSize", CalamaresUtils::getString( configurationMap, "efiSystemPartitionSize" ) ); } + // Read and parse key efiSystemPartitionName + if ( configurationMap.contains( "efiSystemPartitionName" ) ) + { + gs->insert( "efiSystemPartitionName", CalamaresUtils::getString( configurationMap, "efiSystemPartitionName" ) ); + } + // SWAP SETTINGS // // This is a bit convoluted because there's legacy settings to handle as well diff --git a/src/modules/partition/partition.conf b/src/modules/partition/partition.conf index 241e4ea05..f6cc34ee4 100644 --- a/src/modules/partition/partition.conf +++ b/src/modules/partition/partition.conf @@ -7,6 +7,10 @@ efiSystemPartition: "/boot/efi" # If nothing is specified, the default size of 300MiB will be used. # efiSystemPartitionSize: 300M +# This optional setting specifies the name of the EFI system partition. +# If nothing is specified, the partition name is left unset. +# efiSystemPartitionName: EFI + # In autogenerated partitioning, allow the user to select a swap size? # If there is exactly one choice, no UI is presented, and the user # cannot make a choice -- this setting is used. If there is more than