syzkaller: Index | Files

package build

import ""

Package build contains helper functions for building kernels/images.


Package Files

akaros.go build.go freebsd.go fuchsia.go gvisor.go linux.go linux_generated.go netbsd.go openbsd.go test.go

func Clean Uses

func Clean(targetOS, targetArch, vmType, kernelDir string) error

func CompilerIdentity Uses

func CompilerIdentity(compiler string) (string, error)

func Image Uses

func Image(params *Params) (string, error)

Image creates a disk image for the specified OS/ARCH/VM. Kernel is taken from KernelDir, userspace system is taken from UserspaceDir. If CmdlineFile is not empty, contents of the file are appended to the kernel command line. If SysctlFile is not empty, contents of the file are appended to the image /etc/sysctl.conf. Output is stored in OutputDir and includes (everything except for image is optional):

- image: the image
- key: ssh key for the image
- kernel: kernel for injected boot
- initrd: initrd for injected boot
- kernel.config: actual kernel config used during build
- obj/: directory with kernel object files (this should match KernelObject
  specified in sys/targets, e.g. vmlinux for linux)

The returned string is a kernel ID that will be the same for kernels with the same runtime behavior, and different for kernels with different runtime behavior. Binary equal builds, or builds that differ only in e.g. debug info, have the same ID. The ID may be empty if OS implementation does not have a way to calculate such IDs.

type KernelError Uses

type KernelError struct {
    Report      []byte
    Output      []byte
    Maintainers []string
    // contains filtered or unexported fields

func (*KernelError) Error Uses

func (err *KernelError) Error() string

type Params Uses

type Params struct {
    TargetOS     string
    TargetArch   string
    VMType       string
    KernelDir    string
    OutputDir    string
    Compiler     string
    UserspaceDir string
    CmdlineFile  string
    SysctlFile   string
    Config       []byte

Params is input arguments for the Image function.

Package build imports 21 packages (graph) and is imported by 6 packages. Updated 2020-07-07. Refresh now. Tools for package owners.