AB#1902 Ping Coordinator from initramfs for key (#53)

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2022-04-12 14:24:36 +02:00 committed by GitHub
parent 7e990fb91a
commit 49a1a07049
20 changed files with 827 additions and 267 deletions

View file

@ -36,6 +36,16 @@ func (m *Mapper) Close() error {
return errors.New("unable to close crypt device")
}
// IsLUKSDevice returns true if the device is formatted as a LUKS device.
func (m *Mapper) IsLUKSDevice() bool {
return m.device.Load(cryptsetup.LUKS2{}) == nil
}
// GetUUID gets the device's UUID.
func (m *Mapper) DiskUUID() string {
return m.device.GetUUID()
}
// FormatDisk formats the disk and adds passphrase in keyslot 0.
func (m *Mapper) FormatDisk(passphrase string) error {
luksParams := cryptsetup.LUKS2{