Skip to content

Commit

Permalink
Fix mkfs using the wrong label for the fs label
Browse files Browse the repository at this point in the history
We were using the partion label as the fs label and the fs labe was nto
used anywhere

Signed-off-by: Itxaka <itxaka@kairos.io>
  • Loading branch information
Itxaka committed Sep 24, 2024
1 parent 60af824 commit b50a386
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/elemental/elemental.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions pkg/partitioner/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand All @@ -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,
})
}
}
Expand Down

0 comments on commit b50a386

Please sign in to comment.