Documentation ¶
Index ¶
- Variables
- func GPTEntryName(e *vimg.GPTEntry) string
- func InodeIsDirectory(inode *ext.Inode) bool
- func InodeIsRegularFile(inode *ext.Inode) bool
- func InodeIsSymlink(inode *ext.Inode) bool
- func InodePermissionsString(inode *ext.Inode) string
- func InodeSize(inode *ext.Inode) int64
- func UTF16toString(data []byte) string
- type DirectoryEntry
- type Dirent
- type IO
- func (iio *IO) BGDT(index int) ([]*ext.BlockGroupDescriptorTableEntry, error)
- func (iio *IO) BlockToLBA(block int) (int, error)
- func (iio *IO) Close() error
- func (iio *IO) GPTEntries() ([]*vimg.GPTEntry, error)
- func (iio *IO) GPTEntry(name string) (*vimg.GPTEntry, error)
- func (iio *IO) GPTHeader() (*vimg.GPTHeader, error)
- func (iio *IO) ImageFormat() (vdisk.Format, error)
- func (iio *IO) InodeReader(inode *ext.Inode) (io.Reader, error)
- func (iio *IO) KernelFile(name string) (io.Reader, error)
- func (iio *IO) KernelFiles() ([]*KernelFile, error)
- func (iio *IO) PartitionReader(name string) (io.Reader, error)
- func (iio *IO) Readdir(inode *ext.Inode) ([]*DirectoryEntry, error)
- func (iio *IO) ResolveInode(ino int) (*ext.Inode, error)
- func (iio *IO) ResolvePathToInodeNo(path string) (int, error)
- func (iio *IO) Superblock(index int) (*ext.Superblock, error)
- type KernelFile
Constants ¶
This section is empty.
Variables ¶
var ( ErrRead = errors.New("underlying IO object does not support reading") ErrSeek = errors.New("underlying IO object does not support seeking") ErrWrite = errors.New("underlying IO object does not support writing") )
Partial IO errors, for when attempting to perform an operation that would be legal on a file but impossible on a read-only stream.
Functions ¶
func GPTEntryName ¶
GPTEntryName returns a normal string representation of the GPT entry. Without calling this function the data in the GPT entry is encoded in UTF16.
func InodeIsDirectory ¶
InodeIsDirectory returns true if the permission bits in the inode represent a directory.
func InodeIsRegularFile ¶
InodeIsRegularFile returns true if the permission bits in the inode represent a regular file.
func InodeIsSymlink ¶
InodeIsSymlink returns true if the permission bits in the inode represent a symlink.
func InodePermissionsString ¶
InodePermissionsString returns a string-representation of an inode's permissions modelled off the string you see with `ls -l`, e.g. `drwxr-x---`.
func InodeSize ¶
InodeSize returns the size of the file respresented by the inode. It is safer to use this than to use the size fields directly because different versions of ext might have upper and lower bits stored separately that need combining.
func UTF16toString ¶
Types ¶
type DirectoryEntry ¶
type IO ¶
type IO struct {
// contains filtered or unexported fields
}
IO provides an entry point into a virtual disk image, making it possible to navigate and read data from it. It has a complex but flexible implementation, allowing it to work from both seekable files and read-only streams.
func (*IO) BGDT ¶
func (iio *IO) BGDT(index int) ([]*ext.BlockGroupDescriptorTableEntry, error)
BGDT loads a block group descriptor table from block group 'index'.
func (*IO) BlockToLBA ¶
BlockToLBA converts a file-system block number into an absolute disk LBA.
func (*IO) GPTEntries ¶
GPTEntries returns a list of all GPT partition entries on the disk.
func (*IO) ImageFormat ¶
ImageFormat returns the image's file format.
func (*IO) InodeReader ¶
InodeReader reads all of the data stored for an inode.
func (*IO) KernelFile ¶
KernelFile returns the a reader for a kernel bundle file on the image.
func (*IO) KernelFiles ¶
func (iio *IO) KernelFiles() ([]*KernelFile, error)
KernelFiles returns a list of every kernel bundle file on the image.
func (*IO) PartitionReader ¶
PartitionReader returns a limited reader for the an entire disk partition. Valid arguments are vimg.RootPartitionName and vimg.OSPartitionName. This function can be used to easily extract the file-system from a Vorteil image.
func (*IO) Readdir ¶
func (iio *IO) Readdir(inode *ext.Inode) ([]*DirectoryEntry, error)
Readdir returns a list of directory entries within a directory.
func (*IO) ResolveInode ¶
ResolveInode looks up an inode on the file-system.
func (*IO) ResolvePathToInodeNo ¶
ResolvePathToInodeNo translates a filepath into an inode number if it can be found on the disk.
func (*IO) Superblock ¶
func (iio *IO) Superblock(index int) (*ext.Superblock, error)
Superblock loads the ext superblock from block group 'index'.
type KernelFile ¶
KernelFile contains information about a kernel bundle file and its location on the image.