disk: rename Partition.Filesystem to Payload
A Partition can contain any type of Entity now. Before we change the type, rename the field to a more generic term.
This commit is contained in:
parent
221cdedebc
commit
54fd090a60
16 changed files with 172 additions and 170 deletions
|
|
@ -51,7 +51,7 @@ func TestDisk_DynamicallyResizePartitionTable(t *testing.T) {
|
|||
{
|
||||
Type: FilesystemDataGUID,
|
||||
UUID: RootPartitionUUID,
|
||||
Filesystem: &Filesystem{
|
||||
Payload: &Filesystem{
|
||||
Type: "xfs",
|
||||
Label: "root",
|
||||
Mountpoint: "/",
|
||||
|
|
@ -86,7 +86,7 @@ var canonicalPartitionTable = PartitionTable{
|
|||
Size: 204800,
|
||||
Type: EFISystemPartitionGUID,
|
||||
UUID: EFISystemPartitionUUID,
|
||||
Filesystem: &Filesystem{
|
||||
Payload: &Filesystem{
|
||||
Type: "vfat",
|
||||
UUID: EFIFilesystemUUID,
|
||||
Mountpoint: "/boot/efi",
|
||||
|
|
@ -99,7 +99,7 @@ var canonicalPartitionTable = PartitionTable{
|
|||
Size: 1048576,
|
||||
Type: FilesystemDataGUID,
|
||||
UUID: FilesystemDataUUID,
|
||||
Filesystem: &Filesystem{
|
||||
Payload: &Filesystem{
|
||||
Type: "xfs",
|
||||
Mountpoint: "/boot",
|
||||
FSTabOptions: "defaults",
|
||||
|
|
@ -110,7 +110,7 @@ var canonicalPartitionTable = PartitionTable{
|
|||
{
|
||||
Type: FilesystemDataGUID,
|
||||
UUID: RootPartitionUUID,
|
||||
Filesystem: &Filesystem{
|
||||
Payload: &Filesystem{
|
||||
Type: "xfs",
|
||||
Label: "root",
|
||||
Mountpoint: "/",
|
||||
|
|
@ -123,9 +123,9 @@ var canonicalPartitionTable = PartitionTable{
|
|||
}
|
||||
|
||||
func TestDisk_ForEachFilesystem(t *testing.T) {
|
||||
rootFs := canonicalPartitionTable.Partitions[3].Filesystem
|
||||
bootFs := canonicalPartitionTable.Partitions[2].Filesystem
|
||||
efiFs := canonicalPartitionTable.Partitions[1].Filesystem
|
||||
rootFs := canonicalPartitionTable.Partitions[3].Payload
|
||||
bootFs := canonicalPartitionTable.Partitions[2].Payload
|
||||
efiFs := canonicalPartitionTable.Partitions[1].Payload
|
||||
|
||||
// check we iterate in the correct order and throughout the whole array
|
||||
var expectedFilesystems []*Filesystem
|
||||
|
|
|
|||
|
|
@ -11,11 +11,13 @@ type Partition struct {
|
|||
Size uint64 // Size of the partition in bytes
|
||||
Type string // Partition type, e.g. 0x83 for MBR or a UUID for gpt
|
||||
Bootable bool // `Legacy BIOS bootable` (GPT) or `active` (DOS) flag
|
||||
|
||||
// ID of the partition, dos doesn't use traditional UUIDs, therefore this
|
||||
// is just a string.
|
||||
UUID string
|
||||
// If nil, the partition is raw; It doesn't contain a filesystem.
|
||||
Filesystem *Filesystem
|
||||
|
||||
// If nil, the partition is raw; It doesn't contain a payload.
|
||||
Payload *Filesystem
|
||||
}
|
||||
|
||||
func (p *Partition) IsContainer() bool {
|
||||
|
|
@ -27,7 +29,7 @@ func (p *Partition) Clone() Entity {
|
|||
return p
|
||||
}
|
||||
|
||||
ent := p.Filesystem.Clone()
|
||||
ent := p.Payload.Clone()
|
||||
var fs *Filesystem
|
||||
if ent != nil {
|
||||
fsEnt, cloneOk := ent.(*Filesystem)
|
||||
|
|
@ -38,20 +40,20 @@ func (p *Partition) Clone() Entity {
|
|||
}
|
||||
|
||||
return &Partition{
|
||||
Start: p.Start,
|
||||
Size: p.Size,
|
||||
Type: p.Type,
|
||||
Bootable: p.Bootable,
|
||||
UUID: p.UUID,
|
||||
Filesystem: fs,
|
||||
Start: p.Start,
|
||||
Size: p.Size,
|
||||
Type: p.Type,
|
||||
Bootable: p.Bootable,
|
||||
UUID: p.UUID,
|
||||
Payload: fs,
|
||||
}
|
||||
}
|
||||
|
||||
// Converts Partition to osbuild.QEMUPartition that encodes the same partition.
|
||||
func (p *Partition) QEMUPartition() osbuild.QEMUPartition {
|
||||
var fs *osbuild.QEMUFilesystem
|
||||
if p.Filesystem != nil {
|
||||
f := p.Filesystem.QEMUFilesystem()
|
||||
if p.Payload != nil {
|
||||
f := p.Payload.QEMUFilesystem()
|
||||
fs = &f
|
||||
}
|
||||
return osbuild.QEMUPartition{
|
||||
|
|
@ -65,7 +67,7 @@ func (p *Partition) QEMUPartition() osbuild.QEMUPartition {
|
|||
}
|
||||
|
||||
func (pt *Partition) GetItemCount() uint {
|
||||
if pt.Filesystem == nil {
|
||||
if pt.Payload == nil {
|
||||
return 0
|
||||
}
|
||||
return 1
|
||||
|
|
@ -75,7 +77,7 @@ func (p *Partition) GetChild(n uint) Entity {
|
|||
if n != 0 {
|
||||
panic(fmt.Sprintf("invalid child index for Partition: %d != 0", n))
|
||||
}
|
||||
return p.Filesystem
|
||||
return p.Payload
|
||||
}
|
||||
|
||||
func (p *Partition) GetSize() uint64 {
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ func (pt *PartitionTable) QEMUAssemblerOptions() osbuild.QEMUAssemblerOptions {
|
|||
func (pt *PartitionTable) FSTabStageOptions() *osbuild.FSTabStageOptions {
|
||||
var options osbuild.FSTabStageOptions
|
||||
for _, p := range pt.Partitions {
|
||||
fs := p.Filesystem
|
||||
fs := p.Payload
|
||||
if fs == nil {
|
||||
continue
|
||||
}
|
||||
|
|
@ -124,7 +124,7 @@ func (pt *PartitionTable) FSTabStageOptions() *osbuild.FSTabStageOptions {
|
|||
func (pt *PartitionTable) FSTabStageOptionsV2() *osbuild2.FSTabStageOptions {
|
||||
var options osbuild2.FSTabStageOptions
|
||||
for _, p := range pt.Partitions {
|
||||
fs := p.Filesystem
|
||||
fs := p.Payload
|
||||
if fs == nil {
|
||||
continue
|
||||
}
|
||||
|
|
@ -142,11 +142,11 @@ func (pt *PartitionTable) FSTabStageOptionsV2() *osbuild2.FSTabStageOptions {
|
|||
|
||||
func (pt *PartitionTable) FindPartitionForMountpoint(mountpoint string) *Partition {
|
||||
for idx, p := range pt.Partitions {
|
||||
if p.Filesystem == nil {
|
||||
if p.Payload == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
if p.Filesystem.Mountpoint == mountpoint {
|
||||
if p.Payload.Mountpoint == mountpoint {
|
||||
return &pt.Partitions[idx]
|
||||
}
|
||||
}
|
||||
|
|
@ -176,12 +176,12 @@ func (pt *PartitionTable) BootPartitionIndex() int {
|
|||
// find partition with '/boot' mountpoint and fallback to '/'
|
||||
rootIdx := -1
|
||||
for idx, part := range pt.Partitions {
|
||||
if part.Filesystem == nil {
|
||||
if part.Payload == nil {
|
||||
continue
|
||||
}
|
||||
if part.Filesystem.Mountpoint == "/boot" {
|
||||
if part.Payload.Mountpoint == "/boot" {
|
||||
return idx
|
||||
} else if part.Filesystem.Mountpoint == "/" {
|
||||
} else if part.Payload.Mountpoint == "/" {
|
||||
rootIdx = idx
|
||||
}
|
||||
}
|
||||
|
|
@ -204,11 +204,11 @@ type ForEachFileSystemFunc func(fs *Filesystem) error
|
|||
// does not return an error.
|
||||
func (pt *PartitionTable) ForEachFilesystem(cb ForEachFileSystemFunc) error {
|
||||
for _, part := range pt.Partitions {
|
||||
if part.Filesystem == nil {
|
||||
if part.Payload == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
if err := cb(part.Filesystem); err != nil {
|
||||
if err := cb(part.Payload); err != nil {
|
||||
if err == StopIter {
|
||||
return nil
|
||||
}
|
||||
|
|
@ -265,8 +265,8 @@ func (pt *PartitionTable) CreateFilesystem(mountpoint string, size uint64) error
|
|||
}
|
||||
|
||||
partition := Partition{
|
||||
Size: size,
|
||||
Filesystem: &filesystem,
|
||||
Size: size,
|
||||
Payload: &filesystem,
|
||||
}
|
||||
|
||||
n := len(pt.Partitions)
|
||||
|
|
@ -366,7 +366,7 @@ func (pt *PartitionTable) updatePartitionStartPointOffsets(size uint64) uint64 {
|
|||
var rootIdx = -1
|
||||
for i := range pt.Partitions {
|
||||
partition := &pt.Partitions[i]
|
||||
if partition.Filesystem != nil && partition.Filesystem.Mountpoint == "/" {
|
||||
if partition.Payload != nil && partition.Payload.Mountpoint == "/" {
|
||||
rootIdx = i
|
||||
continue
|
||||
}
|
||||
|
|
|
|||
|
|
@ -713,7 +713,7 @@ func defaultPartitionTable(imageSize uint64, arch distro.Arch, rng *rand.Rand) d
|
|||
Size: 204800,
|
||||
Type: "C12A7328-F81F-11D2-BA4B-00A0C93EC93B",
|
||||
UUID: "68B2905B-DF3E-4FB3-80FA-49D1E773AA33",
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "vfat",
|
||||
UUID: "7B77-95E7",
|
||||
Mountpoint: "/boot/efi",
|
||||
|
|
@ -726,7 +726,7 @@ func defaultPartitionTable(imageSize uint64, arch distro.Arch, rng *rand.Rand) d
|
|||
Start: 208896,
|
||||
Type: "0FC63DAF-8483-4772-8E79-3D69D8477DE4",
|
||||
UUID: "6264D520-3FB9-423F-8AB8-7A0A8E3D3562",
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
UUID: uuid.Must(newRandomUUIDFromReader(rng)).String(),
|
||||
Label: "root",
|
||||
|
|
@ -749,7 +749,7 @@ func defaultPartitionTable(imageSize uint64, arch distro.Arch, rng *rand.Rand) d
|
|||
Size: 204800,
|
||||
Type: "C12A7328-F81F-11D2-BA4B-00A0C93EC93B",
|
||||
UUID: "68B2905B-DF3E-4FB3-80FA-49D1E773AA33",
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "vfat",
|
||||
UUID: "7B77-95E7",
|
||||
Mountpoint: "/boot/efi",
|
||||
|
|
@ -762,7 +762,7 @@ func defaultPartitionTable(imageSize uint64, arch distro.Arch, rng *rand.Rand) d
|
|||
Start: 206848,
|
||||
Type: "0FC63DAF-8483-4772-8E79-3D69D8477DE4",
|
||||
UUID: "6264D520-3FB9-423F-8AB8-7A0A8E3D3562",
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
UUID: uuid.Must(newRandomUUIDFromReader(rng)).String(),
|
||||
Label: "root",
|
||||
|
|
@ -787,7 +787,7 @@ func defaultPartitionTable(imageSize uint64, arch distro.Arch, rng *rand.Rand) d
|
|||
},
|
||||
{
|
||||
Start: 10240,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
UUID: uuid.Must(newRandomUUIDFromReader(rng)).String(),
|
||||
Mountpoint: "/",
|
||||
|
|
@ -807,7 +807,7 @@ func defaultPartitionTable(imageSize uint64, arch distro.Arch, rng *rand.Rand) d
|
|||
{
|
||||
Start: 2048,
|
||||
Bootable: true,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
UUID: uuid.Must(newRandomUUIDFromReader(rng)).String(),
|
||||
Mountpoint: "/",
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 104857600,
|
||||
Type: disk.EFISystemPartitionGUID,
|
||||
UUID: disk.EFISystemPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "vfat",
|
||||
UUID: disk.EFIFilesystemUUID,
|
||||
Mountpoint: "/boot/efi",
|
||||
|
|
@ -43,7 +43,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
{
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.RootPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Label: "root",
|
||||
Mountpoint: "/",
|
||||
|
|
@ -63,7 +63,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 104857600,
|
||||
Type: disk.EFISystemPartitionGUID,
|
||||
UUID: disk.EFISystemPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "vfat",
|
||||
UUID: disk.EFIFilesystemUUID,
|
||||
Mountpoint: "/boot/efi",
|
||||
|
|
@ -75,7 +75,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
{
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.RootPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Label: "root",
|
||||
Mountpoint: "/",
|
||||
|
|
@ -97,7 +97,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Bootable: true,
|
||||
},
|
||||
{
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Mountpoint: "/",
|
||||
FSTabOptions: "defaults",
|
||||
|
|
@ -114,7 +114,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Partitions: []disk.Partition{
|
||||
{
|
||||
Bootable: true,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Mountpoint: "/",
|
||||
FSTabOptions: "defaults",
|
||||
|
|
@ -141,7 +141,7 @@ var ec2BasePartitionTables = distro.BasePartitionTableMap{
|
|||
{
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.RootPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Label: "root",
|
||||
Mountpoint: "/",
|
||||
|
|
@ -161,7 +161,7 @@ var ec2BasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 209715200,
|
||||
Type: disk.EFISystemPartitionGUID,
|
||||
UUID: disk.EFISystemPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "vfat",
|
||||
UUID: disk.EFIFilesystemUUID,
|
||||
Mountpoint: "/boot/efi",
|
||||
|
|
@ -174,7 +174,7 @@ var ec2BasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 536870912,
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.FilesystemDataUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Mountpoint: "/boot",
|
||||
FSTabOptions: "defaults",
|
||||
|
|
@ -185,7 +185,7 @@ var ec2BasePartitionTables = distro.BasePartitionTableMap{
|
|||
{
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.RootPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Label: "root",
|
||||
Mountpoint: "/",
|
||||
|
|
@ -214,7 +214,7 @@ var edgeBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 133169152,
|
||||
Type: disk.EFISystemPartitionGUID,
|
||||
UUID: disk.EFISystemPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "vfat",
|
||||
UUID: disk.EFIFilesystemUUID,
|
||||
Mountpoint: "/boot/efi",
|
||||
|
|
@ -228,7 +228,7 @@ var edgeBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 402653184,
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.FilesystemDataUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Mountpoint: "/boot",
|
||||
Label: "boot",
|
||||
|
|
@ -240,7 +240,7 @@ var edgeBasePartitionTables = distro.BasePartitionTableMap{
|
|||
{
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.RootPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Label: "root",
|
||||
Mountpoint: "/",
|
||||
|
|
@ -260,7 +260,7 @@ var edgeBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 133169152,
|
||||
Type: disk.EFISystemPartitionGUID,
|
||||
UUID: disk.EFISystemPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "vfat",
|
||||
UUID: disk.EFIFilesystemUUID,
|
||||
Mountpoint: "/boot/efi",
|
||||
|
|
@ -274,7 +274,7 @@ var edgeBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 402653184,
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.FilesystemDataUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Mountpoint: "/boot",
|
||||
Label: "boot",
|
||||
|
|
@ -286,7 +286,7 @@ var edgeBasePartitionTables = distro.BasePartitionTableMap{
|
|||
{
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.RootPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Label: "root",
|
||||
Mountpoint: "/",
|
||||
|
|
|
|||
|
|
@ -961,7 +961,7 @@ func simplifiedInstallerBootISOTreePipeline(archivePipelineName, kver string) *o
|
|||
{
|
||||
Start: 0,
|
||||
Size: 20971520,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "vfat",
|
||||
Mountpoint: "/",
|
||||
},
|
||||
|
|
@ -1266,7 +1266,7 @@ func mkfsStages(pt *disk.PartitionTable, device *osbuild.Device) []*osbuild2.Sta
|
|||
}
|
||||
|
||||
for _, p := range pt.Partitions {
|
||||
if p.Filesystem == nil {
|
||||
if p.Payload == nil {
|
||||
// no filesystem for partition (e.g., BIOS boot)
|
||||
continue
|
||||
}
|
||||
|
|
@ -1278,28 +1278,28 @@ func mkfsStages(pt *disk.PartitionTable, device *osbuild.Device) []*osbuild2.Sta
|
|||
Size: pt.BytesToSectors(p.Size),
|
||||
},
|
||||
)
|
||||
switch p.Filesystem.Type {
|
||||
switch p.Payload.Type {
|
||||
case "xfs":
|
||||
options := &osbuild.MkfsXfsStageOptions{
|
||||
UUID: p.Filesystem.UUID,
|
||||
Label: p.Filesystem.Label,
|
||||
UUID: p.Payload.UUID,
|
||||
Label: p.Payload.Label,
|
||||
}
|
||||
stage = osbuild.NewMkfsXfsStage(options, stageDevice)
|
||||
case "vfat":
|
||||
options := &osbuild.MkfsFATStageOptions{
|
||||
VolID: strings.Replace(p.Filesystem.UUID, "-", "", -1),
|
||||
VolID: strings.Replace(p.Payload.UUID, "-", "", -1),
|
||||
}
|
||||
stage = osbuild.NewMkfsFATStage(options, stageDevice)
|
||||
case "btrfs":
|
||||
options := &osbuild.MkfsBtrfsStageOptions{
|
||||
UUID: p.Filesystem.UUID,
|
||||
Label: p.Filesystem.Label,
|
||||
UUID: p.Payload.UUID,
|
||||
Label: p.Payload.Label,
|
||||
}
|
||||
stage = osbuild.NewMkfsBtrfsStage(options, stageDevice)
|
||||
case "ext4":
|
||||
options := &osbuild.MkfsExt4StageOptions{
|
||||
UUID: p.Filesystem.UUID,
|
||||
Label: p.Filesystem.Label,
|
||||
UUID: p.Payload.UUID,
|
||||
Label: p.Payload.Label,
|
||||
}
|
||||
stage = osbuild.NewMkfsExt4Stage(options, stageDevice)
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -408,11 +408,11 @@ func copyFSTreeOptions(inputName, inputPipeline string, pt *disk.PartitionTable,
|
|||
devices := make(map[string]osbuild.Device, len(pt.Partitions))
|
||||
mounts := make([]osbuild.Mount, 0, len(pt.Partitions))
|
||||
for _, p := range pt.Partitions {
|
||||
if p.Filesystem == nil {
|
||||
if p.Payload == nil {
|
||||
// no filesystem for partition (e.g., BIOS boot)
|
||||
continue
|
||||
}
|
||||
name := filepath.Base(p.Filesystem.Mountpoint)
|
||||
name := filepath.Base(p.Payload.Mountpoint)
|
||||
if name == "/" {
|
||||
name = "root"
|
||||
}
|
||||
|
|
@ -424,15 +424,15 @@ func copyFSTreeOptions(inputName, inputPipeline string, pt *disk.PartitionTable,
|
|||
},
|
||||
)
|
||||
var mount *osbuild.Mount
|
||||
switch p.Filesystem.Type {
|
||||
switch p.Payload.Type {
|
||||
case "xfs":
|
||||
mount = osbuild.NewXfsMount(name, name, p.Filesystem.Mountpoint)
|
||||
mount = osbuild.NewXfsMount(name, name, p.Payload.Mountpoint)
|
||||
case "vfat":
|
||||
mount = osbuild.NewFATMount(name, name, p.Filesystem.Mountpoint)
|
||||
mount = osbuild.NewFATMount(name, name, p.Payload.Mountpoint)
|
||||
case "ext4":
|
||||
mount = osbuild.NewExt4Mount(name, name, p.Filesystem.Mountpoint)
|
||||
mount = osbuild.NewExt4Mount(name, name, p.Payload.Mountpoint)
|
||||
case "btrfs":
|
||||
mount = osbuild.NewBtrfsMount(name, name, p.Filesystem.Mountpoint)
|
||||
mount = osbuild.NewBtrfsMount(name, name, p.Payload.Mountpoint)
|
||||
default:
|
||||
panic("unknown fs type " + p.Type)
|
||||
}
|
||||
|
|
@ -469,13 +469,13 @@ func grub2InstStageOptions(filename string, pt *disk.PartitionTable, platform st
|
|||
}
|
||||
bootPart := pt.Partitions[bootPartIndex]
|
||||
prefixPath := "/boot/grub2"
|
||||
if bootPart.Filesystem.Mountpoint == "/boot" {
|
||||
if bootPart.Payload.Mountpoint == "/boot" {
|
||||
prefixPath = "/grub2"
|
||||
}
|
||||
core := osbuild.CoreMkImage{
|
||||
Type: "mkimage",
|
||||
PartLabel: pt.Type,
|
||||
Filesystem: pt.Partitions[bootPartIndex].Filesystem.Type,
|
||||
Filesystem: pt.Partitions[bootPartIndex].Payload.Type,
|
||||
}
|
||||
|
||||
prefix := osbuild.PrefixPartition{
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 104857600,
|
||||
Type: disk.EFISystemPartitionGUID,
|
||||
UUID: disk.EFISystemPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "vfat",
|
||||
UUID: disk.EFIFilesystemUUID,
|
||||
Mountpoint: "/boot/efi",
|
||||
|
|
@ -32,7 +32,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
{
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.RootPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Label: "root",
|
||||
Mountpoint: "/",
|
||||
|
|
@ -51,7 +51,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 104857600,
|
||||
Type: disk.EFISystemPartitionGUID,
|
||||
UUID: disk.EFISystemPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "vfat",
|
||||
UUID: disk.EFIFilesystemUUID,
|
||||
Mountpoint: "/boot/efi",
|
||||
|
|
@ -63,7 +63,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
{
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.RootPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Label: "root",
|
||||
Mountpoint: "/",
|
||||
|
|
@ -84,7 +84,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Bootable: true,
|
||||
},
|
||||
{
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Mountpoint: "/",
|
||||
FSTabOptions: "defaults",
|
||||
|
|
@ -100,7 +100,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Partitions: []disk.Partition{
|
||||
{
|
||||
Bootable: true,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Mountpoint: "/",
|
||||
FSTabOptions: "defaults",
|
||||
|
|
@ -126,7 +126,7 @@ var ec2BasePartitionTables = distro.BasePartitionTableMap{
|
|||
{
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.RootPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Label: "root",
|
||||
Mountpoint: "/",
|
||||
|
|
@ -145,7 +145,7 @@ var ec2BasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 209715200,
|
||||
Type: disk.EFISystemPartitionGUID,
|
||||
UUID: disk.EFISystemPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "vfat",
|
||||
UUID: disk.EFIFilesystemUUID,
|
||||
Mountpoint: "/boot/efi",
|
||||
|
|
@ -158,7 +158,7 @@ var ec2BasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 536870912,
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.FilesystemDataUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Mountpoint: "/boot",
|
||||
FSTabOptions: "defaults",
|
||||
|
|
@ -169,7 +169,7 @@ var ec2BasePartitionTables = distro.BasePartitionTableMap{
|
|||
{
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.RootPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Label: "root",
|
||||
Mountpoint: "/",
|
||||
|
|
@ -197,7 +197,7 @@ var edgeBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 133169152, // 127 MB
|
||||
Type: disk.EFISystemPartitionGUID,
|
||||
UUID: disk.EFISystemPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "vfat",
|
||||
UUID: disk.EFIFilesystemUUID,
|
||||
Mountpoint: "/boot/efi",
|
||||
|
|
@ -211,7 +211,7 @@ var edgeBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 402653184, // 384 MB
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.FilesystemDataUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Mountpoint: "/boot",
|
||||
Label: "boot",
|
||||
|
|
@ -223,7 +223,7 @@ var edgeBasePartitionTables = distro.BasePartitionTableMap{
|
|||
{
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.RootPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Label: "root",
|
||||
Mountpoint: "/",
|
||||
|
|
@ -242,7 +242,7 @@ var edgeBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 133169152, // 127 MB
|
||||
Type: disk.EFISystemPartitionGUID,
|
||||
UUID: disk.EFISystemPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "vfat",
|
||||
UUID: disk.EFIFilesystemUUID,
|
||||
Mountpoint: "/boot/efi",
|
||||
|
|
@ -256,7 +256,7 @@ var edgeBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 402653184, // 384 MB
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.FilesystemDataUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Mountpoint: "/boot",
|
||||
Label: "boot",
|
||||
|
|
@ -268,7 +268,7 @@ var edgeBasePartitionTables = distro.BasePartitionTableMap{
|
|||
{
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.RootPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Label: "root",
|
||||
Mountpoint: "/",
|
||||
|
|
|
|||
|
|
@ -699,7 +699,7 @@ func simplifiedInstallerBootISOTreePipeline(archivePipelineName, kver string) *o
|
|||
{
|
||||
Start: 0,
|
||||
Size: 20971520,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "vfat",
|
||||
Mountpoint: "/",
|
||||
},
|
||||
|
|
@ -990,7 +990,7 @@ func mkfsStages(pt *disk.PartitionTable, device *osbuild.Device) []*osbuild.Stag
|
|||
}
|
||||
|
||||
for _, p := range pt.Partitions {
|
||||
if p.Filesystem == nil {
|
||||
if p.Payload == nil {
|
||||
// no filesystem for partition (e.g., BIOS boot)
|
||||
continue
|
||||
}
|
||||
|
|
@ -1002,28 +1002,28 @@ func mkfsStages(pt *disk.PartitionTable, device *osbuild.Device) []*osbuild.Stag
|
|||
Size: pt.BytesToSectors(p.Size),
|
||||
},
|
||||
)
|
||||
switch p.Filesystem.Type {
|
||||
switch p.Payload.Type {
|
||||
case "xfs":
|
||||
options := &osbuild.MkfsXfsStageOptions{
|
||||
UUID: p.Filesystem.UUID,
|
||||
Label: p.Filesystem.Label,
|
||||
UUID: p.Payload.UUID,
|
||||
Label: p.Payload.Label,
|
||||
}
|
||||
stage = osbuild.NewMkfsXfsStage(options, stageDevice)
|
||||
case "vfat":
|
||||
options := &osbuild.MkfsFATStageOptions{
|
||||
VolID: strings.Replace(p.Filesystem.UUID, "-", "", -1),
|
||||
VolID: strings.Replace(p.Payload.UUID, "-", "", -1),
|
||||
}
|
||||
stage = osbuild.NewMkfsFATStage(options, stageDevice)
|
||||
case "btrfs":
|
||||
options := &osbuild.MkfsBtrfsStageOptions{
|
||||
UUID: p.Filesystem.UUID,
|
||||
Label: p.Filesystem.Label,
|
||||
UUID: p.Payload.UUID,
|
||||
Label: p.Payload.Label,
|
||||
}
|
||||
stage = osbuild.NewMkfsBtrfsStage(options, stageDevice)
|
||||
case "ext4":
|
||||
options := &osbuild.MkfsExt4StageOptions{
|
||||
UUID: p.Filesystem.UUID,
|
||||
Label: p.Filesystem.Label,
|
||||
UUID: p.Payload.UUID,
|
||||
Label: p.Payload.Label,
|
||||
}
|
||||
stage = osbuild.NewMkfsExt4Stage(options, stageDevice)
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -449,11 +449,11 @@ func copyFSTreeOptions(inputName, inputPipeline string, pt *disk.PartitionTable,
|
|||
devices := make(map[string]osbuild.Device, len(pt.Partitions))
|
||||
mounts := make([]osbuild.Mount, 0, len(pt.Partitions))
|
||||
for _, p := range pt.Partitions {
|
||||
if p.Filesystem == nil {
|
||||
if p.Payload == nil {
|
||||
// no filesystem for partition (e.g., BIOS boot)
|
||||
continue
|
||||
}
|
||||
name := filepath.Base(p.Filesystem.Mountpoint)
|
||||
name := filepath.Base(p.Payload.Mountpoint)
|
||||
if name == "/" {
|
||||
name = "root"
|
||||
}
|
||||
|
|
@ -465,15 +465,15 @@ func copyFSTreeOptions(inputName, inputPipeline string, pt *disk.PartitionTable,
|
|||
},
|
||||
)
|
||||
var mount *osbuild.Mount
|
||||
switch p.Filesystem.Type {
|
||||
switch p.Payload.Type {
|
||||
case "xfs":
|
||||
mount = osbuild.NewXfsMount(name, name, p.Filesystem.Mountpoint)
|
||||
mount = osbuild.NewXfsMount(name, name, p.Payload.Mountpoint)
|
||||
case "vfat":
|
||||
mount = osbuild.NewFATMount(name, name, p.Filesystem.Mountpoint)
|
||||
mount = osbuild.NewFATMount(name, name, p.Payload.Mountpoint)
|
||||
case "ext4":
|
||||
mount = osbuild.NewExt4Mount(name, name, p.Filesystem.Mountpoint)
|
||||
mount = osbuild.NewExt4Mount(name, name, p.Payload.Mountpoint)
|
||||
case "btrfs":
|
||||
mount = osbuild.NewBtrfsMount(name, name, p.Filesystem.Mountpoint)
|
||||
mount = osbuild.NewBtrfsMount(name, name, p.Payload.Mountpoint)
|
||||
default:
|
||||
panic("unknown fs type " + p.Type)
|
||||
}
|
||||
|
|
@ -510,13 +510,13 @@ func grub2InstStageOptions(filename string, pt *disk.PartitionTable, platform st
|
|||
}
|
||||
bootPart := pt.Partitions[bootPartIndex]
|
||||
prefixPath := "/boot/grub2"
|
||||
if bootPart.Filesystem.Mountpoint == "/boot" {
|
||||
if bootPart.Payload.Mountpoint == "/boot" {
|
||||
prefixPath = "/grub2"
|
||||
}
|
||||
core := osbuild.CoreMkImage{
|
||||
Type: "mkimage",
|
||||
PartLabel: pt.Type,
|
||||
Filesystem: pt.Partitions[bootPartIndex].Filesystem.Type,
|
||||
Filesystem: pt.Partitions[bootPartIndex].Payload.Type,
|
||||
}
|
||||
|
||||
prefix := osbuild.PrefixPartition{
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 209715200, // 200 MB
|
||||
Type: disk.EFISystemPartitionGUID,
|
||||
UUID: disk.EFISystemPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "vfat",
|
||||
UUID: disk.EFIFilesystemUUID,
|
||||
Mountpoint: "/boot/efi",
|
||||
|
|
@ -34,7 +34,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 524288000, // 500 MB
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.FilesystemDataUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Mountpoint: "/boot",
|
||||
Label: "boot",
|
||||
|
|
@ -46,7 +46,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
{
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.RootPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Label: "root",
|
||||
Mountpoint: "/",
|
||||
|
|
@ -65,7 +65,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 209715200, // 200 MB
|
||||
Type: disk.EFISystemPartitionGUID,
|
||||
UUID: disk.EFISystemPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "vfat",
|
||||
UUID: disk.EFIFilesystemUUID,
|
||||
Mountpoint: "/boot/efi",
|
||||
|
|
@ -79,7 +79,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 524288000, // 500 MB
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.FilesystemDataUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Mountpoint: "/boot",
|
||||
Label: "boot",
|
||||
|
|
@ -91,7 +91,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
{
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.RootPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Label: "root",
|
||||
Mountpoint: "/",
|
||||
|
|
@ -113,7 +113,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
},
|
||||
{
|
||||
Size: 524288000, // 500 MB
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Mountpoint: "/boot",
|
||||
Label: "boot",
|
||||
|
|
@ -123,7 +123,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
},
|
||||
},
|
||||
{
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Mountpoint: "/",
|
||||
FSTabOptions: "defaults",
|
||||
|
|
@ -139,7 +139,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Partitions: []disk.Partition{
|
||||
{
|
||||
Size: 524288000, // 500 MB
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Mountpoint: "/boot",
|
||||
Label: "boot",
|
||||
|
|
@ -150,7 +150,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
},
|
||||
{
|
||||
Bootable: true,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Mountpoint: "/",
|
||||
FSTabOptions: "defaults",
|
||||
|
|
@ -177,7 +177,7 @@ var edgeBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 133169152, // 127 MB
|
||||
Type: disk.EFISystemPartitionGUID,
|
||||
UUID: disk.EFISystemPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "vfat",
|
||||
UUID: disk.EFIFilesystemUUID,
|
||||
Mountpoint: "/boot/efi",
|
||||
|
|
@ -191,7 +191,7 @@ var edgeBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 402653184, // 384 MB
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.FilesystemDataUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Mountpoint: "/boot",
|
||||
Label: "boot",
|
||||
|
|
@ -203,7 +203,7 @@ var edgeBasePartitionTables = distro.BasePartitionTableMap{
|
|||
{
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.RootPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Label: "root",
|
||||
Mountpoint: "/",
|
||||
|
|
@ -222,7 +222,7 @@ var edgeBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 133169152, // 127 MB
|
||||
Type: disk.EFISystemPartitionGUID,
|
||||
UUID: disk.EFISystemPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "vfat",
|
||||
UUID: disk.EFIFilesystemUUID,
|
||||
Mountpoint: "/boot/efi",
|
||||
|
|
@ -236,7 +236,7 @@ var edgeBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 402653184, // 384 MB
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.FilesystemDataUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Mountpoint: "/boot",
|
||||
Label: "boot",
|
||||
|
|
@ -248,7 +248,7 @@ var edgeBasePartitionTables = distro.BasePartitionTableMap{
|
|||
{
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.RootPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Label: "root",
|
||||
Mountpoint: "/",
|
||||
|
|
|
|||
|
|
@ -694,7 +694,7 @@ func simplifiedInstallerBootISOTreePipeline(archivePipelineName, kver string, rn
|
|||
{
|
||||
Start: 0,
|
||||
Size: 20971520,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "vfat",
|
||||
Mountpoint: "/",
|
||||
UUID: volid,
|
||||
|
|
@ -986,7 +986,7 @@ func mkfsStages(pt *disk.PartitionTable, device *osbuild.Device) []*osbuild.Stag
|
|||
}
|
||||
|
||||
for _, p := range pt.Partitions {
|
||||
if p.Filesystem == nil {
|
||||
if p.Payload == nil {
|
||||
// no filesystem for partition (e.g., BIOS boot)
|
||||
continue
|
||||
}
|
||||
|
|
@ -998,28 +998,28 @@ func mkfsStages(pt *disk.PartitionTable, device *osbuild.Device) []*osbuild.Stag
|
|||
Size: pt.BytesToSectors(p.Size),
|
||||
},
|
||||
)
|
||||
switch p.Filesystem.Type {
|
||||
switch p.Payload.Type {
|
||||
case "xfs":
|
||||
options := &osbuild.MkfsXfsStageOptions{
|
||||
UUID: p.Filesystem.UUID,
|
||||
Label: p.Filesystem.Label,
|
||||
UUID: p.Payload.UUID,
|
||||
Label: p.Payload.Label,
|
||||
}
|
||||
stage = osbuild.NewMkfsXfsStage(options, stageDevice)
|
||||
case "vfat":
|
||||
options := &osbuild.MkfsFATStageOptions{
|
||||
VolID: strings.Replace(p.Filesystem.UUID, "-", "", -1),
|
||||
VolID: strings.Replace(p.Payload.UUID, "-", "", -1),
|
||||
}
|
||||
stage = osbuild.NewMkfsFATStage(options, stageDevice)
|
||||
case "btrfs":
|
||||
options := &osbuild.MkfsBtrfsStageOptions{
|
||||
UUID: p.Filesystem.UUID,
|
||||
Label: p.Filesystem.Label,
|
||||
UUID: p.Payload.UUID,
|
||||
Label: p.Payload.Label,
|
||||
}
|
||||
stage = osbuild.NewMkfsBtrfsStage(options, stageDevice)
|
||||
case "ext4":
|
||||
options := &osbuild.MkfsExt4StageOptions{
|
||||
UUID: p.Filesystem.UUID,
|
||||
Label: p.Filesystem.Label,
|
||||
UUID: p.Payload.UUID,
|
||||
Label: p.Payload.Label,
|
||||
}
|
||||
stage = osbuild.NewMkfsExt4Stage(options, stageDevice)
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -450,11 +450,11 @@ func copyFSTreeOptions(inputName, inputPipeline string, pt *disk.PartitionTable,
|
|||
devices := make(map[string]osbuild.Device, len(pt.Partitions))
|
||||
mounts := make([]osbuild.Mount, 0, len(pt.Partitions))
|
||||
for _, p := range pt.Partitions {
|
||||
if p.Filesystem == nil {
|
||||
if p.Payload == nil {
|
||||
// no filesystem for partition (e.g., BIOS boot)
|
||||
continue
|
||||
}
|
||||
name := filepath.Base(p.Filesystem.Mountpoint)
|
||||
name := filepath.Base(p.Payload.Mountpoint)
|
||||
if name == "/" {
|
||||
name = "root"
|
||||
}
|
||||
|
|
@ -466,15 +466,15 @@ func copyFSTreeOptions(inputName, inputPipeline string, pt *disk.PartitionTable,
|
|||
},
|
||||
)
|
||||
var mount *osbuild.Mount
|
||||
switch p.Filesystem.Type {
|
||||
switch p.Payload.Type {
|
||||
case "xfs":
|
||||
mount = osbuild.NewXfsMount(name, name, p.Filesystem.Mountpoint)
|
||||
mount = osbuild.NewXfsMount(name, name, p.Payload.Mountpoint)
|
||||
case "vfat":
|
||||
mount = osbuild.NewFATMount(name, name, p.Filesystem.Mountpoint)
|
||||
mount = osbuild.NewFATMount(name, name, p.Payload.Mountpoint)
|
||||
case "ext4":
|
||||
mount = osbuild.NewExt4Mount(name, name, p.Filesystem.Mountpoint)
|
||||
mount = osbuild.NewExt4Mount(name, name, p.Payload.Mountpoint)
|
||||
case "btrfs":
|
||||
mount = osbuild.NewBtrfsMount(name, name, p.Filesystem.Mountpoint)
|
||||
mount = osbuild.NewBtrfsMount(name, name, p.Payload.Mountpoint)
|
||||
default:
|
||||
panic("unknown fs type " + p.Type)
|
||||
}
|
||||
|
|
@ -511,13 +511,13 @@ func grub2InstStageOptions(filename string, pt *disk.PartitionTable, platform st
|
|||
}
|
||||
bootPart := pt.Partitions[bootPartIndex]
|
||||
prefixPath := "/boot/grub2"
|
||||
if bootPart.Filesystem.Mountpoint == "/boot" {
|
||||
if bootPart.Payload.Mountpoint == "/boot" {
|
||||
prefixPath = "/grub2"
|
||||
}
|
||||
core := osbuild.CoreMkImage{
|
||||
Type: "mkimage",
|
||||
PartLabel: pt.Type,
|
||||
Filesystem: pt.Partitions[bootPartIndex].Filesystem.Type,
|
||||
Filesystem: pt.Partitions[bootPartIndex].Payload.Type,
|
||||
}
|
||||
|
||||
prefix := osbuild.PrefixPartition{
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 104857600,
|
||||
Type: disk.EFISystemPartitionGUID,
|
||||
UUID: disk.EFISystemPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "vfat",
|
||||
UUID: disk.EFIFilesystemUUID,
|
||||
Mountpoint: "/boot/efi",
|
||||
|
|
@ -43,7 +43,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
{
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.RootPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Label: "root",
|
||||
Mountpoint: "/",
|
||||
|
|
@ -63,7 +63,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 104857600,
|
||||
Type: disk.EFISystemPartitionGUID,
|
||||
UUID: disk.EFISystemPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "vfat",
|
||||
UUID: disk.EFIFilesystemUUID,
|
||||
Mountpoint: "/boot/efi",
|
||||
|
|
@ -75,7 +75,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
{
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.RootPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Label: "root",
|
||||
Mountpoint: "/",
|
||||
|
|
@ -97,7 +97,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Bootable: true,
|
||||
},
|
||||
{
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Mountpoint: "/",
|
||||
FSTabOptions: "defaults",
|
||||
|
|
@ -114,7 +114,7 @@ var defaultBasePartitionTables = distro.BasePartitionTableMap{
|
|||
Partitions: []disk.Partition{
|
||||
{
|
||||
Bootable: true,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Mountpoint: "/",
|
||||
FSTabOptions: "defaults",
|
||||
|
|
@ -141,7 +141,7 @@ var ec2BasePartitionTables = distro.BasePartitionTableMap{
|
|||
{
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.RootPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Label: "root",
|
||||
Mountpoint: "/",
|
||||
|
|
@ -161,7 +161,7 @@ var ec2BasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 209715200,
|
||||
Type: disk.EFISystemPartitionGUID,
|
||||
UUID: disk.EFISystemPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "vfat",
|
||||
UUID: disk.EFIFilesystemUUID,
|
||||
Mountpoint: "/boot/efi",
|
||||
|
|
@ -174,7 +174,7 @@ var ec2BasePartitionTables = distro.BasePartitionTableMap{
|
|||
Size: 536870912,
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.FilesystemDataUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Mountpoint: "/boot",
|
||||
FSTabOptions: "defaults",
|
||||
|
|
@ -185,7 +185,7 @@ var ec2BasePartitionTables = distro.BasePartitionTableMap{
|
|||
{
|
||||
Type: disk.FilesystemDataGUID,
|
||||
UUID: disk.RootPartitionUUID,
|
||||
Filesystem: &disk.Filesystem{
|
||||
Payload: &disk.Filesystem{
|
||||
Type: "xfs",
|
||||
Label: "root",
|
||||
Mountpoint: "/",
|
||||
|
|
|
|||
|
|
@ -1077,7 +1077,7 @@ func mkfsStages(pt *disk.PartitionTable, device *osbuild.Device) []*osbuild.Stag
|
|||
}
|
||||
|
||||
for _, p := range pt.Partitions {
|
||||
if p.Filesystem == nil {
|
||||
if p.Payload == nil {
|
||||
// no filesystem for partition (e.g., BIOS boot)
|
||||
continue
|
||||
}
|
||||
|
|
@ -1089,28 +1089,28 @@ func mkfsStages(pt *disk.PartitionTable, device *osbuild.Device) []*osbuild.Stag
|
|||
Size: pt.BytesToSectors(p.Size),
|
||||
},
|
||||
)
|
||||
switch p.Filesystem.Type {
|
||||
switch p.Payload.Type {
|
||||
case "xfs":
|
||||
options := &osbuild.MkfsXfsStageOptions{
|
||||
UUID: p.Filesystem.UUID,
|
||||
Label: p.Filesystem.Label,
|
||||
UUID: p.Payload.UUID,
|
||||
Label: p.Payload.Label,
|
||||
}
|
||||
stage = osbuild.NewMkfsXfsStage(options, stageDevice)
|
||||
case "vfat":
|
||||
options := &osbuild.MkfsFATStageOptions{
|
||||
VolID: strings.Replace(p.Filesystem.UUID, "-", "", -1),
|
||||
VolID: strings.Replace(p.Payload.UUID, "-", "", -1),
|
||||
}
|
||||
stage = osbuild.NewMkfsFATStage(options, stageDevice)
|
||||
case "btrfs":
|
||||
options := &osbuild.MkfsBtrfsStageOptions{
|
||||
UUID: p.Filesystem.UUID,
|
||||
Label: p.Filesystem.Label,
|
||||
UUID: p.Payload.UUID,
|
||||
Label: p.Payload.Label,
|
||||
}
|
||||
stage = osbuild.NewMkfsBtrfsStage(options, stageDevice)
|
||||
case "ext4":
|
||||
options := &osbuild.MkfsExt4StageOptions{
|
||||
UUID: p.Filesystem.UUID,
|
||||
Label: p.Filesystem.Label,
|
||||
UUID: p.Payload.UUID,
|
||||
Label: p.Payload.Label,
|
||||
}
|
||||
stage = osbuild.NewMkfsExt4Stage(options, stageDevice)
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -387,11 +387,11 @@ func copyFSTreeOptions(inputName, inputPipeline string, pt *disk.PartitionTable,
|
|||
devices := make(map[string]osbuild.Device, len(pt.Partitions))
|
||||
mounts := make([]osbuild.Mount, 0, len(pt.Partitions))
|
||||
for _, p := range pt.Partitions {
|
||||
if p.Filesystem == nil {
|
||||
if p.Payload == nil {
|
||||
// no filesystem for partition (e.g., BIOS boot)
|
||||
continue
|
||||
}
|
||||
name := filepath.Base(p.Filesystem.Mountpoint)
|
||||
name := filepath.Base(p.Payload.Mountpoint)
|
||||
if name == "/" {
|
||||
name = "root"
|
||||
}
|
||||
|
|
@ -403,15 +403,15 @@ func copyFSTreeOptions(inputName, inputPipeline string, pt *disk.PartitionTable,
|
|||
},
|
||||
)
|
||||
var mount *osbuild.Mount
|
||||
switch p.Filesystem.Type {
|
||||
switch p.Payload.Type {
|
||||
case "xfs":
|
||||
mount = osbuild.NewXfsMount(name, name, p.Filesystem.Mountpoint)
|
||||
mount = osbuild.NewXfsMount(name, name, p.Payload.Mountpoint)
|
||||
case "vfat":
|
||||
mount = osbuild.NewFATMount(name, name, p.Filesystem.Mountpoint)
|
||||
mount = osbuild.NewFATMount(name, name, p.Payload.Mountpoint)
|
||||
case "ext4":
|
||||
mount = osbuild.NewExt4Mount(name, name, p.Filesystem.Mountpoint)
|
||||
mount = osbuild.NewExt4Mount(name, name, p.Payload.Mountpoint)
|
||||
case "btrfs":
|
||||
mount = osbuild.NewBtrfsMount(name, name, p.Filesystem.Mountpoint)
|
||||
mount = osbuild.NewBtrfsMount(name, name, p.Payload.Mountpoint)
|
||||
default:
|
||||
panic("unknown fs type " + p.Type)
|
||||
}
|
||||
|
|
@ -449,7 +449,7 @@ func grub2InstStageOptions(filename string, pt *disk.PartitionTable, platform st
|
|||
core := osbuild.CoreMkImage{
|
||||
Type: "mkimage",
|
||||
PartLabel: pt.Type,
|
||||
Filesystem: pt.Partitions[bootPartIndex].Filesystem.Type,
|
||||
Filesystem: pt.Partitions[bootPartIndex].Payload.Type,
|
||||
}
|
||||
|
||||
prefix := osbuild.PrefixPartition{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue