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>
24 lines
472 B
Go
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"
|
|
}
|