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 2ef34ba commit eea0ebc
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions pkg/distro/rhel/rhel9/distro.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ 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
if rd.IsRHEL() && common.VersionLessThan(rd.OsVersion(), "9.3") {
ec2X86Platform.UEFIVendor = ""
}

x86_64.AddImageTypes(
ec2X86Platform,
mkAMIImgTypeX86_64(),
Expand Down Expand Up @@ -337,16 +343,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 eea0ebc

Please sign in to comment.