debian-forge-composer/internal/distro/fedora30/ami.go
Tom Gundersen 382d4e2118 distro/f30/ami: make the images boot on aws
This makes the image in line whith the ones produced by lorax.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2019-11-26 22:00:04 +01:00

47 lines
1.1 KiB
Go

package fedora30
import (
"github.com/osbuild/osbuild-composer/internal/blueprint"
"github.com/osbuild/osbuild-composer/internal/pipeline"
)
type amiOutput struct{}
func (t *amiOutput) translate(b *blueprint.Blueprint) (*pipeline.Pipeline, error) {
packages := [...]string{
"@Core",
"chrony",
"kernel",
"selinux-policy-targeted",
"grub2-pc",
"langpacks-en",
"libxcrypt-compat",
"xfsprogs",
"cloud-init",
"checkpolicy",
"net-tools",
}
excludedPackages := [...]string{
"dracut-config-rescue",
}
p := newF30Pipeline(packages[:], excludedPackages[:], b)
err := customizeAll(p, b.Customizations)
if err != nil {
return nil, err
}
setFilesystems(p)
setBootloader(p, "ro no_timer_check console=ttyS0,115200n8 console=tty1 biosdevname=0 net.ifnames=0 console=ttyS0,115200", b)
setFirewall(p, nil, nil, b)
setServices(p, []string{"cloud-init.service"}, nil, b)
setQemuAssembler(p, "raw", t.getName())
return p, nil
}
func (t *amiOutput) getName() string {
return "image.ami"
}
func (t *amiOutput) getMime() string {
return "application/octet-stream"
}