ops

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2025 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserAgent = "AuroraBoot"
)

Variables

This section is empty.

Functions

func ConvertRawDiskToGCE added in v0.2.4

func ConvertRawDiskToGCE(src string) func(ctx context.Context) error

func ConvertRawDiskToVHD added in v0.2.4

func ConvertRawDiskToVHD(src string) func(ctx context.Context) error

func DownloadArtifact

func DownloadArtifact(url string, isoFunc valueGetOnCall) func(ctx context.Context) error

DownloadArtifact downloads artifacts remotely (e.g. http(s), ...)

func DumpSource added in v0.3.2

func DumpSource(image string, dstFunc valueGetOnCall) func(ctx context.Context) error

DumpSource pulls a container image either remotely or locally from a docker daemon or simply copies the directory to the destination. Supports these prefixes: https://github.com/kairos-io/kairos-agent/blob/1e81cdef38677c8a36cae50d3334559976f66481/pkg/types/v1/common.go#L30-L33

func ExtractNetboot

func ExtractNetboot(isoFunc, dstFunc valueGetOnCall, prefix string) func(ctx context.Context) error

ExtractNetboot extracts all the required netbooting artifacts isoFunc is a function that returns the path to the ISO file we need the function to be passed so its executed in the context of the deployer as otherwise the ISO file might not be available at the time of the call

func ExtractSquashFS added in v0.2.4

func ExtractSquashFS(srcFunc, dstFunc valueGetOnCall) func(ctx context.Context) error

func GenBiosRawDisk added in v0.4.4

func GenBiosRawDisk(src, dst string, size uint64, stateSize int64) func(ctx context.Context) error

func GenEFIRawDisk added in v0.2.7

func GenEFIRawDisk(src, dst string, size uint64, stateSize int64) func(ctx context.Context) error

func GenISO

func GenISO(srcFunc, dstFunc valueGetOnCall, i schema.ISO) func(ctx context.Context) error

GenISO generates an ISO from a rootfs, and stores results in dst

func InjectISO added in v0.2.0

func InjectISO(dstFunc, isoFunc valueGetOnCall, i schema.ISO) func(ctx context.Context) error

func NewConfig added in v0.3.1

func NewConfig(opts ...GenericOptions) *agentconfig.Config

func Raw2Azure added in v0.4.4

func Raw2Azure(source string) (string, error)

Raw2Azure converts a raw disk to a VHD disk compatible with Azure All VHDs on Azure must have a virtual size aligned to 1 MB (1024 × 1024 bytes) The Hyper-V virtual hard disk (VHDX) format isn't supported in Azure, only fixed VHD

func Raw2Gce added in v0.4.4

func Raw2Gce(source string) (string, error)

Raw2Gce transforms an image from RAW format into GCE format The RAW image file must have a size in an increment of 1 GB. For example, the file must be either 10 GB or 11 GB but not 10.5 GB. The disk image filename must be disk.raw. The compressed file must be a .tar.gz file that uses gzip compression and the --format=oldgnu option for the tar utility.

func ServeArtifacts

func ServeArtifacts(listenAddr string, dirFunc valueGetOnCall) func(ctx context.Context) error

ServeArtifacts serve local artifacts as standard http server

func StartPixiecore added in v0.2.0

func StartPixiecore(cloudConfigFile, address, netbootPort string, squashFSfileGet, initrdFileGet, kernelFileGet valueGetOnCall, nb schema.NetBoot) func(ctx context.Context) error

func WithImageExtractor added in v0.3.1

func WithImageExtractor(extractor v1types.ImageExtractor) func(r *agentconfig.Config) error

func WithLogger added in v0.3.1

func WithLogger(logger sdkTypes.KairosLogger) func(r *agentconfig.Config) error

Types

type BuildConfig added in v0.3.1

type BuildConfig struct {
	Date   bool   `yaml:"date,omitempty" mapstructure:"date"`
	Name   string `yaml:"name,omitempty" mapstructure:"name"`
	OutDir string `yaml:"output,omitempty" mapstructure:"output"`

	// 'inline' and 'squash' labels ensure config fields
	// are embedded from a yaml and map PoV
	agentconfig.Config `yaml:",inline" mapstructure:",squash"`
}

BuildConfig represents the config we need for building isos, raw images, artifacts

func NewBuildConfig added in v0.3.1

func NewBuildConfig(opts ...GenericOptions) *BuildConfig

type BuildISOAction added in v0.3.1

type BuildISOAction struct {
	// contains filtered or unexported fields
}

func NewBuildISOAction added in v0.3.1

func NewBuildISOAction(cfg *BuildConfig, spec *LiveISO, opts ...BuildISOActionOption) *BuildISOAction

func (*BuildISOAction) ISORun added in v0.3.1

