osbuild2: rename Partition to SfdiskPartition

Properly namespace the partition stage options for the Sfdisk stage.
This commit is contained in:
Christian Kellner 2022-05-27 18:08:58 +02:00
parent 4d9215ffb0
commit 074973e03d
3 changed files with 6 additions and 6 deletions

View file

@ -9,9 +9,9 @@ import (
// sfdiskStageOptions creates the options and devices properties for an
// org.osbuild.sfdisk stage based on a partition table description
func sfdiskStageOptions(pt *disk.PartitionTable) *SfdiskStageOptions {
partitions := make([]Partition, len(pt.Partitions))
partitions := make([]SfdiskPartition, len(pt.Partitions))
for idx, p := range pt.Partitions {
partitions[idx] = Partition{
partitions[idx] = SfdiskPartition{
Bootable: p.Bootable,
Start: pt.BytesToSectors(p.Start),
Size: pt.BytesToSectors(p.Size),

View file

@ -10,13 +10,13 @@ type SfdiskStageOptions struct {
UUID string `json:"uuid"`
// Partition layout
Partitions []Partition `json:"partitions,omitempty"`
Partitions []SfdiskPartition `json:"partitions,omitempty"`
}
func (SfdiskStageOptions) isStageOptions() {}
// Description of a partition
type Partition struct {
type SfdiskPartition struct {
// Mark the partition as bootable (dos)
Bootable bool `json:"bootable,omitempty"`

View file

@ -8,7 +8,7 @@ import (
func TestNewSfdiskStage(t *testing.T) {
partition := Partition{
partition := SfdiskPartition{
Bootable: true,
Name: "root",
Size: 2097152,
@ -20,7 +20,7 @@ func TestNewSfdiskStage(t *testing.T) {
options := SfdiskStageOptions{
Label: "gpt",
UUID: "D209C89E-EA5E-4FBD-B161-B461CCE297E0",
Partitions: []Partition{partition},
Partitions: []SfdiskPartition{partition},
}
device := NewLoopbackDevice(&LoopbackDeviceOptions{Filename: "disk.raw"})