Also unlock with TPM

so we can use the same functions everywhere just with a flag

Signed-off-by: Itxaka <itxaka@kairos.io>
This commit is contained in:
Itxaka
2023-11-30 11:39:21 +01:00
parent e73e33b26d
commit 94af8c8dd3
2 changed files with 20 additions and 6 deletions

10
main.go
View File

@@ -55,9 +55,15 @@ func main() {
UsageText: "unlock-all",
Usage: "Try to unlock all LUKS partitions",
Description: "Typically run during initrd to unlock all the LUKS partitions found",
ArgsUsage: "kcrypt unlock-all",
ArgsUsage: "kcrypt [--tpm] unlock-all",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "tpm",
Usage: "Use TPM to unlock the partition",
},
},
Action: func(c *cli.Context) error {
return lib.UnlockAll()
return lib.UnlockAll(c.Bool("tpm"))
},
},
{