Search for lvm partitions on upgrade (#78)

This commit is contained in:
Itxaka 2023-07-07 17:35:41 +02:00 committed by GitHub
parent fa9fe3177e
commit 5f26f80349
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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