unikraft

package
v0.7.0-39-gf553caf Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: BSD-3-Clause Imports: 9 Imported by: 1

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.

Index

Constants

View Source
const (
	// Environmental variables recognized by Unikraft's build system.
	UK_NAME          = "CONFIG_UK_NAME"
	UK_DEFNAME       = "CONFIG_UK_DEFNAME"
	UK_CONFIG        = "CONFIG_UK_CONFIG"
	UK_FULLVERSION   = "CONFIG_UK_FULLVERSION"
	UK_CODENAME      = "CONFIG_UK_CODENAME"
	UK_ARCH          = "CONFIG_UK_ARCH"
	UK_BASE          = "CONFIG_UK_BASE"
	UK_APP           = "CONFIG_UK_APP"
	UK_DEFCONFIG     = "UK_DEFCONFIG"
	KCONFIG_APP_DIR  = "KCONFIG_APP_DIR"
	KCONFIG_LIB_DIR  = "KCONFIG_LIB_DIR"
	KCONFIG_LIB_IN   = "KCONFIG_LIB_IN"
	KCONFIG_PLAT_DIR = "KCONFIG_PLAT_DIR"
	KCONFIG_PLAT_IN  = "KCONFIG_PLAT_IN"

	// Filenames which represent ecosystem files
	Config_uk     = "Config.uk"
	Exportsyms_uk = "exportsyms.uk"
	Linker_uk     = "Linker.uk"
	Localsyms_uk  = "localsyms.uk"
	Makefile_uk   = "Makefile.uk"

	// Standard Makefile.uk variables
	UK_PROVIDED_SYSCALLS = "UK_PROVIDED_SYSCALLS"

	// Built-in paths
	VendorDir = ".unikraft"
	BuildDir  = ".unikraft/build"
)

Variables

This section is empty.

Functions

func ComponentTypes

func ComponentTypes() map[string]ComponentType

func IsFileUnikraftUnikernel added in v0.6.0

func IsFileUnikraftUnikernel(path string) (bool, error)

IsFileUnikraftUnikernel is a utility method that determines whether the provided input file is a Unikraft unikernel. The file is checked with a number of known facts about the kernel image built with Unikraft.

func PlaceComponent

func PlaceComponent(workdir string, t ComponentType, name string) (string, error)

PlaceComponent is a universal source of truth for identifying the path to place a component

func TypeNameVersion added in v0.4.0

func TypeNameVersion(entity Nameable) string

TypeNameVersion returns the canonical name of the component using the format <TYPE>/<NAME>:<VERSION>

func WithContext added in v0.4.0

func WithContext(ctx context.Context, val *Context) context.Context

WithContext

Types

type ComponentType

type ComponentType string
const (
	ComponentTypeUnknown ComponentType = "unknown"
	ComponentTypeCore    ComponentType = "core"
	ComponentTypeArch    ComponentType = "arch"
	ComponentTypePlat    ComponentType = "plat"
	ComponentTypeLib     ComponentType = "lib"
	ComponentTypeApp     ComponentType = "app"
)

func GuessTypeNameVersion

func GuessTypeNameVersion(input string) (ComponentType, string, string, error)

GuessNameAndType attempts to parse the input string, which could be formatted such that its type, name and version are present

func (ComponentType) Plural

func (ct ComponentType) Plural() string

type Context added in v0.4.0

type Context struct {
	UK_NAME   string
	UK_BASE   string
	BUILD_DIR string
}

Context is a general-purpose context container for use within the Unikraft package. It mimics the environmental variables within Unikraft's main build system.

func FromContext added in v0.4.0

func FromContext(ctx context.Context) *Context

type Nameable added in v0.4.0

type Nameable interface {
	// Type returns the entity's static component type.
	Type() ComponentType

	// Name returns the entity name.
	Name() string

	// Version returns the entity version.
	Version() string

	// String returns a string representation of the component.
	fmt.Stringer
}

Nameable represents an abstract interface which can be cast to structures which contain canonical information about a component. This allows us to generate a string representation of the entity.

type ProvidedSyscall added in v0.4.0

type ProvidedSyscall struct {
	Name  string
	Nargs uint
}

ProvidedSyscall is a simple structure which contains the syscall name and the number of arguments which are accepted.

func NewProvidedSyscall added in v0.4.0

func NewProvidedSyscall(export string) *ProvidedSyscall

NewProvidedSyscall converts an exported `UK_PROVIDED_SYSCALL` entry into a standard `ProvidedSyscall` structure.

Directories

Path Synopsis
app
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
volume
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
export
v0/ukargparse
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
v0/uknetdev
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
v0/vfscore
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors.

Jump to

Keyboard shortcuts

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