squashfs

package
v0.0.0-...-b0e2fe5 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: GPL-3.0 Imports: 20 Imported by: 76

Documentation

Index

Constants

View Source
const MinimumSnapSize int64 = 16384

MinimumSnapSize is the smallest size a snap can be. The kernel attempts to read a partition table from the snap when a loopback device is created from it. If the snap is smaller than this size, some versions of the kernel will print error logs while scanning the loopback device for partitions. TODO: revisit if necessary, some distros (eg. openSUSE) patch squashfs-tools to pad to 64k but kernel should work with this

Variables

This section is empty.

Functions

func BuildDate

func BuildDate(path string) time.Time

BuildDate returns the "Creation or last append time" as reported by unsquashfs.

func FileHasSquashfsHeader

func FileHasSquashfsHeader(path string) bool

Types

type BuildOpts

type BuildOpts struct {
	SnapType     string
	Compression  string
	ExcludeFiles []string
}

type MksquashfsError

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

func (MksquashfsError) Error

func (m MksquashfsError) Error() string

type Snap

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

Snap is the squashfs based snap.

func New

func New(snapPath string) *Snap

New returns a new Squashfs snap.

func (*Snap) Build

func (s *Snap) Build(sourceDir string, opts *BuildOpts) error

Build builds the snap.

func (*Snap) BuildDate

func (s *Snap) BuildDate() time.Time

BuildDate returns the "Creation or last append time" as reported by unsquashfs.

func (*Snap) Install

func (s *Snap) Install(targetPath, mountDir string, opts *snap.InstallOptions) (bool, error)

Install installs a squashfs snap file through an appropriate method.

func (*Snap) ListDir

func (s *Snap) ListDir(dirPath string) ([]string, error)

ListDir returns the content of a single directory inside a squashfs snap.

func (*Snap) Lstat

func (s *Snap) Lstat(filePath string) (os.FileInfo, error)

func (*Snap) Path

func (s *Snap) Path() string

Path returns the path of the backing file.

func (*Snap) RandomAccessFile

func (s *Snap) RandomAccessFile(filePath string) (interface {
	io.ReaderAt
	io.Closer
	Size() int64
}, error)

RandomAccessFile returns an implementation to read at any given location for a single file inside the squashfs snap plus information about the file size.

func (*Snap) ReadFile

func (s *Snap) ReadFile(filePath string) (content []byte, err error)

ReadFile returns the content of a single file inside a squashfs snap.

func (s *Snap) ReadLink(filePath string) (string, error)

func (*Snap) Size

func (s *Snap) Size() (size int64, err error)

Size returns the size of a squashfs snap.

func (*Snap) Unpack

func (s *Snap) Unpack(src, dstDir string) error

func (*Snap) Walk

func (s *Snap) Walk(relative string, walkFn filepath.WalkFunc) error

Walk (part of snap.Container) is like filepath.Walk, without the ordering guarantee.

type SnapFileOwner

type SnapFileOwner struct {
	UID uint32
	GID uint32
}

Jump to

Keyboard shortcuts

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