From 41f6e428af5b872cdc6f8ae9d6f064a620d518ef Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Thu, 30 Jun 2022 13:13:30 +0100 Subject: [PATCH] manifest: build packages - move over anaconda pkgs squashfs-tools is used by the mono stage, and lorax by lorax. For now copy over the anaconda boot package set as-is, we can refactor further from the pipelines. --- internal/distro/fedora/package_sets.go | 15 +-------- internal/manifest/anaconda.go | 45 ++++++++++++++++++++++++++ internal/manifest/iso_tree.go | 1 + 3 files changed, 47 insertions(+), 14 deletions(-) diff --git a/internal/distro/fedora/package_sets.go b/internal/distro/fedora/package_sets.go index 0c1d91063..9fcf08652 100644 --- a/internal/distro/fedora/package_sets.go +++ b/internal/distro/fedora/package_sets.go @@ -103,21 +103,8 @@ func anacondaBootPackageSet(t *imageType) rpmmd.PackageSet { return ps } -func anacondaBuildPackageSet(t *imageType) rpmmd.PackageSet { - ps := rpmmd.PackageSet{ - Include: []string{ - "squashfs-tools", - "lorax-templates-generic", - }, - } - - ps = ps.Append(anacondaBootPackageSet(t)) - - return ps -} - func iotInstallerBuildPackageSet(t *imageType) rpmmd.PackageSet { - return anacondaBuildPackageSet(t) + return rpmmd.PackageSet{} } // BOOT PACKAGE SETS diff --git a/internal/manifest/anaconda.go b/internal/manifest/anaconda.go index c4ef00d09..c6d0bad94 100644 --- a/internal/manifest/anaconda.go +++ b/internal/manifest/anaconda.go @@ -1,6 +1,8 @@ package manifest import ( + "fmt" + "github.com/osbuild/osbuild-composer/internal/osbuild2" "github.com/osbuild/osbuild-composer/internal/rpmmd" ) @@ -60,6 +62,49 @@ func NewAnacondaPipeline(m *Manifest, return p } +// TODO: refactor - what is required to boot and what to build, and +// do they all belong in this pipeline? +func (p *AnacondaPipeline) anacondaBootPackageSet() []string { + packages := []string{ + "grub2-tools", + "grub2-tools-extra", + "grub2-tools-minimal", + "efibootmgr", + } + + // TODO: use constants for architectures + switch p.arch { + case "x86_64": + packages = append(packages, + "grub2-efi-x64", + "grub2-efi-x64-cdboot", + "grub2-pc", + "grub2-pc-modules", + "shim-x64", + "syslinux", + "syslinux-nonlinux", + ) + case "aarch64": + packages = append(packages, + "grub2-efi-aa64-cdboot", + "grub2-efi-aa64", + "shim-aa64", + ) + default: + panic(fmt.Sprintf("unsupported arch: %s", p.arch)) + } + + return packages +} + +func (p *AnacondaPipeline) getBuildPackages() []string { + packages := p.anacondaBootPackageSet() + packages = append(packages, + "lorax-templates-generic", + ) + return packages +} + func (p *AnacondaPipeline) getPackageSetChain() []rpmmd.PackageSet { packages := []string{} return []rpmmd.PackageSet{ diff --git a/internal/manifest/iso_tree.go b/internal/manifest/iso_tree.go index 61163cbee..8e93437a8 100644 --- a/internal/manifest/iso_tree.go +++ b/internal/manifest/iso_tree.go @@ -66,6 +66,7 @@ func (p *ISOTreePipeline) getOSTreeCommits() []osTreeCommit { func (p *ISOTreePipeline) getBuildPackages() []string { packages := []string{ "rpm-ostree", + "squashfs-tools", } return packages }