osbuild2: rename Partition to SfdiskPartition
Properly namespace the partition stage options for the Sfdisk stage.
This commit is contained in:
parent
4d9215ffb0
commit
074973e03d
3 changed files with 6 additions and 6 deletions
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -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"`
|
||||
|
||||
|
|
|
|||
|
|
@ -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"})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue