disk

package
v0.0.0-...-208c66a Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: BSD-3-Clause Imports: 8 Imported by: 1

Documentation

Overview

Package disk provides support for SD/MMC card partition access, only ext4 filesystems are currently supported.

This package is only meant to be used with `GOOS=tamago GOARCH=arm` as supported by the TamaGo framework for bare metal Go on ARM SoCs, see https://github.com/usbarmory/tamago.

Index

Constants

View Source
const DefaultBootDevice = "uSD"

DefaultBootDevice is the default boot device

View Source
const DefaultOffset = 5242880

DefaultOffset is the default start offset of the ext4 partition

Variables

This section is empty.

Functions

This section is empty.

Types

type Partition

type Partition struct {
	Card   *usdhc.USDHC
	Offset int64
	// contains filtered or unexported fields
}

Partition represents an SD/MMC card partition, only ext4 filesystems are currently supported.

func Detect

func Detect(card *usdhc.USDHC, start string) (part *Partition, err error)

Detect initializes the USB armory internal flash ("eMMC") or external microSD card ("uSD") as boot device, an ext4 partition must be present at the passed start offset. An empty value for device or start parameter selects its default value.

func (*Partition) Read

func (part *Partition) Read(p []byte) (n int, err error)

func (*Partition) ReadAll

func (part *Partition) ReadAll(fullPath string) (buf []byte, err error)

func (*Partition) Seek

func (part *Partition) Seek(offset int64, whence int) (int64, error)

Jump to

Keyboard shortcuts

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