mirror of https://github.com/ericonr/sbctl.git
sbctl/create-keys: Rework output and keypath handling
In the future we might want to initialize a new set of keys. It makes sense to pass the output directory so we can create new keys directly in an alternative path and overwrite, e.g for key rotation. Signed-off-by: Morten Linderud <morten@linderud.pw>
This commit is contained in:
parent
1bf2810228
commit
d04e117cbc
|
@ -19,13 +19,15 @@ var createKeysCmd = &cobra.Command{
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
logging.Print("Using Owner UUID %s\n", uuid)
|
||||
logging.Print("Created Owner UUID %s\n", uuid)
|
||||
if !sbctl.CheckIfKeysInitialized(sbctl.KeysPath) {
|
||||
logging.Print("Creating secure boot keys...")
|
||||
err := sbctl.InitializeSecureBootKeys(sbctl.DatabasePath)
|
||||
err := sbctl.InitializeSecureBootKeys(sbctl.KeysPath)
|
||||
if err != nil {
|
||||
logging.NotOk("")
|
||||
return fmt.Errorf("couldn't initialize secure boot: %w", err)
|
||||
}
|
||||
logging.Ok("\nSecure boot keys created!")
|
||||
} else {
|
||||
logging.Ok("Secure boot keys has already been created!")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue