Skip to content

Commit

Permalink
Recovery back to ext2 by default
Browse files Browse the repository at this point in the history
Signed-off-by: David Cassany <dcassany@suse.com>
  • Loading branch information
davidcassany committed Jan 30, 2024
1 parent d6a2136 commit e0255d5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,10 @@ func NewInstallSpec(cfg v1.Config) *v1.InstallSpec {
}

recoverySystem.Source = system
recoverySystem.FS = constants.SquashFs
recoverySystem.Label = ""
recoverySystem.FS = constants.LinuxImgFs
recoverySystem.Label = constants.SystemLabel
recoverySystem.File = filepath.Join(constants.RecoveryDir, constants.RecoveryImgFile)
recoverySystem.MountPoint = constants.WorkingImgDir

return &v1.InstallSpec{
Firmware: v1.EFI,
Expand Down
3 changes: 1 addition & 2 deletions pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,12 @@ const (
OEMDir = "/run/elemental/oem"
PersistentDir = "/run/elemental/persistent"
PersistentStateDir = "/run/elemental/persistent/.state"
ActiveDir = "/run/elemental/active"
TransitionDir = "/run/elemental/transition"
EfiDir = "/run/elemental/efi"
ImgSrcDir = "/run/elemental/imgsrc"
WorkingImgDir = "/run/elemental/workingtree"
OverlayDir = "/run/elemental/overlay"
RunningStateDir = "/run/initramfs/elemental-state" // TODO: converge this constant with StateDir/RecoveryDir when moving to elemental-rootfs as default rootfs feature.
LegacyStateDir = "/run/initramfs/cos-state"

// Running mode sentinel files
ActiveMode = "/run/elemental/active_mode"
Expand Down Expand Up @@ -183,6 +181,7 @@ const (
LegacyImagesPath = "cOS"
LegacyPassivePath = LegacyImagesPath + "/passive.img"
LegacyActivePath = LegacyImagesPath + "/active.img"
LegacyStateDir = "/run/initramfs/cos-state"
)

// GetDefaultSystemEcludes returns a list of transient paths
Expand Down
2 changes: 1 addition & 1 deletion pkg/elemental/elemental_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ var _ = Describe("Elemental", Label("elemental"), func() {
Size: 32,
File: filepath.Join(constants.StateDir, "some.img"),
FS: constants.LinuxImgFs,
MountPoint: constants.ActiveDir,
MountPoint: constants.TransitionDir,
Source: v1.NewDirSrc(constants.ISOBaseTree),
}
_ = utils.MkdirAll(fs, constants.ISOBaseTree, constants.DirPerm)
Expand Down
2 changes: 2 additions & 0 deletions pkg/types/v1/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ func (i *InstallSpec) Sanitize() error {
// Set default label for non squashfs images
if i.RecoverySystem.FS != constants.SquashFs && i.RecoverySystem.Label == "" {
i.RecoverySystem.Label = constants.SystemLabel
} else if i.RecoverySystem.FS == constants.SquashFs {
i.RecoverySystem.Label = ""
}

// Check for extra partitions having set its size to 0
Expand Down

0 comments on commit e0255d5

Please sign in to comment.