From b50a386936e4169537c566c3b74f30042baef757 Mon Sep 17 00:00:00 2001 From: Itxaka Date: Tue, 24 Sep 2024 09:36:47 +0200 Subject: [PATCH] Fix mkfs using the wrong label for the fs label We were using the partion label as the fs label and the fs labe was nto used anywhere Signed-off-by: Itxaka --- pkg/elemental/elemental.go | 2 +- pkg/partitioner/disk.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/elemental/elemental.go b/pkg/elemental/elemental.go index 95359dcc..d37c309f 100644 --- a/pkg/elemental/elemental.go +++ b/pkg/elemental/elemental.go @@ -110,7 +110,7 @@ func (e *Elemental) PartitionAndFormatDevice(i v1.SharedInstallSpec) error { continue } // we have to match the Fs it was asked with the partition in the system - if p.(*gpt.Partition).Name == configPart.FilesystemLabel { + if p.(*gpt.Partition).Name == configPart.Name { e.config.Logger.Debugf("Formatting partition: %s", configPart.FilesystemLabel) err = partitioner.FormatDevice(e.config.Runner, fmt.Sprintf("%s%d", i.GetTarget(), index+1), configPart.FS, configPart.FilesystemLabel) if err != nil { diff --git a/pkg/partitioner/disk.go b/pkg/partitioner/disk.go index 0a28adf3..1f0bac5d 100644 --- a/pkg/partitioner/disk.go +++ b/pkg/partitioner/disk.go @@ -88,7 +88,7 @@ func kairosPartsToDiskfsGPTParts(parts sdkTypes.PartitionList, diskSize int64) [ Type: gpt.EFISystemPartition, Size: size, // partition size in bytes GUID: uuid.NewV5(uuid.NamespaceURL, part.FilesystemLabel).String(), // set know predictable UUID - Name: part.FilesystemLabel, + Name: part.Name, Attributes: 0x1, // system partition flag }) } else if part.Name == cnst.BiosPartName { @@ -99,7 +99,7 @@ func kairosPartsToDiskfsGPTParts(parts sdkTypes.PartitionList, diskSize int64) [ Type: gpt.BIOSBoot, Size: size, // partition size in bytes GUID: uuid.NewV5(uuid.NamespaceURL, part.FilesystemLabel).String(), // set know predictable UUID - Name: part.FilesystemLabel, + Name: part.Name, Attributes: 0x4, // legacy bios bootable flag }) } else { @@ -110,7 +110,7 @@ func kairosPartsToDiskfsGPTParts(parts sdkTypes.PartitionList, diskSize int64) [ Type: gpt.LinuxFilesystem, Size: size, GUID: uuid.NewV5(uuid.NamespaceURL, part.FilesystemLabel).String(), - Name: part.FilesystemLabel, + Name: part.Name, }) } }