package
6.0.0+incompatible
Repository: https://github.com/srcup/u-root.git
Documentation: pkg.go.dev

# Functions

BlockStatFromBytes parses a block stat file and returns a BlockStat object.
FilterEFISystemPartitions returns a list of BlockDev objects whose underlying block device is a valid EFI system partition, or an error if any.
GetBlockStats iterates over /sys/class/block entries and returns a list of BlockDev objects, or an error if any.
GetGPTTable tries to read a GPT table from the block device described by the passed BlockDev object, and returns a gpt.Table object, or an error if any.
GetMountpointByDevice gets the mountpoint by given device name.
GetSupportedFilesystems returns the supported file systems for block devices.
Mount tries to mount a block device on the given mountpoint, trying in order the provided file system types.
PartitionsByFsUUID returns a list of BlockDev objects whose underlying block device has a filesystem with the given UUID.
PartitionsByGUID returns a list of BlockDev objects whose underlying block device has the given GUID.

# Constants

fixed value.
Offset of magic number in suberblock.
see https://www.nongnu.org/ext2-doc/ext2.html#DISK-ORGANISATION.
Offset of superblock in partition.
Actually 1024 but most of the last byters are reserved.
Offset of UUID in superblock.
see https://www.nongnu.org/ext2-doc/ext2.html#DISK-ORGANISATION.
Offset of filesystem-ID / serielnumber.
see https://de.wikipedia.org/wiki/File_Allocation_Table#Aufbau.
fixed value.
Offset of magic number.
see https://de.wikipedia.org/wiki/File_Allocation_Table#Aufbau.

# Variables

LinuxMountsPath is the standard mountpoint list path.
SystemPartitionGUID is the GUID of EFI system partitions EFI System partitions have GUID C12A7328-F81F-11D2-BA4B-00A0C93EC93B.

# Structs

BlockDev maps a device name to a BlockStat structure for a given block device.
BlockStat provides block device information as contained in /sys/class/block/<device_name>/stat.
Mountpoint holds mount point information for a given device.