resdiskcrypt

package
v3.0.0-rc66 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 30 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupPassphrase holds where the passphrase opening the device is
	// kept, and whether om generates it.
	GroupPassphrase = keywords.Group{
		ID:    "passphrase",
		Name:  "Passphrase",
		Text:  keywords.NewText(fs, "text/group/passphrase"),
		Order: 40,
	}

	// GroupKeyDerivation holds the key derivation function the provision
	// formats the LUKS header with, and its costs.
	GroupKeyDerivation = keywords.Group{
		ID:    "key_derivation",
		Name:  "Key derivation",
		Text:  keywords.NewText(fs, "text/group/key_derivation"),
		Order: 42,
	}
)

The groups of the keywords of a crypt disk beside the ones of the disk drivers: the passphrase opening the device, and how the provision derives the key of the LUKS header from it.

A passphrase managed by om or supplied by the user is no strategy of the passphrase group: manage_passphrase chooses between the two, and the secret keeps the passphrase either way.

Functions

func New

func New() resource.Driver

Types

type T

type T struct {
	resdisk.T
	Name             string      `json:"name"`
	Dev              string      `json:"dev"`
	ManagePassphrase bool        `json:"manage_passphrase"`
	Secret           string      `json:"secret"`
	FormatLabel      string      `json:"label"`
	Pbkdf            string      `json:"pbkdf"`
	PbkdfMemory      string      `json:"pbkdf_memory"`
	PbkdfParallel    int         `json:"pbkdf_parallel"`
	IterTime         int         `json:"iter_time"`
	Path             naming.Path `json:"path"`
}

func (*T) CurrentSize

func (t *T) CurrentSize(ctx context.Context) (int64, error)

CurrentSize implements resource.Sizer.

It is what the mapped device hands out, which is less than the device under it holds: the header sits at the front of it.

func (*T) DriverID

func (t *T) DriverID() driver.ID

func (*T) ExposedDevices

func (t *T) ExposedDevices(ctx context.Context) device.L

func (*T) Holds

func (t *T) Holds(src resource.HoldSource) []resource.Hold

Holds says the device mapper name, the device it exposes, and the device it encrypts.

func (*T) Info

func (t *T) Info(ctx context.Context) (resource.InfoKeys, error)

func (*T) Label

func (t *T) Label(_ context.Context) string

Label implements Label from resource.Driver interface, it returns a formatted short description of the Resource

func (*T) Manifest

func (t *T) Manifest() *manifest.T

Manifest exposes to the core the input expected by the driver.

func (*T) ProvisionAsLeader

func (t *T) ProvisionAsLeader(ctx context.Context) error

func (*T) ProvisionConflicts

func (t *T) ProvisionConflicts(ctx context.Context) []string

ProvisionConflicts says the encrypted device exists already, which the provision would adopt.

func (*T) Provisioned

func (t *T) Provisioned(ctx context.Context) (provisioned.T, error)

func (*T) ReservableDevices

func (t *T) ReservableDevices(ctx context.Context) device.L

func (*T) Resize

func (t *T) Resize(ctx context.Context, to int64) error

Resize implements resource.Resizer.

The passphrase is handed over the same way opening it does: a luks2 volume derives its key again to resize, and asks for it on the terminal otherwise.

func (*T) ResizeHandsOut

func (t *T) ResizeHandsOut(ctx context.Context) (func(below int64) int64, error)

ResizeHandsOut implements resource.ResizeHandsOuter.

A luks volume given a device of below hands out below less the header in front of it, in whole sectors: the inverse of ResizePlan.

func (*T) ResizePlan

func (t *T) ResizePlan(ctx context.Context, to int64) (int64, error)

ResizePlan implements resource.Resizer.

What it asks of the device below is the size wanted plus the header in front of it. The header offset is written when the volume is formatted and does not move, so it is read rather than measured as the gap between the two: that gap is the growth itself while a resize is in flight, and asking for it again compounds every pass.

func (*T) Start

func (t *T) Start(ctx context.Context) error

func (*T) Status

func (t *T) Status(ctx context.Context) status.T

func (*T) Stop

func (t *T) Stop(ctx context.Context) error

func (*T) SubDevices

func (t *T) SubDevices(ctx context.Context) device.L

func (*T) UnprovisionAsLeader

func (t *T) UnprovisionAsLeader(ctx context.Context) error

Jump to

Keyboard shortcuts

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