update

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InvalidMagic     = errors.New("payload missing magic prefix")
	InvalidVersion   = errors.New("payload version unsupported")
	InvalidBlockSize = errors.New("payload block size not 4096")
)

Functions

func VerifyInfo

func VerifyInfo(file *os.File, info *metadata.InstallInfo) error

Types

type Operation

type Operation struct {
	hash.Hash
	io.LimitedReader

	Payload   *Payload
	Procedure *metadata.InstallProcedure
	Operation *metadata.InstallOperation
}

func NewOperation

func NewOperation(payload *Payload, proc *metadata.InstallProcedure, op *metadata.InstallOperation) *Operation

func (*Operation) Apply

func (op *Operation) Apply(dst, src *os.File) error

func (*Operation) Verify

func (op *Operation) Verify() error

type Payload

type Payload struct {

	// Offset is the number of bytes read from the payload,
	// excluding the header and manifest.
	Offset int64

	// Parsed metadata contained in the payload.
	Header     metadata.DeltaArchiveHeader
	Manifest   metadata.DeltaArchiveManifest
	Signatures metadata.Signatures
	// contains filtered or unexported fields
}

func NewPayloadFrom

func NewPayloadFrom(r io.Reader) (*Payload, error)

func (*Payload) Operations

func (p *Payload) Operations(proc *metadata.InstallProcedure) []*Operation

func (*Payload) Procedures

func (p *Payload) Procedures() []*metadata.InstallProcedure

func (*Payload) Read

func (p *Payload) Read(b []byte) (n int, err error)

Read reads from the raw payload stream, updating Hash and Offset for later verification. Behaves similarly to io.TeeReader.

func (*Payload) Sum

func (p *Payload) Sum() []byte

Sum returns the hash of the payload read so far.

func (*Payload) Verify

func (p *Payload) Verify() error

Verify reads the entire payload and checks it for errors.

func (*Payload) VerifySignature

func (p *Payload) VerifySignature() error

VerifySignature reads and checks for a valid signature.

type Updater

type Updater struct {
	SrcPartition string
	DstPartition string
	// contains filtered or unexported fields
}

func (*Updater) OpenPayload

func (u *Updater) OpenPayload(file string) error

func (*Updater) Update

func (u *Updater) Update() error

func (*Updater) UpdateKernel

func (u *Updater) UpdateKernel(proc *metadata.InstallProcedure) error

func (*Updater) UpdatePartition

func (u *Updater) UpdatePartition(proc *metadata.InstallProcedure) error

func (*Updater) UsePayload

func (u *Updater) UsePayload(r io.Reader) (err error)

Directories

Path Synopsis
Package metadata is a generated protocol buffer package.
Package metadata is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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