-
Notifications
You must be signed in to change notification settings - Fork 61
/
runtime.go
70 lines (54 loc) · 1.65 KB
/
runtime.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// 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.
package runtime
import (
"kraftkit.sh/kconfig"
"kraftkit.sh/pack"
"kraftkit.sh/packmanager"
"kraftkit.sh/unikraft"
)
type Runtime struct {
registry packmanager.PackageManager
// Path to the kernel of the ELF loader.
kernel string
// The package representing the ELF Loader.
pack pack.Package
// The name of the elfloader.
name string
// The version of the elfloader.
version string
// The source of the elfloader (can be either remote or local, this attribute
// is ultimately handled by the packmanager).
source string
// List of kconfig key-values specific to this core.
kconfig kconfig.KeyValueMap
// The rootfs (initramfs) of the ELF loader.
rootfs string
}
var _ unikraft.Nameable = (*Runtime)(nil)
// Type implements kraftkit.sh/unikraft.Nameable
func (elfloader *Runtime) Type() unikraft.ComponentType {
return unikraft.ComponentTypeApp
}
// Name implements kraftkit.sh/unikraft.Nameable
func (elfloader *Runtime) Name() string {
return elfloader.name
}
// SetName overwrites the name of the runtime.
func (elfloader *Runtime) SetName(name string) {
elfloader.name = name
}
// String implements fmt.Stringer
func (ocipack *Runtime) String() string {
return ocipack.pack.Name()
}
// Version implements kraftkit.sh/unikraft.Nameable
func (elfloader *Runtime) Version() string {
return elfloader.version
}
// Source of the ELF Loader runtime.
func (elfloader *Runtime) Source() string {
return elfloader.source
}