debian-forge-composer/internal/blueprint/disk_output.go
Tom Gundersen b1688cda76 blueprint: add infrastructure for translating to blueprints
Each output type will have its own translator from a blueprint to
a pipeline.

In the future, we may also want to distinguish between different
base distributions and architectures, but for now we keep it
simple and hardcode to a given one.

Some placeholder output formats are added, these have not been
tested or reserached, but are included to show how the it will
all fit together.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2019-10-05 20:44:32 +02:00

24 lines
472 B
Go

package blueprint
import "osbuild-composer/internal/pipeline"
type diskOutput struct{}
func (t *diskOutput) translate(b *Blueprint) *pipeline.Pipeline {
p := &pipeline.Pipeline{}
p.SetAssembler(
pipeline.NewQEMUAssembler(
&pipeline.QEMUAssemblerOptions{
Format: "raw",
Filename: t.getName(),
}))
return p
}
func (t *diskOutput) getName() string {
return "image.img"
}
func (t *diskOutput) getMime() string {
return "application/octet-stream"
}