mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-09-26 14:03:57 +00:00
Mount OEM during kcrypt hook (#18)
This commit is contained in:
@@ -2,6 +2,7 @@ package hook
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/kairos-io/kairos-sdk/machine"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/kairos-io/kairos-sdk/utils"
|
"github.com/kairos-io/kairos-sdk/utils"
|
||||||
@@ -16,6 +17,12 @@ func (k Kcrypt) Run(c config.Config) error {
|
|||||||
return nil
|
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 {
|
for _, p := range c.Install.Encrypt {
|
||||||
out, err := utils.SH(fmt.Sprintf("kcrypt encrypt %s", p))
|
out, err := utils.SH(fmt.Sprintf("kcrypt encrypt %s", p))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -27,7 +34,6 @@ func (k Kcrypt) Run(c config.Config) error {
|
|||||||
time.Sleep(10 * time.Second)
|
time.Sleep(10 * time.Second)
|
||||||
return nil // do not error out
|
return nil // do not error out
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
Reference in New Issue
Block a user