Update partition label with the store one before asking for a passphrase

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
This commit is contained in:
Dimitris Karakasilis
2022-11-11 13:14:31 +02:00
parent 4a6c79f6a6
commit 29f22e7f92
3 changed files with 44 additions and 1 deletions

View File

@@ -38,6 +38,16 @@ func (pi PartitionInfo) LookupUUIDForLabel(l string) string {
return pi.mapping[l]
}
func (pi PartitionInfo) LookupLabelForUUID(uuid string) string {
for k, v := range pi.mapping {
if v == uuid {
return k
}
}
return ""
}
// UpdatePartitionLabelMapping takes partition information as a string argument
// the the form: `label:name:uuid` (that's what the `kcrypt encrypt` command returns
// on success. This function stores it in the PartitionInfoFile yaml file for