mirror of
https://github.com/kairos-io/kairos-sdk.git
synced 2025-09-24 20:36:59 +00:00
cryptsetup v2.8 does not allow slashes (#623)
* cryptsetup v2.8 does not allow slashes Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com> * add comment Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com> --------- Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
This commit is contained in:
@@ -221,7 +221,9 @@ func formatLuks(device, name, mapper, label, pass string, logger types.KairosLog
|
||||
|
||||
// Refresh needs the password as its doing actions on the device directly
|
||||
l.Debug().Msg("discards")
|
||||
cmd := exec.Command("cryptsetup", "refresh", "--persistent", "--allow-discards", mapper)
|
||||
// Note: cryptsetup v2.8+ expects the device name (not the device path) for the 'refresh' command.
|
||||
// Using 'name' with v2.7 also works, hence why no fallback is needed for backward compatibility.
|
||||
cmd := exec.Command("cryptsetup", "refresh", "--persistent", "--allow-discards", name)
|
||||
cmd.Stdin = strings.NewReader(pass)
|
||||
output, err := cmd.CombinedOutput()
|
||||
|
||||
|
Reference in New Issue
Block a user