pkgfs

package
v0.0.0-...-2208570 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2021 License: BSD-2-Clause Imports: 27 Imported by: 0

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

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.

type UnsupportedDirectory

type UnsupportedDirectory = unsupportedDirectory

Export for testing.

type UnsupportedFile

type UnsupportedFile = unsupportedFile

Export for testing.

Jump to

Keyboard shortcuts

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