Skip to content

Commit

Permalink
Fix oem mountpoint not available on upgrade (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
Itxaka authored Jul 19, 2023
1 parent 9a16b94 commit 4bc5ea1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 0 additions & 4 deletions pkg/action/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,13 @@ package action
import (
v1 "github.com/kairos-io/kairos-agent/v2/pkg/types/v1"
"github.com/kairos-io/kairos-agent/v2/pkg/utils"
"github.com/sirupsen/logrus"
)

// Hook is RunStage wrapper that only adds logic to ignore errors
// in case v1.RunConfig.Strict is set to false
func Hook(config *v1.Config, hook string, strict bool, cloudInitPaths ...string) error {
config.Logger.Infof("Running %s hook", hook)
oldLevel := config.Logger.GetLevel()
config.Logger.SetLevel(logrus.ErrorLevel)
err := utils.RunStage(config, hook, strict, cloudInitPaths...)
config.Logger.SetLevel(oldLevel)
if !strict {
err = nil
}
Expand Down
5 changes: 5 additions & 0 deletions pkg/elementalConfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,11 @@ func NewUpgradeSpec(cfg v1.Config) (*v1.UpgradeSpec, error) {
}
}

// If we have oem in the system, but it has no mountpoint
if ep.OEM != nil && ep.OEM.MountPoint == "" {
// Add the default mountpoint for it in case the chroot stages want to bind mount it
ep.OEM.MountPoint = constants.OEMPath
}
// This is needed if we want to use the persistent as tmpdir for the upgrade images
// as tmpfs is 25% of the total RAM, we cannot rely on the tmp dir having enough space for our image
// This enables upgrades on low ram devices
Expand Down

0 comments on commit 4bc5ea1

Please sign in to comment.