Mount OEM during kcrypt hook (#18)

This commit is contained in:
Itxaka
2023-05-09 21:57:16 +02:00
committed by GitHub
parent c43622b86e
commit cda46877ba

View File

@@ -2,6 +2,7 @@ package hook
import (
"fmt"
"github.com/kairos-io/kairos-sdk/machine"
"time"
"github.com/kairos-io/kairos-sdk/utils"
@@ -16,6 +17,12 @@ func (k Kcrypt) Run(c config.Config) error {
return nil
}
// Config passed during install ends up here, so we need to read it
_ = machine.Mount("COS_OEM", "/oem")
defer func() {
_ = machine.Umount("/oem") //nolint:errcheck
}()
for _, p := range c.Install.Encrypt {
out, err := utils.SH(fmt.Sprintf("kcrypt encrypt %s", p))
if err != nil {
@@ -27,7 +34,6 @@ func (k Kcrypt) Run(c config.Config) error {
time.Sleep(10 * time.Second)
return nil // do not error out
}
}
return nil