mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-09-01 09:06:26 +00:00
Mount EFI partition as RW, to rotate recovery -> active on reset
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
This commit is contained in:
@@ -523,12 +523,27 @@ func NewUkiResetSpec(cfg *Config) (spec *v1.ResetUkiSpec, err error) {
|
||||
spec.Partitions.Persistent = partitions.GetPartitionViaDM(cfg.Fs, constants.PersistentLabel)
|
||||
spec.Partitions.OEM = partitions.GetPartitionViaDM(cfg.Fs, constants.OEMLabel)
|
||||
|
||||
// Get EFI partition
|
||||
parts, err := partitions.GetAllPartitions()
|
||||
if err != nil {
|
||||
return spec, fmt.Errorf("could not read host partitions")
|
||||
}
|
||||
for _, p := range parts {
|
||||
if p.FilesystemLabel == constants.EfiLabel {
|
||||
spec.Partitions.EFI = p
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if spec.Partitions.Persistent == nil {
|
||||
return spec, fmt.Errorf("persistent partition not found")
|
||||
}
|
||||
if spec.Partitions.OEM == nil {
|
||||
return spec, fmt.Errorf("oem partition not found")
|
||||
}
|
||||
if spec.Partitions.EFI == nil {
|
||||
return spec, fmt.Errorf("efi partition not found")
|
||||
}
|
||||
|
||||
// Fill oem partition
|
||||
err = unmarshallFullSpec(cfg, "reset", spec)
|
||||
|
Reference in New Issue
Block a user