Skip to content

Commit

Permalink
distro/rhel9: fix ami being hybrid for 9.2 and older
Browse files Browse the repository at this point in the history
    RHEL 9.2 and older doesn't support UEFI in AWS. The code correctly set
    it for EC2 images, but not for ami. This commit fixes that.
  • Loading branch information
ondrejbudai committed Dec 3, 2024
1 parent 292c935 commit 852ee6a
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions pkg/distro/rhel/rhel9/distro.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,15 @@ func newDistro(name string, major, minor int) *rhel.Distribution {
ImageFormat: platform.FORMAT_RAW,
},
}

// Keep the RHEL EC2 x86_64 images before 9.3 BIOS-only for backward compatibility.
// RHEL-internal EC2 images and RHEL AMI images are kept intentionally in sync
// with regard to not supporting hybrid boot mode before RHEL version X.Y.
// The partitioning table for these reflects that and is also intentionally in sync.
if rd.IsRHEL() && common.VersionLessThan(rd.OsVersion(), "9.3") {
ec2X86Platform.UEFIVendor = ""
}

x86_64.AddImageTypes(
ec2X86Platform,
mkAMIImgTypeX86_64(),
Expand Down Expand Up @@ -337,16 +346,6 @@ func newDistro(name string, major, minor int) *rhel.Distribution {

x86_64.AddImageTypes(azureX64Platform, mkAzureSapInternalImgType(rd))

// keep the RHEL EC2 x86_64 images before 9.3 BIOS-only for backward compatibility
if common.VersionLessThan(rd.OsVersion(), "9.3") {
ec2X86Platform = &platform.X86{
BIOS: true,
BasePlatform: platform.BasePlatform{
ImageFormat: platform.FORMAT_RAW,
},
}
}

// add ec2 image types to RHEL distro only
x86_64.AddImageTypes(ec2X86Platform, mkEc2ImgTypeX86_64(), mkEc2HaImgTypeX86_64(), mkEC2SapImgTypeX86_64(rd.OsVersion()))

Expand Down

0 comments on commit 852ee6a

Please sign in to comment.