fs

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package fs exposes access to filesystems.

Index

Constants

View Source
const (
	PartitionTypeFAT32LBA             = 0xc
	PartitionTypeLinuxNativePartition = 0x83
)

Partition types

Variables

This section is empty.

Functions

func CheckPiPartitionTable

func CheckPiPartitionTable(t *mbr.MBR) error

CheckPiPartitionTable returns an error if the pi image has a bad partition table.

func ExpandImage added in v0.1.4

func ExpandImage(path string, partition int) error

Types

type Ext4FS

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

Ext4FS represents access to an ext4 fileystem.

func LoadExt4

func LoadExt4(f *os.File, start, length uint64) (*Ext4FS, error)

LoadExt4 loads an ext4 filesystem.

type KMount

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

KMount represents access to a filesystem contained within a image file, mediated by the kernel.

func KMountExt4

func KMountExt4(img string, start, length uint64, resize bool) (*KMount, error)

KMountExt4 invokes mount() to mount the ext4 filesystem in the given image, at the provided mount point.

func KMountVFat

func KMountVFat(img string, start, length uint64) (*KMount, error)

KMountVFat invokes mount() to mount the vfat filesystem in the given image, at the provided mount point.

func (*KMount) Cat

func (m *KMount) Cat(path string) ([]byte, error)

Cat implements interpreter.FS.

func (*KMount) Chmod

func (m *KMount) Chmod(path string, mode os.FileMode) error

Chmod implements interpreter.FS.

func (*KMount) Chown

func (m *KMount) Chown(path string, uid, gid int) error

Chown implements interpreter.FS.

func (*KMount) Close

func (m *KMount) Close() error

Close gracefully shuts down the mount, removing any loopbacks or mount points created in the process of mounting.

func (*KMount) CopyInto added in v0.1.4

func (m *KMount) CopyInto(sysPath, path string) error

CopyInto implements sysd.FS.

func (*KMount) LStat

func (m *KMount) LStat(path string) (os.FileInfo, error)

LStat implements sysd.FS.

func (*KMount) Mkdir

func (m *KMount) Mkdir(at string) error

Mkdir implements sysd.FS.

func (*KMount) Mountpoint added in v0.1.4

func (m *KMount) Mountpoint() string

Mountpoint returns the path to the root of the mountpoint.

func (*KMount) Remove

func (m *KMount) Remove(path string) error

Remove implements interpreter.FS.

func (*KMount) RemoveAll

func (m *KMount) RemoveAll(path string) error

RemoveAll implements interpreter.FS.

func (*KMount) Stat

func (m *KMount) Stat(path string) (os.FileInfo, error)

Stat implements sysd.FS.

func (m *KMount) Symlink(at, to string) error

Symlink implements sysd.FS.

func (*KMount) Write

func (m *KMount) Write(path string, data []byte, perms os.FileMode) error

Write implements sysd.FS.

Jump to

Keyboard shortcuts

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