Documentation
¶
Overview ¶
Package efstest builds tiny synthetic EFS images for tests. Everything instigator serves in CI is generated here — no SGI-derived bytes enter the tree. Geometry is fixed small: one cylinder group, 2 inode blocks (8 inodes), 64 blocks.
Index ¶
- type Builder
- func (b *Builder) AddData(data []byte) (bn int64, nblocks uint32)
- func (b *Builder) AddDir(entries map[string]uint32) uint32
- func (b *Builder) AddFIFO() uint32
- func (b *Builder) AddFile(perm uint16, data []byte) uint32
- func (b *Builder) AddFileExtents(size int32, extents [][3]uint32) uint32
- func (b *Builder) AddFileIndirect(size int32, extents [][3]uint32) uint32
- func (b *Builder) AddSymlink(target string) uint32
- func (b *Builder) Bytes() []byte
- func (b *Builder) CDImage(base int64, bootFiles map[string][]byte) []byte
- func (b *Builder) PutInode(ino uint32, mode uint16, size int32, mtime uint32, extents [][3]uint32)
- func (b *Builder) SetRoot(entries map[string]uint32)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder assembles an EFS image in memory. The zero value is not usable; call New.
func New ¶
func New() *Builder
New returns a Builder holding a valid superblock. Inode 2 is reserved for the root directory; populate it with SetRoot.
func (*Builder) AddData ¶
AddData writes raw bytes into consecutive data blocks and returns the run's first block and block count.
func (*Builder) AddFIFO ¶
AddFIFO stores a named pipe and returns its inode number. It exists so a test can aim a symlink at something that is neither a directory nor a regular file, which is the one shape real media occasionally carries and the tree refuses to serve.
func (*Builder) AddFile ¶
AddFile stores data as a regular file in one extent and returns its inode number.
func (*Builder) AddFileExtents ¶
AddFileExtents stores a file whose extent list is given explicitly.
func (*Builder) AddFileIndirect ¶
AddFileIndirect stores a file with its extent table in an indirect block, EFS's layout once a file has more than 12 extents.
func (*Builder) AddSymlink ¶
AddSymlink stores a symlink and returns its inode number.
func (*Builder) CDImage ¶
CDImage wraps the filesystem in an SGI volume header the way install media are laid out: header at block 0, EFS partition in slot 7 at base, optional raw boot files in the volume directory.