utils

package
v1.7.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package utils contains small utilities used by the imager.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFiles

func CopyFiles(printf func(string, ...any), instructions ...CopyInstruction) error

CopyFiles copies files according to the given instructions.

func CreateRawDisk

func CreateRawDisk(printf func(string, ...any), path string, diskSize int64) error

CreateRawDisk creates a raw disk image of the specified size.

func Loattach

func Loattach(img string) (dev string, err error)

Loattach attaches a loopback device by inoking the `losetup` command.

func Lodetach

func Lodetach(img string) (err error)

Lodetach detaches a loopback device by inoking the `losetup` command.

func SourceDateEpoch

func SourceDateEpoch() (int64, bool, error)

SourceDateEpoch returns parsed value of SOURCE_DATE_EPOCH.

func TouchFiles

func TouchFiles(printf func(string, ...any), root string) error

TouchFiles updates mtime for all the files under root if SOURCE_DATE_EPOCH is set.

Types

type CopyInstruction

type CopyInstruction = ordered.Pair[string, string]

CopyInstruction describes a file copy operation.

func SourceDestination

func SourceDestination(src, dest string) CopyInstruction

SourceDestination returns a CopyInstruction that copies src to dest.

Jump to

Keyboard shortcuts

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