1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-21 07:15:49 +00:00

EC2: Drop UEFI-PREFERRED from AMI names

Starting in September 2021 EC2 AMI names have included the boot method:
"BIOS", "UEFI", or "UEFI-PREFERRED".  The third option became available
in June 2023 and allows AMIs to boot via UEFI on EC2 instance types
which support that, but fall back to (much slower) BIOS booting on the
instance types which don't support UEFI.

Since UEFI-PREFERRED is basically a best-of-both-worlds option and is
now the default, there's no point mentioning it in the AMI names.  If
for some reason an AMI is built with the boot method forced to BIOS or
UEFI, that will still be included in the AMI name.

This will not be MFCed, in case anyone has scripts which look at the AMI
names on 13.x/14.x.

Sponsored by:	Amazon
This commit is contained in:
Colin Percival 2024-08-18 02:05:52 +00:00
parent 2dac89aee3
commit c482d65cd1

View File

@ -29,6 +29,11 @@ BOOTMODEOPT= --uefi
.if ${AMIBOOTMETHOD} == "UEFI-PREFERRED" && ${TARGET_ARCH} == "amd64"
BOOTMODEOPT= --uefi-preferred
.endif
.if ${AMIBOOTMETHOD} == "UEFI-PREFERRED"
AMIBASENAME=${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}
.else
AMIBASENAME=${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX} ${AMIBOOTMETHOD}
.endif
CLEANFILES+= ec2ami
@ -83,7 +88,7 @@ ec2ami-${_FL}-${_FS}: cw-ec2-${_FL}-${_FS} ${CW_EC2_PORTINSTALL}
/usr/local/bin/bsdec2-image-upload ${PUBLISH} ${PUBLICSNAP} \
${EC2ARCH} ${SSMOPTS_${_FL}_${_FS}} ${BOOTMODEOPT} --sriov --ena \
${.OBJDIR}/${EC2-${_FL:tu}${_FS:tu}IMAGE} \
"${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX} ${AMIBOOTMETHOD} ${_FL} ${_FS:tu}" \
"${AMIBASENAME} ${_FL} ${_FS:tu}" \
"${TYPE}/${TARGET} ${GITBRANCH}@${GITREV}" \
${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE} \
${EC2SNSTOPIC} ${EC2SNSREL} ${EC2SNSVERS}