initrd

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 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.

Index

Constants

View Source
const InputDelimeter = ":"

Variables

View Source
var NameToType = map[string]InitrdFormat{
	"odc":   ODC,
	"newc":  NEWC,
	"ustar": USTAR,
}

Functions

This section is empty.

Types

type InitrdConfig

type InitrdConfig struct {
	Output   string            `yaml:"output,omitempty"`
	Files    map[string]string `yaml:"files,omitempty"`
	Format   InitrdFormat      `yaml:"format,omitempty"`
	Compress bool              `yaml:"compress,omitempty"`
	// contains filtered or unexported fields
}

func NewFromFile added in v0.6.0

func NewFromFile(workdir, path string) (*InitrdConfig, error)

NewFromFile interprets a given path as a initramfs disk file and returns an instantiated InitrdConfig if successful.

func NewFromMapping added in v0.6.3

func NewFromMapping(workdir, output string, maps ...string) (*InitrdConfig, error)

NewFromMapping accepts a working directory base that represents the relative path of the files to serialize which are provided by a slice of mappings, each delimetered by the default delimeter `:` which separates the path on the host and the path inside of the iniramfs. A destination of the final archive is provided by the positional argument output.

func NewFromPath added in v0.6.0

func NewFromPath(base string, prefix string, files ...string) (*InitrdConfig, error)

NewFromPath accepts a positional argument base which is the directory that the provided files should be serialized from. The prefix positional argument is used to affix all embedded files to the provided location. Left empty, the defeault prefix is "/".

func (*InitrdConfig) NewReader

func (i *InitrdConfig) NewReader(w io.Reader) (*cpio.Reader, error)

func (*InitrdConfig) NewWriter

func (i *InitrdConfig) NewWriter(w io.Writer) (*cpio.Writer, error)

type InitrdFormat

type InitrdFormat int
const (
	ODC InitrdFormat = iota
	NEWC
	USTAR
)

func (InitrdFormat) String

func (d InitrdFormat) String() string

Jump to

Keyboard shortcuts

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