Documentation ¶
Overview ¶
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.
Index ¶
- Variables
- func KernelDbgName(target TargetConfig) (string, error)
- func KernelName(target TargetConfig) (string, error)
- func TargetPlatArchName(target Target) string
- func TransformFromSchema(ctx context.Context, data interface{}) (interface{}, error)
- type Command
- type Env
- type Target
- type TargetConfig
- func (tc *TargetConfig) Architecture() arch.Architecture
- func (tc *TargetConfig) Command() []string
- func (tc *TargetConfig) ConfigFilename() string
- func (tc *TargetConfig) Initrd() initrd.Initrd
- func (tc *TargetConfig) IsUnpacked() bool
- func (tc *TargetConfig) KConfig() kconfig.KeyValueMap
- func (tc *TargetConfig) KConfigTree(_ context.Context, env ...*kconfig.KeyValue) (*kconfig.KConfigFile, error)
- func (tc *TargetConfig) Kernel() string
- func (tc *TargetConfig) KernelDbg() string
- func (tc TargetConfig) MarshalYAML() (interface{}, error)
- func (tc *TargetConfig) Name() string
- func (tc *TargetConfig) Path() string
- func (tc *TargetConfig) Platform() plat.Platform
- func (tc *TargetConfig) PrintInfo(ctx context.Context) string
- func (tc *TargetConfig) Source() string
- func (tc *TargetConfig) String() string
- func (tc *TargetConfig) Type() unikraft.ComponentType
- func (tc *TargetConfig) Version() string
- type TargetOption
- func WithArchitecture(arch arch.Architecture) TargetOption
- func WithCommand(command []string) TargetOption
- func WithInitrd(initrd initrd.Initrd) TargetOption
- func WithKConfig(kconfig kconfig.KeyValueMap) TargetOption
- func WithKernel(kernel string) TargetOption
- func WithKernelDbg(kernelDbg string) TargetOption
- func WithName(name string) TargetOption
- func WithPlatform(platform plat.Platform) TargetOption
Constants ¶
This section is empty.
Variables ¶
var DefaultKraftCloudTarget = NewTargetFromOptions( WithArchitecture(arch.NewArchitectureFromOptions(arch.WithName("x86_64"))), WithPlatform(plat.NewPlatformFromOptions(plat.WithName("kraftcloud"))), )
DefaultKraftCloudTarget is the default target for KraftCloud.
Functions ¶
func KernelDbgName ¶ added in v0.3.0
func KernelDbgName(target TargetConfig) (string, error)
KernelDbgName is identical to KernelName but is used to access the symbolic kernel image which has not been stripped.
func KernelName ¶ added in v0.3.0
func KernelName(target TargetConfig) (string, error)
TargetName returns the name of the kernel image based on standard pattern which is baked within Unikraft's build system, see for example `KVM_IMAGE`. If we do not have a target name, return an error.
func TargetPlatArchName ¶ added in v0.5.0
TargetPlatArchName returns the canonical name for the platform and architecture combination.
func TransformFromSchema ¶ added in v0.4.0
Types ¶
type Target ¶ added in v0.4.0
type Target interface { component.Component // Architecture is the component architecture for this target. Architecture() arch.Architecture // Platform is the component platform for this target. Platform() plat.Platform // Kernel is the path to the kernel for this target. Kernel() string // KernelDbg is the path to the symbolic (unstripped) kernel for this target. KernelDbg() string // Initrd contains the initramfs configuration for this target. Initrd() initrd.Initrd // Command is the command-line arguments set for this target. Command() []string // ConfigFilename returns the target-specific `.config` file which contains // all the porclained KConfig key values which is formatted // `.config.<TARGET-NAME>` ConfigFilename() string }
func Filter ¶ added in v0.6.5
Filter returns a subset of `targets` based in input strings `arch`, `plat` and/or `targ`
func NewTargetFromOptions ¶ added in v0.5.1
func NewTargetFromOptions(opts ...TargetOption) Target
NewTargetFromOptions is a constructor for TargetConfig.
type TargetConfig ¶
type TargetConfig struct {
// contains filtered or unexported fields
}
func (*TargetConfig) Architecture ¶
func (tc *TargetConfig) Architecture() arch.Architecture
func (*TargetConfig) Command ¶
func (tc *TargetConfig) Command() []string
func (*TargetConfig) ConfigFilename ¶ added in v0.5.0
func (tc *TargetConfig) ConfigFilename() string
func (*TargetConfig) Initrd ¶
func (tc *TargetConfig) Initrd() initrd.Initrd
func (*TargetConfig) IsUnpacked ¶ added in v0.4.0
func (tc *TargetConfig) IsUnpacked() bool
func (*TargetConfig) KConfig ¶ added in v0.4.0
func (tc *TargetConfig) KConfig() kconfig.KeyValueMap
func (*TargetConfig) KConfigTree ¶ added in v0.4.0
func (tc *TargetConfig) KConfigTree(_ context.Context, env ...*kconfig.KeyValue) (*kconfig.KConfigFile, error)
func (*TargetConfig) Kernel ¶
func (tc *TargetConfig) Kernel() string
func (*TargetConfig) KernelDbg ¶
func (tc *TargetConfig) KernelDbg() string
func (TargetConfig) MarshalYAML ¶ added in v0.6.4
func (tc TargetConfig) MarshalYAML() (interface{}, error)
MarshalYAML makes TargetConfig implement yaml.Marshaller
func (*TargetConfig) Name ¶
func (tc *TargetConfig) Name() string
func (*TargetConfig) Path ¶ added in v0.4.0
func (tc *TargetConfig) Path() string
func (*TargetConfig) Platform ¶
func (tc *TargetConfig) Platform() plat.Platform
func (*TargetConfig) Source ¶
func (tc *TargetConfig) Source() string
func (*TargetConfig) String ¶ added in v0.7.0
func (tc *TargetConfig) String() string
func (*TargetConfig) Type ¶
func (tc *TargetConfig) Type() unikraft.ComponentType
func (*TargetConfig) Version ¶
func (tc *TargetConfig) Version() string
type TargetOption ¶ added in v0.5.1
type TargetOption func(*TargetConfig)
TargetOption is a function that modifies a TargetConfig.
func WithArchitecture ¶ added in v0.5.1
func WithArchitecture(arch arch.Architecture) TargetOption
WithVersion sets the version of the target.
func WithCommand ¶ added in v0.5.1
func WithCommand(command []string) TargetOption
WithCommand sets the command of the target.
func WithInitrd ¶ added in v0.5.1
func WithInitrd(initrd initrd.Initrd) TargetOption
WithInitrd sets the initrd of the target.
func WithKConfig ¶ added in v0.5.1
func WithKConfig(kconfig kconfig.KeyValueMap) TargetOption
WithKConfig sets the kconfig of the target.
func WithKernel ¶ added in v0.5.1
func WithKernel(kernel string) TargetOption
WithKernel sets the kernel of the target.
func WithKernelDbg ¶ added in v0.5.1
func WithKernelDbg(kernelDbg string) TargetOption
WithKernelDbg sets the kernel debug of the target.
func WithName ¶ added in v0.5.1
func WithName(name string) TargetOption
WithName sets the name of the target.
func WithPlatform ¶ added in v0.5.1
func WithPlatform(platform plat.Platform) TargetOption
WithPlatform sets the platform of the target.