mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-09-25 21:43:58 +00:00
Mount OEM during kcrypt hook (#18)
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user