Documentation ¶
Index ¶
- Variables
- func AddKernel(ctx context.Context, log *logrus.Logger, dir string, cnf *KernelConf, ...) error
- func BuildKernel(ctx context.Context, log *logrus.Logger, dir, kname string, fetch bool) error
- func CheckEnvironment() error
- func FetchKernel(ctx context.Context, log *logrus.Logger, dir, kname string) error
- func FindKernel(installDir string) (string, error)
- func GetConfigGroupNames() []string
- func GetExamplesText() string
- func InitDir(log *logrus.Logger, dir string, conf *Conf, flags InitDirFlags) error
- func RemoveKernel(ctx context.Context, log_ *logrus.Logger, dir string, name string, ...) error
- type AddKernelFlags
- type Conf
- type ConfigOption
- type GitURL
- type InitDirFlags
- type KernelConf
- type KernelURL
- type KernelsDir
- type UrlExample
Constants ¶
This section is empty.
Variables ¶
View Source
var ( GitBinary = "git" MakeBinary = "make" Binaries = []string{GitBinary} )
View Source
var ( ConfigFname = "kernels.json" KernelsDirName = "kernels" )
View Source
var ConfigOptGroups = map[string][]ConfigOption{ "basic": []ConfigOption{ {"--enable", "CONFIG_LOCALVERSION_AUTO"}, {"--enable", "CONFIG_DEBUG_INFO"}, {"--enable", "CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT"}, {"--disable", "CONFIG_WERROR"}, }, "minimize": []ConfigOption{ {"--disable", "CONFIG_DRM"}, {"--disable", "CONFIG_GPU"}, {"--disable", "CONFIG_ISO9669_FS"}, {"--disable", "CONFIG_CFG80211"}, {"--disable", "CONFIG_RFKILL"}, {"--disable", "CONFIG_MACINTOSH_DRIVERS"}, {"--disable", "CONFIG_SOUND"}, {"--disable", "CONFIG_AGP"}, {"--disable", "CONFIG_USB_SUPPORT"}, {"--disable", "CONFIG_USB"}, {"--disable", "CONFIG_WLAN"}, {"--disable", "CONFIG_HID"}, }, "bpf": []ConfigOption{ {"--enable", "CONFIG_BPF"}, {"--enable", "CONFIG_BPF_SYSCALL"}, {"--enable", "CONFIG_NET_CLS_BPF"}, {"--enable", "CONFIG_NET_ACT_BPF"}, {"--enable", "CONFIG_BPF_JIT"}, {"--enable", "CONFIG_BPF_JIT_DEFAULT_ON"}, {"--enable", "CONFIG_BPF_EVENTS"}, {"--enable", "CONFIG_BPF_STREAM_PARSER"}, {"--enable", "CONFIG_DEBUG_INFO_BTF"}, {"--enable", "CONFIG_DEBUG_INFO_BTF_MODULES"}, {"--enable", "CONFIG_BPF_LSM"}, {"--enable", "CONFIG_CGROUP_BPF"}, {"--enable", "CONFIG_FTRACE_SYSCALLS"}, {"--enable", "CONFIG_SKB_EXTENSIONS"}, {"--enable", "CONFIG_NET_TC_SKB_EXT"}, }, "virtio": []ConfigOption{ {"--enable", "CONFIG_VIRTIO"}, {"--enable", "CONFIG_VIRTIO_MENU"}, {"--enable", "CONFIG_VIRTIO_PCI_LIB"}, {"--enable", "CONFIG_VIRTIO_PCI"}, {"--enable", "CONFIG_VIRTIO_NET"}, {"--enable", "CONFIG_NET_9P"}, {"--enable", "CONFIG_9P_FS"}, {"--enable", "CONFIG_NET_9P_VIRTIO"}, {"--enable", "CONFIG_VIRTIO_BLK"}, }, "namespaces": []ConfigOption{ {"--enable", "CONFIG_NAMESPACES"}, {"--enable", "CONFIG_UTS_NS"}, {"--enable", "CONFIG_TIME_NS"}, {"--enable", "CONFIG_IPC_NS"}, {"--enable", "CONFIG_USER_NS"}, {"--enable", "CONFIG_PID_NS"}, {"--enable", "CONFIG_NET_NS"}, }, }
View Source
var DefaultConfigGroups = []string{"basic", "bpf", "virtio", "minimize", "namespaces"}
View Source
var MainGitDir = "git"
View Source
var UrlExamples = []UrlExample{ { Name: "bpf-next", URL: "git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git", // contains filtered or unexported fields }, { Name: "5.18", URL: "git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git#linux-5.18.y", // contains filtered or unexported fields }, { Name: "5.15", URL: "git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git?depth=1#linux-5.15.y", // contains filtered or unexported fields }, }
Functions ¶
func AddKernel ¶
func AddKernel(ctx context.Context, log *logrus.Logger, dir string, cnf *KernelConf, flags AddKernelFlags) error
func BuildKernel ¶
func CheckEnvironment ¶
func CheckEnvironment() error
NB(kkourt): for now, just a single check for everything
func FetchKernel ¶
func FindKernel ¶
func GetConfigGroupNames ¶
func GetConfigGroupNames() []string
func GetExamplesText ¶
func GetExamplesText() string
Types ¶
type AddKernelFlags ¶
type Conf ¶
type Conf struct { Kernels []KernelConf `json:"kernels"` CommonOpts []ConfigOption `json:"common_opts,omitempty"` }
func (*Conf) AddGroupsCommonOpts ¶
type ConfigOption ¶
type ConfigOption []string
ConfigOption are switches passed to scripts/config in a kernel dir
type InitDirFlags ¶
type KernelConf ¶
type KernelConf struct { Name string `json:"name"` // URL of the kernel source URL string `json:"url"` // config options Opts []ConfigOption `json:"opts,omitempty"` }
KernelConf is the configuration of a kernel (to build from source)
func (*KernelConf) AddGroupsOpts ¶
func (kc *KernelConf) AddGroupsOpts(gs ...string) error
func (*KernelConf) Validate ¶
func (kc *KernelConf) Validate() error
type KernelsDir ¶
func (*KernelsDir) ConfigureKernel ¶
func (*KernelsDir) KernelConfig ¶
func (kd *KernelsDir) KernelConfig(name string) *KernelConf
func (*KernelsDir) RemoveKernelConfig ¶
func (kd *KernelsDir) RemoveKernelConfig(name string) *KernelConf
RemoveKernelConfig returns the removed kernel config if it was found
type UrlExample ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.