From 5f26f803495aceb64d089a26267ef7230d90c82b Mon Sep 17 00:00:00 2001 From: Itxaka Date: Fri, 7 Jul 2023 17:35:41 +0200 Subject: [PATCH] Search for lvm partitions on upgrade (#78) --- pkg/elementalConfig/config.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkg/elementalConfig/config.go b/pkg/elementalConfig/config.go index 537ed8c8..871b4afc 100644 --- a/pkg/elementalConfig/config.go +++ b/pkg/elementalConfig/config.go @@ -304,6 +304,21 @@ func NewUpgradeSpec(cfg v1.Config) (*v1.UpgradeSpec, error) { } ep := v1.NewElementalPartitionsFromList(parts) + if ep.Recovery == nil { + // We could have recovery in lvm which won't appear in ghw list + ep.Recovery = utils.GetPartitionViaDM(cfg.Fs, constants.RecoveryLabel) + } + + if ep.OEM == nil { + // We could have OEM in lvm which won't appear in ghw list + ep.OEM = utils.GetPartitionViaDM(cfg.Fs, constants.OEMLabel) + } + + if ep.Persistent == nil { + // We could have persistent encrypted or in lvm which won't appear in ghw list + ep.Persistent = utils.GetPartitionViaDM(cfg.Fs, constants.PersistentLabel) + } + if ep.Recovery != nil { if ep.Recovery.MountPoint == "" { ep.Recovery.MountPoint = constants.RecoveryDir