util

package
v0.0.0-...-63c3a42 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BLKGETSIZE = 0x00001260
)

Variables

This section is empty.

Functions

func CopyMtimes

func CopyMtimes(source, dest *filesystem.FileSystem)

CopyMtimes will copy modification times for files from the source to the destination if the file data and metadata (other than mtime) are identical. Directory entry inode pointers are invalidated by this operation, so this should be followed by a call to dest.RebuildInodePointers().

func DeletedFilteredFiles

func DeletedFilteredFiles(rootDir string, filt *filter.Filter) error

func GetUnsupportedExt4fsOptions

func GetUnsupportedExt4fsOptions(fs *filesystem.FileSystem,
	objectsGetter objectserver.ObjectsGetter) ([]string, error)

func MakeBootable

func MakeBootable(fs *filesystem.FileSystem,
	deviceName, rootLabel, rootDir, kernelOptions string,
	doChroot bool, logger log.DebugLogger) error

func MakeExt4fs

func MakeExt4fs(deviceName, label string, unsupportedOptions []string,
	bytesPerInode uint64, logger log.Logger) error

func MakeKernelOptions

func MakeKernelOptions(rootDevice, extraOptions string) string

func ReplaceComputedFiles

func ReplaceComputedFiles(fs *filesystem.FileSystem,
	computedFilesData *ComputedFilesData,
	objectsGetter objectserver.ObjectsGetter) (
	objectserver.ObjectsGetter, error)

func SpliceComputedFiles

func SpliceComputedFiles(fs *filesystem.FileSystem,
	computedFileList []ComputedFile) error

func Unpack

func Unpack(fs *filesystem.FileSystem, objectsGetter objectserver.ObjectsGetter,
	rootDir string, logger log.Logger) error

func WriteFstabEntry

func WriteFstabEntry(writer io.Writer,
	source, mountPoint, fileSystemType, flags string,
	dumpFrequency, checkOrder uint) error

func WriteImageName

func WriteImageName(mountPoint, imageName string) error

func WriteRaw

func WriteRaw(fs *filesystem.FileSystem,
	objectsGetter objectserver.ObjectsGetter, rawFilename string,
	perm os.FileMode, tableType mbr.TableType,
	minFreeSpace uint64, roundupPower uint64, makeBootable, allocateBlocks bool,
	logger log.DebugLogger) error

func WriteRawWithOptions

func WriteRawWithOptions(fs *filesystem.FileSystem,
	objectsGetter objectserver.ObjectsGetter, rawFilename string,
	perm os.FileMode, tableType mbr.TableType, options WriteRawOptions,
	logger log.DebugLogger) error

Types

type BootInfoType

type BootInfoType struct {
	BootDirectory     *filesystem.DirectoryInode
	InitrdImageDirent *filesystem.DirectoryEntry
	InitrdImageFile   string
	KernelImageDirent *filesystem.DirectoryEntry
	KernelImageFile   string
	KernelOptions     string
}

func GetBootInfo

func GetBootInfo(fs *filesystem.FileSystem, rootLabel string,
	extraKernelOptions string) (*BootInfoType, error)

func (*BootInfoType) WriteBootloaderConfig

func (bootInfo *BootInfoType) WriteBootloaderConfig(rootDir string,
	logger log.Logger) error

type ComputedFile

type ComputedFile struct {
	Filename string
	Source   string
}

func LoadComputedFiles

func LoadComputedFiles(filename string) ([]ComputedFile, error)

func MergeComputedFiles

func MergeComputedFiles(base, overlay []ComputedFile) []ComputedFile

type ComputedFilesData

type ComputedFilesData struct {
	FileData      map[string][]byte // Key: filename.
	RootDirectory string
}

type WriteRawOptions

type WriteRawOptions struct {
	AllocateBlocks    bool
	DoChroot          bool
	InitialImageName  string
	InstallBootloader bool
	MinimumFreeBytes  uint64
	RootLabel         string
	RoundupPower      uint64
	WriteFstab        bool
}

Jump to

Keyboard shortcuts

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