disk-mapper: systemd cryptsetup unit for state disk

This commit is contained in:
Malte Poll 2022-08-15 14:50:03 +02:00 committed by Malte Poll
parent 0892525915
commit da41cb6962
6 changed files with 311 additions and 87 deletions

View file

@ -18,6 +18,7 @@ type DeviceMapper interface {
DiskUUID() string
FormatDisk(passphrase string) error
MapDisk(target string, passphrase string) error
UnmapDisk(target string) error
}
// KeyWaiter is an interface to request and wait for disk decryption keys.
@ -26,6 +27,11 @@ type KeyWaiter interface {
ResetKey()
}
// ConfigurationGenerator is an interface for generating systemd-cryptsetup@.service unit files.
type ConfigurationGenerator interface {
Generate(volumeName, encryptedDevice, keyFile, options string) error
}
// DiskMounter uses the syscall package to mount disks.
type DiskMounter struct{}