func (b *BuildISOAction) ISORun() (err error)

ISORun will install the system from a given configuration

type BuildISOActionOption added in v0.3.1

type BuildISOActionOption func(a *BuildISOAction)

type GenericOptions added in v0.3.1

type GenericOptions func(a *agentconfig.Config) error

type LiveISO added in v0.3.1

type LiveISO struct {
	RootFS             []*v1types.ImageSource `yaml:"rootfs,omitempty" mapstructure:"rootfs"`
	UEFI               []*v1types.ImageSource `yaml:"uefi,omitempty" mapstructure:"uefi"`
	Image              []*v1types.ImageSource `yaml:"image,omitempty" mapstructure:"image"`
	Label              string                 `yaml:"label,omitempty" mapstructure:"label"`
	GrubEntry          string                 `yaml:"grub-entry-name,omitempty" mapstructure:"grub-entry-name"`
	BootloaderInRootFs bool                   `yaml:"bootloader-in-rootfs" mapstructure:"bootloader-in-rootfs"`
}

type RawImage added in v0.4.4

type RawImage struct {
	CloudConfig string // cloud config to copy to the oem partition, if none provided a default one will be created with the kairos user
	Source      string // Source image to copy the artifacts from, which will be the rootfs in the final image
	Output      string // Output image destination dir. Final image name will be based on the contents of the source /etc/kairos-release file
	FinalSize   uint64 // Final size of the disk image in MB
	StateSize   int64  // Size of the state partition in MB
	// contains filtered or unexported fields
}

func NewBiosRawImage added in v0.4.4

func NewBiosRawImage(source, output string, cc string, finalsize uint64, stateSize int64) *RawImage

func NewEFIRawImage added in v0.4.4

func NewEFIRawImage(source, output, cc string, finalsize uint64, stateSize int64) *RawImage

NewEFIRawImage creates a new RawImage struct config is initialized with a default config to use the standard logger

func (*RawImage) Build added in v0.4.4

func (r *RawImage) Build() error

func (*RawImage) CopyAlpineShimAndGrub added in v0.5.1

func (r *RawImage) CopyAlpineShimAndGrub(arch, target string) error

CopyAlpineShimAndGrub copies the grub.efi to the shim place and also to the grub place As alpine does not provide a shim, we need to copy the grub.efi to the shim place so we have the same behaviour as in other flavors

func (*RawImage) FinalizeImage added in v0.4.4

func (r *RawImage) FinalizeImage(image string) error

FinalizeImage does some final adjustments to the image

func (*RawImage) GetModelAndFlavor added in v0.4.4

func (r *RawImage) GetModelAndFlavor() (string, string, error)

GetModelAndFlavor returns the model and flavor of the source rootfs

func (*RawImage) TempDir added in v0.4.4

func (r *RawImage) TempDir() string

type VHDHeader added in v0.4.4

type VHDHeader struct {
	Cookie             [8]byte   // Cookies are used to uniquely identify the original creator of the hard disk image
	Features           [4]byte   // This is a bit field used to indicate specific feature support. Can be 0x00000000 (no features), 0x00000001 (Temporary, candidate for deletion on shutdown) or 0x00000002 (Reserved)
	FileFormatVersion  [4]byte   // Divided into a major/minor version and matches the version of the specification used in creating the file.
	DataOffset         [8]byte   // For fixed disks, this field should be set to 0xFFFFFFFF.
	Timestamp          [4]byte   // Stores the creation time of a hard disk image. This is the number of seconds since January 1, 2000 12:00:00 AM in UTC/GMT.
	CreatorApplication [4]byte   // Used to document which application created the hard disk.
	CreatorVersion     [4]byte   // This field holds the major/minor version of the application that created the hard disk image.
	CreatorHostOS      [4]byte   // This field stores the type of host operating system this disk image is created on.
	OriginalSize       [8]byte   // This field stores the size of the hard disk in bytes, from the perspective of the virtual machine, at creation time. Info only
	CurrentSize        [8]byte   // This field stores the current size of the hard disk, in bytes, from the perspective of the virtual machine.
	DiskGeometry       [4]byte   // This field stores the cylinder, heads, and sectors per track value for the hard disk.
	DiskType           [4]byte   // Fixed = 2, Dynamic = 3, Differencing = 4
	Checksum           [4]byte   // This field holds a basic checksum of the hard disk footer. It is just a one’s complement of the sum of all the bytes in the footer without the checksum field.
	UniqueID           [16]byte  // This is a 128-bit universally unique identifier (UUID).
	SavedState         [1]byte   // This field holds a one-byte flag that describes whether the system is in saved state. If the hard disk is in the saved state the value is set to 1
	Reserved           [427]byte // This field contains zeroes.
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL