debian-forge-composer/internal/pipeline/qemu_assembler.go
Lars Karlitski da311f13eb distro: add rhel82
This takes a different approach to outputs and customizations, which is
much shorter and duplicates less code.

This uses links to internal repositories for now, because 8.2 hasn't
been released yet.

Add a `distro` flag to `osbuild-pipeline`.
2019-11-27 17:08:51 +01:00

41 lines
1.5 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 a the given size, adds a GRUB2 bootloader
// and a DOS partition table to it with the given PTUUID containing one ext4
// root partition with the given filesystem UUID and installs the filesystem
// tree into it. 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"`
PTUUID string `json:"ptuuid"`
RootFilesystemUUDI uuid.UUID `json:"root_fs_uuid"`
RootFilesystemType string `json:"root_fs_type"`
Size uint64 `json:"size"`
}
func (QEMUAssemblerOptions) isAssemblerOptions() {}
// NewQEMUAssemblerOptions creates a now QEMUAssemblerOptions object, with all the mandatory
// fields set.
func NewQEMUAssemblerOptions(format string, ptUUID string, filename string, rootFilesystemUUID uuid.UUID, size uint64) *QEMUAssemblerOptions {
return &QEMUAssemblerOptions{
Format: format,
PTUUID: ptUUID,
Filename: filename,
RootFilesystemUUDI: rootFilesystemUUID,
Size: size,
}
}
// NewQEMUAssembler creates a new QEMU Assembler object.
func NewQEMUAssembler(options *QEMUAssemblerOptions) *Assembler {
return &Assembler{
Name: "org.osbuild.qemu",
Options: options,
}
}