mirror of
https://github.com/kairos-io/kcrypt.git
synced 2025-06-26 07:22:01 +00:00
Fix label
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
This commit is contained in:
parent
f5dc23f554
commit
47e7f67e04
@ -35,6 +35,7 @@ func UnlockAll() error {
|
|||||||
if p.Type == "crypto_LUKS" {
|
if p.Type == "crypto_LUKS" {
|
||||||
// Get the luks UUID directly from cryptsetup
|
// Get the luks UUID directly from cryptsetup
|
||||||
volumeUUID, err := utils.SH(fmt.Sprintf("cryptsetup luksUUID %s", filepath.Join("/dev", p.Name)))
|
volumeUUID, err := utils.SH(fmt.Sprintf("cryptsetup luksUUID %s", filepath.Join("/dev", p.Name)))
|
||||||
|
fmt.Printf("Got luks UUID %s for partition %s\n", volumeUUID, p.Name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -43,14 +44,14 @@ func UnlockAll() error {
|
|||||||
fmt.Printf("No uuid for %s, skipping\n", p.Name)
|
fmt.Printf("No uuid for %s, skipping\n", p.Name)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
p.Label, err = config.GetLabelForUUID(volumeUUID)
|
p.FilesystemLabel, err = config.GetLabelForUUID(volumeUUID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// Check if device is already mounted
|
// Check if device is already mounted
|
||||||
// We mount it under /dev/mapper/DEVICE, so It's pretty easy to check
|
// We mount it under /dev/mapper/DEVICE, so It's pretty easy to check
|
||||||
if !utils.Exists(filepath.Join("/dev", "mapper", p.Name)) {
|
if !utils.Exists(filepath.Join("/dev", "mapper", p.Name)) {
|
||||||
fmt.Printf("Unmounted Luks found at '%s' LABEL '%s' \n", filepath.Join("/dev", p.Name), p.Label)
|
fmt.Printf("Unmounted Luks found at '%s' LABEL '%s' \n", filepath.Join("/dev", p.Name), p.FilesystemLabel)
|
||||||
err = UnlockDisk(p)
|
err = UnlockDisk(p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("Unlocking failed: '%s'\n", err.Error())
|
fmt.Printf("Unlocking failed: '%s'\n", err.Error())
|
||||||
|
Loading…
Reference in New Issue
Block a user