Skip to content

Commit

Permalink
rhel9: add dropin to disable grub timer
Browse files Browse the repository at this point in the history
This will disable the grub-boot-success timer if greenboot exists to
ensure greenboot functions correctly and the timer does not modify the
boot_success flag when a ssh session persists for more than 2 min. This
customization is added to containerImage and edgeCommitImage.

Signed-off-by: Sayan Paul <paul.sayan@gmail.com>
  • Loading branch information
say-paul authored and achilleas-k committed Aug 17, 2023
1 parent e80a291 commit 719716d
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions pkg/distro/rhel9/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,18 @@ func edgeCommitImage(workload workload.Workload,
if !common.VersionLessThan(t.arch.distro.osVersion, "9.2") || t.arch.distro.osVersion == "9-stream" {
img.OSCustomizations.EnabledServices = append(img.OSCustomizations.EnabledServices, "ignition-firstboot-complete.service", "coreos-ignition-write-issues.service")
}
img.OSCustomizations.SystemdUnit = []*osbuild.SystemdUnitStageOptions{
{
Unit: "grub-boot-success.timer",
Dropin: "10-disable-if-greenboot.conf",
UnitType: osbuild.Global,
Config: osbuild.SystemdServiceUnitDropin{
Unit: &osbuild.SystemdUnitSection{
FileExists: "!/usr/libexec/greenboot/greenboot",
},
},
},
}
img.Environment = t.environment
img.Workload = workload

Expand Down Expand Up @@ -334,6 +346,19 @@ func edgeContainerImage(workload workload.Workload,
img.OSCustomizations.EnabledServices = append(img.OSCustomizations.EnabledServices, "ignition-firstboot-complete.service", "coreos-ignition-write-issues.service")
}

img.OSCustomizations.SystemdUnit = []*osbuild.SystemdUnitStageOptions{
{
Unit: "grub-boot-success.timer",
Dropin: "10-disable-if-greenboot.conf",
UnitType: osbuild.Global,
Config: osbuild.SystemdServiceUnitDropin{
Unit: &osbuild.SystemdUnitSection{
FileExists: "!/usr/libexec/greenboot/greenboot",
},
},
},
}

return img, nil
}

Expand Down

0 comments on commit 719716d

Please sign in to comment.