squashfs

package
v0.40.4 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

This package is a small go "library" (read: exec wrapper) around the mksquashfs binary that provides some useful primitives.

Index

Constants

View Source
const (
	BaseMediaTypeLayerSquashfs = "application/vnd.stacker.image.layer.squashfs"

	GzipCompression SquashfsCompression = "gzip"
	ZstdCompression SquashfsCompression = "zstd"

	VerityMetadataPresent VerityMetadata = true
	VerityMetadataMissing VerityMetadata = false
)
View Source
const VerityRootHashAnnotation = "io.stackeroci.stacker.squashfs_verity_root_hash"

Variables

This section is empty.

Functions

func ConfirmExistingVerityDeviceHash

func ConfirmExistingVerityDeviceHash(devicePath string, rootHash string) error

func ExtractSingleSquash

func ExtractSingleSquash(squashFile string, extractDir string, storageType string) error

func GenerateSquashfsMediaType

func GenerateSquashfsMediaType(comp SquashfsCompression, verity VerityMetadata) string

func IsSquashfsMediaType

func IsSquashfsMediaType(mediaType string) bool

func MakeSquashfs

func MakeSquashfs(tempdir string, rootfs string, eps *ExcludePaths, verity VerityMetadata) (io.ReadCloser, string, string, error)

func Mount

func Mount(squashfs string, mountpoint string, rootHash string) error

func Umount

func Umount(mountpoint string) error

Types

type ExcludePaths

type ExcludePaths struct {
	// contains filtered or unexported fields
}

ExcludePaths represents a list of paths to exclude in a squashfs listing. Users should do something like filepath.Walk() over the whole filesystem, calling AddExclude() or AddInclude() based on whether they want to include or exclude a particular file. Note that if e.g. /usr is excluded, then everyting underneath is also implicitly excluded. The AddExclude()/AddInclude() methods do the math to figure out what is the correct set of things to exclude or include based on what paths have been previously included or excluded.

func NewExcludePaths

func NewExcludePaths() *ExcludePaths

func (*ExcludePaths) AddExclude

func (eps *ExcludePaths) AddExclude(p string)

func (*ExcludePaths) AddInclude

func (eps *ExcludePaths) AddInclude(orig string, isDir bool)

func (*ExcludePaths) String

func (eps *ExcludePaths) String() (string, error)

type SquashfsCompression

type SquashfsCompression string

type VerityMetadata

type VerityMetadata bool

func HasVerityMetadata

func HasVerityMetadata(mediaType string) VerityMetadata

Jump to

Keyboard shortcuts

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