Documentation ¶
Overview ¶
Package pkgfs hosts a filesystem for interacting with packages that are stored on a host. It presents a tree of packages that are locally available and a tree that enables a user to add new packages and/or package content to the host.
Index ¶
- type Filesystem
- func (f *Filesystem) Blockcount() int64
- func (f *Filesystem) Blocksize() int64
- func (f *Filesystem) Close() error
- func (f *Filesystem) DevicePath() string
- func (f *Filesystem) FreeSize() int64
- func (fs *Filesystem) GC() error
- func (f *Filesystem) RootDirectory() fs.Directory
- func (f *Filesystem) Serve(c zx.Channel) error
- func (f *Filesystem) SetSystemRoot(merkleroot string) error
- func (f *Filesystem) Size() int64
- func (f *Filesystem) Type() string
- func (fs *Filesystem) ValidateStaticIndex() (map[string]struct{}, map[string]struct{}, error)
- type UnsupportedDirectory
- type UnsupportedFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filesystem ¶
type Filesystem struct {
// contains filtered or unexported fields
}
Filesystem is the top level container for a pkgfs server
func New ¶
func New(blobDir *fdio.Directory, enforcePkgfsPackagesNonStaticAllowlist bool, enforceNonBaseExecutabilityRestrictions bool) (*Filesystem, error)
New initializes a new pkgfs filesystem server
func (*Filesystem) Blockcount ¶
func (f *Filesystem) Blockcount() int64
func (*Filesystem) Blocksize ¶
func (f *Filesystem) Blocksize() int64
func (*Filesystem) Close ¶
func (f *Filesystem) Close() error
func (*Filesystem) DevicePath ¶
func (f *Filesystem) DevicePath() string
func (*Filesystem) FreeSize ¶
func (f *Filesystem) FreeSize() int64
func (*Filesystem) GC ¶
func (fs *Filesystem) GC() error
GC examines the static and dynamic indexes, collects all the blobs that belong to packages in these indexes. It then reads blobfs for its entire list of blobs. Anything in blobfs that does not appear in the indexes is removed.
func (*Filesystem) RootDirectory ¶
func (f *Filesystem) RootDirectory() fs.Directory
func (*Filesystem) Serve ¶
func (f *Filesystem) Serve(c zx.Channel) error
Serve starts a Directory protocol RPC server on the given channel.
func (*Filesystem) SetSystemRoot ¶
func (f *Filesystem) SetSystemRoot(merkleroot string) error
SetSystemRoot sets/updates the merkleroot (and static index) that backs the /system partition and static package index.
func (*Filesystem) Size ¶
func (f *Filesystem) Size() int64
func (*Filesystem) Type ¶
func (f *Filesystem) Type() string
func (*Filesystem) ValidateStaticIndex ¶
func (fs *Filesystem) ValidateStaticIndex() (map[string]struct{}, map[string]struct{}, error)
ValidateStaticIndex compares the contents of the static index against what blobs are available in blobfs. It returns the ids of the blobs that are present and those that are missing or any error encountered trying to do the validation.