erofs

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const (

	// Inode slot size in bit shift.
	InodeSlotBits = 5

	// Max file name length.
	MaxNameLen = 255
)
View Source
const (
	InodeLayoutBit  = 0
	InodeLayoutBits = 1

	InodeDataLayoutBit  = 1
	InodeDataLayoutBits = 3
)

Bit definitions for Inode*::Format.

View Source
const (
	InodeLayoutCompact  = 0
	InodeLayoutExtended = 1
)

Inode layouts.

View Source
const (
	InodeDataLayoutFlatPlain = iota
	InodeDataLayoutFlatCompressionLegacy
	InodeDataLayoutFlatInline
	InodeDataLayoutFlatCompression
	InodeDataLayoutChunkBased
	InodeDataLayoutMax
)

Inode data layouts.

View Source
const (
	InodeCompactSize  = 32
	InodeExtendedSize = 64
	DirentSize        = 12
)

Sizes of on-disk structures in bytes.

View Source
const (
	FeatureCompatSuperBlockChecksum = 0x00000001
)

Features w/ backward compatibility. This is not exhaustive, unused features are not listed.

View Source
const (
	FeatureIncompatSupported = 0x0
)

Features w/o backward compatibility.

Any features that aren't in FeatureIncompatSupported are incompatible with this implementation.

This is not exhaustive, unused features are not listed.

Variables

This section is empty.

Functions

func ExtractSingleErofs

func ExtractSingleErofs(erofsFile string, extractDir string) error

ExtractSingleErofs - extract the erofsFile to extractDir Initialize a extractPolicy struct and then call ExtractSingleErofsPolicy wik()th that.

func ExtractSingleErofsPolicy

func ExtractSingleErofsPolicy(erofsFile, extractDir string, policy *ExtractPolicy) error

ExtractSingleErofsPolicy - extract erofsfile to extractDir

func GenerateErofsMediaType

func GenerateErofsMediaType(comp ErofsCompression) string

func IsErofsMediaType

func IsErofsMediaType(mediaType string) bool

func MakeErofs

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

func New

func New() *erofs

Types

type ErofsCompression

type ErofsCompression string
const (
	BaseMediaTypeLayerErofs = "application/vnd.stacker.image.layer.erofs"

	LZ4HCCompression ErofsCompression = "lz4hc"
	LZ4Compression   ErofsCompression = "lz4"
	ZstdCompression  ErofsCompression = "zstd"
)

type ErofsFuseExtractor

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

func (*ErofsFuseExtractor) IsAvailable

func (f *ErofsFuseExtractor) IsAvailable() error

func (*ErofsFuseExtractor) Mount

func (f *ErofsFuseExtractor) Mount(erofsFile, extractDir string) error

func (*ErofsFuseExtractor) Name

func (f *ErofsFuseExtractor) Name() string

type ExtractPolicy

type ExtractPolicy struct {
	Extractors []types.FsExtractor
	Extractor  types.FsExtractor
	Excuses    map[string]error
	// contains filtered or unexported fields
}

func NewExtractPolicy

func NewExtractPolicy(args ...string) (*ExtractPolicy, error)

type FsckErofsExtractor

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

func (*FsckErofsExtractor) IsAvailable

func (k *FsckErofsExtractor) IsAvailable() error

func (*FsckErofsExtractor) Mount

func (k *FsckErofsExtractor) Mount(erofsFile, extractDir string) error

func (*FsckErofsExtractor) Name

func (k *FsckErofsExtractor) Name() string

type KernelExtractor

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

func (*KernelExtractor) IsAvailable

func (k *KernelExtractor) IsAvailable() error

func (*KernelExtractor) Mount

func (k *KernelExtractor) Mount(erofsFile, extractDir string) error

func (*KernelExtractor) Name

func (k *KernelExtractor) Name() string

Jump to

Keyboard shortcuts

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