mirror of
https://github.com/kairos-io/kcrypt.git
synced 2025-09-01 13:18:50 +00:00
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:
6
main.go
6
main.go
@@ -279,11 +279,17 @@ func injectInitrd(initrd string, file, dst string) error {
|
||||
func unlockAll() error {
|
||||
bus.Manager.Initialize()
|
||||
|
||||
partitionInfo, err := pi.NewPartitionInfoFromFile(pi.DefaultPartitionInfoFile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
block, err := ghw.Block()
|
||||
if err == nil {
|
||||
for _, disk := range block.Disks {
|
||||
for _, p := range disk.Partitions {
|
||||
if p.Type == "crypto_LUKS" {
|
||||
p.Label = partitionInfo.LookupLabelForUUID(p.UUID)
|
||||
fmt.Printf("Unmounted Luks found at '%s' LABEL '%s' \n", p.Name, p.Label)
|
||||
err = multierror.Append(err, unlockDisk(p))
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user