transaction

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const FstabFile = "/etc/fstab"

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	Init(deployment.Deployment) (UpgradeHelper, error)
	Start() (*Transaction, error)
	Commit(trans *Transaction, cleanup func() error) error
	Rollback(*Transaction, error) error

	GetActiveSnapshotIDs() ([]int, error)
}

func New

func NewOverwrite

func NewOverwrite(ctx context.Context, s *sys.System, d *deployment.Deployment, lsBlk block.Device) Interface

func NewSnapper

func NewSnapper(ctx context.Context, s *sys.System) Interface

type Merge

type Merge struct {
	Old      string // old unmodified tree
	New      string // new base tree where modifications should be applied
	Modified string // modified tree on top of the old tree
}

type Overwrite

type Overwrite struct {
	// contains filtered or unexported fields
}

Overwrite transaction snapshotter is a passthrough snapshotter built to be able to verify that the transaction code works as advertised and verify the transaction interface. Should only be used for debugging.

func (Overwrite) Commit

func (n Overwrite) Commit(trans *Transaction, cleanup func() error) (err error)

func (Overwrite) GenerateKernelCmdline

func (n Overwrite) GenerateKernelCmdline(*Transaction) string

func (Overwrite) GetActiveSnapshotIDs

func (n Overwrite) GetActiveSnapshotIDs() ([]int, error)

func (Overwrite) Init

func (Overwrite) Lock

func (n Overwrite) Lock(*Transaction) error

func (Overwrite) Merge

func (n Overwrite) Merge(*Transaction) error

func (Overwrite) MountPartition

func (n Overwrite) MountPartition(root string, hwParts block.PartitionList, p *deployment.Partition) error

func (Overwrite) Rollback

func (n Overwrite) Rollback(*Transaction, error) error

func (Overwrite) Start

func (n Overwrite) Start() (*Transaction, error)

func (Overwrite) SyncImageContent

func (n Overwrite) SyncImageContent(imgSrc *deployment.ImageSource, trans *Transaction, opts ...unpack.Opt) (err error)

func (Overwrite) UpdateFstab

func (n Overwrite) UpdateFstab(trans *Transaction) error

type Transaction

type Transaction struct {
	ID     int
	Path   string
	Merges map[string]*Merge
	// contains filtered or unexported fields
}

type UpgradeHelper

type UpgradeHelper interface {
	SyncImageContent(*deployment.ImageSource, *Transaction, ...unpack.Opt) error
	Merge(*Transaction) error
	UpdateFstab(*Transaction) error
	Lock(*Transaction) error
	GenerateKernelCmdline(*Transaction) string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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