This commit adds integration for the ostree options. It is modelled
loosely after weldr-client/composer-cli and the
```
start-ostree --{ref,parent,url}
```
and uses
```
--ostree-{ref,parent,url}
```
A simple smoke test is provided that uses fedora-iot. Ideas welcome
for an easier way :)
38 lines
923 B
Go
38 lines
923 B
Go
package main
|
|
|
|
import (
|
|
"io"
|
|
|
|
"github.com/osbuild/images/pkg/distro"
|
|
"github.com/osbuild/images/pkg/imagefilter"
|
|
"github.com/osbuild/images/pkg/ostree"
|
|
|
|
"github.com/osbuild/image-builder-cli/internal/blueprintload"
|
|
"github.com/osbuild/image-builder-cli/internal/manifestgen"
|
|
)
|
|
|
|
func generateManifest(dataDir, blueprintPath string, res *imagefilter.Result, output io.Writer, ostreeOpts *ostree.ImageOptions) error {
|
|
repos, err := newRepoRegistry(dataDir)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// XXX: add --rpmmd/cachedir option like bib
|
|
mg, err := manifestgen.New(repos, &manifestgen.Options{
|
|
Output: output,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
bp, err := blueprintload.Load(blueprintPath)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
var imgOpts *distro.ImageOptions
|
|
if ostreeOpts != nil {
|
|
imgOpts = &distro.ImageOptions{
|
|
OSTree: ostreeOpts,
|
|
}
|
|
}
|
|
|
|
return mg.Generate(bp, res.Distro, res.ImgType, res.Arch, imgOpts)
|
|
}
|