debian-forge-composer/internal/pipeline/qemu_assembler.go
Tom Gundersen 4c892d6d32 pipeline/assembler/qemu: rework partition table handling
Move to the new options format, allowing more flexible partition
tables. The pipeline changes, but the result should be the same.

This requires a yet-to-be-released version of osbuild.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2019-12-14 17:23:31 +01:00

43 lines
1.4 KiB
Go

package pipeline
import "github.com/google/uuid"
// QEMUAssemblerOptions desrcibe how to assemble a tree into an image using qemu.
//
// The assembler creates an image of the given size, adds a GRUB2 bootloader
// and if necessary and a partition table to it with the given PTUUID
// containing the indicated partitions. Finally, the image is converted into
// the target format and stored with the given filename.
type QEMUAssemblerOptions struct {
Format string `json:"format"`
Filename string `json:"filename"`
Size uint64 `json:"size"`
PTUUID string `json:"ptuuid"`
PTType string `json:"pttype"`
Partitions []QEMUPartition `json:"partitions"`
}
type QEMUPartition struct {
Start uint64 `json:"start"`
Size uint64 `json:"size,omitempty"`
Type *uuid.UUID `json:"type,omitempty"`
Bootable bool `json:"bootable,omitempty"`
Filesystem QEMUFilesystem `json:"filesystem"`
}
type QEMUFilesystem struct {
Type string `json:"type"`
UUID string `json:"uuid"`
Label string `json:"label,omitempty"`
Mountpoint string `json:"mountpoint"`
}
func (QEMUAssemblerOptions) isAssemblerOptions() {}
// NewQEMUAssembler creates a new QEMU Assembler object.
func NewQEMUAssembler(options *QEMUAssemblerOptions) *Assembler {
return &Assembler{
Name: "org.osbuild.qemu",
Options: options,
}
}