Documentation ¶
Index ¶
- Constants
- Variables
- func GetConfigPath(path string) (string, error)
- type Builder
- func (b *Builder) AddBundles(bundles []string, allLocal bool, allUpstream bool, git bool) error
- func (b *Builder) AddRPMList(rpms []os.FileInfo) error
- func (b *Builder) BuildBundles(template *x509.Certificate, privkey *rsa.PrivateKey, signflag bool) error
- func (b *Builder) BuildDeltaPacks(from, to uint32, printReport bool) error
- func (b *Builder) BuildDeltaPacksPreviousVersions(prev, to uint32, printReport bool) error
- func (b *Builder) BuildImage(format string, template string) error
- func (b *Builder) BuildUpdate(prefixflag string, minVersion int, format string, skipSigning bool, ...) error
- func (b *Builder) DownloadFileFromUpstream(subpath string) (string, error)
- func (b *Builder) EditBundles(bundles []string, suppressEditor bool, add bool, git bool) error
- func (b *Builder) InitMix(upstreamVer string, mixVer string, allLocal bool, allUpstream bool, ...) error
- func (b *Builder) ListBundles(listType listType, tree bool) error
- func (b *Builder) LoadBuilderConf(builderconf string) error
- func (b *Builder) PrintVersions() error
- func (b *Builder) ReadVersions() error
- func (b *Builder) RemoveBundles(bundles []string, mix bool, local bool, git bool) error
- func (b *Builder) SignManifestMoM() error
- func (b *Builder) UpdateMixVer() error
- func (b *Builder) UpdateVersions(nextMix, nextUpstream uint32) error
- func (b *Builder) ValidateBundles(bundles []string, lvl ValidationLevel) error
- func (b *Builder) ValidateLocalBundles(lvl ValidationLevel) error
- type MixConfig
- func (config *MixConfig) Convert(filename string) error
- func (config *MixConfig) CreateDefaultConfig(localrpms bool) error
- func (config *MixConfig) LoadConfig(filename string) error
- func (config *MixConfig) LoadDefaults() error
- func (config *MixConfig) Parse(filename string) error
- func (config *MixConfig) Print() error
- func (config *MixConfig) SaveConfig(filename string) error
- type ValidationLevel
Constants ¶
const ( MixList listType = iota // List bundles in the mix (with includes) LocalList // List bundles available locally UpstreamList // List bundles available upstream )
Enum of available list types
const Version = "4.3.0"
Version of Mixer. Also used by the Makefile for releases.
Variables ¶
var Offline = false
Offline controls whether mixer attempts to automatically cache upstream bundles. In offline mode, all necessary bundles must exist in local-bundles.
var UseNewConfig = false
UseNewConfig controls whether to use the new TOML config format. This is an experimental feature.
Functions ¶
func GetConfigPath ¶
GetConfigPath returns the default config path if the provided path is empty
Types ¶
type Builder ¶
type Builder struct { Config MixConfig BuildScript string BuildConf string MixVer string MixVerFile string MixBundlesFile string LocalPackagesFile string UpstreamURL string UpstreamURLFile string UpstreamVer string UpstreamVerFile string Signing int Bump int NumFullfileWorkers int NumDeltaWorkers int NumBundleWorkers int // Parsed versions. MixVerUint32 uint32 UpstreamVerUint32 uint32 }
A Builder contains all configurable fields required to perform a full mix operation, and is used to encapsulate life time data.
func New ¶
func New() *Builder
New will return a new instance of Builder with some predetermined sane default values.
func NewFromConfig ¶
NewFromConfig creates a new Builder with the given Configuration.
func (*Builder) AddBundles ¶
AddBundles adds the specified bundles to the Mix Bundles List. Values are verified as valid, and duplicate values are removed. The resulting Mix Bundles List will be in sorted order.
func (*Builder) AddRPMList ¶
AddRPMList copies rpms into the repodir and calls createrepo_c on it to generate a dnf-consumable repository for the bundle builder to use.
func (*Builder) BuildBundles ¶
func (b *Builder) BuildBundles(template *x509.Certificate, privkey *rsa.PrivateKey, signflag bool) error
BuildBundles will attempt to construct the bundles required by generating a DNF configuration file, then resolving all files for each bundle using dnf resolve and no-op installs. One full chroot is created from this step with the file contents of all bundles.
func (*Builder) BuildDeltaPacks ¶
BuildDeltaPacks between two versions of the mix.
func (*Builder) BuildDeltaPacksPreviousVersions ¶
BuildDeltaPacksPreviousVersions builds packs to version from up to prev versions. It walks the Manifest "previous" field to find those from versions.
func (*Builder) BuildImage ¶
BuildImage will now proceed to build the full image with the previously validated configuration.
func (*Builder) BuildUpdate ¶
func (b *Builder) BuildUpdate(prefixflag string, minVersion int, format string, skipSigning bool, publish bool, keepChroots bool) error
BuildUpdate will produce an update consumable by the swupd client
func (*Builder) DownloadFileFromUpstream ¶
DownloadFileFromUpstream will download a file from the Upstream URL joined with the passed subpath. It will trim spaces from the result.
func (*Builder) EditBundles ¶
EditBundles copies a list of bundles from upstream-bundles to local-bundles (if they are not already there) or creates a blank template if they are new, and launches an editor to edit them. Passing true for 'suppressEditor' will suppress the launching of the editor (and just do the copy or create, if needed), and 'add' will also add the bundles to the mix.
func (*Builder) InitMix ¶
func (b *Builder) InitMix(upstreamVer string, mixVer string, allLocal bool, allUpstream bool, upstreamURL string, git bool) error
InitMix will initialise a new swupd-client consumable "mix" with the given based Clear Linux version and specified mix version.
func (*Builder) ListBundles ¶
ListBundles prints out a bundle list in either a flat list or tree view
func (*Builder) LoadBuilderConf ¶
LoadBuilderConf will read the builder configuration from the command line if it was provided, otherwise it will fall back to reading the configuration from the local builder.conf file.
func (*Builder) PrintVersions ¶
PrintVersions prints the current mix and upstream versions, and the latest version of upstream.
func (*Builder) ReadVersions ¶
ReadVersions will initialise the mix versions (mix and clearlinux) from the configuration files in the version directory.
func (*Builder) RemoveBundles ¶
RemoveBundles removes a list of bundles from the Mix Bundles List. If a bundle is not present, it is skipped. If 'local' is passed, the corresponding bundle file is removed from local-bundles. Note that this is an irreversible step. The Mix Bundles List is validated when read in, and the resulting Mix Bundles List will be in sorted order.
func (*Builder) SignManifestMoM ¶
SignManifestMoM will sign the Manifest.MoM file in in place based on the Mix version read from builder.conf.
func (*Builder) UpdateMixVer ¶
UpdateMixVer automatically bumps the mixversion file +10 to prepare for the next build without requiring user intervention. This makes the flow slightly more automatable.
func (*Builder) UpdateVersions ¶
UpdateVersions will validate then update both mix and upstream versions. If upstream version is 0, then the latest upstream version possible will be taken instead.
func (*Builder) ValidateBundles ¶
func (b *Builder) ValidateBundles(bundles []string, lvl ValidationLevel) error
ValidateBundles runs bundle parsing validation on a list of local bundles. In addition to parsing errors, errors are generated if the bundle is not found in local-bundles.
func (*Builder) ValidateLocalBundles ¶
func (b *Builder) ValidateLocalBundles(lvl ValidationLevel) error
ValidateLocalBundles runs bundle parsing validation on all local bundles.
type MixConfig ¶
type MixConfig struct { Builder builderConf Swupd swupdConf Server serverConf Mixer mixerConf }
MixConfig represents the config parameters found in the builder config file.
func (*MixConfig) CreateDefaultConfig ¶
CreateDefaultConfig creates a default builder.conf using the active directory as base path for the variables values.
func (*MixConfig) LoadConfig ¶
LoadConfig loads a configuration file from a provided path or from local directory is none is provided
func (*MixConfig) LoadDefaults ¶
LoadDefaults sets sane values for the config properties
func (*MixConfig) Parse ¶
Parse reads the values from a config file without performing validation or env expansion
func (*MixConfig) SaveConfig ¶
SaveConfig saves the properties in MixConfig to a TOML config file
type ValidationLevel ¶
type ValidationLevel int
ValidationLevel represents a specific validation level
const ( BasicValidation ValidationLevel = iota StrictValidation )
Enum of available validation levels