aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Percival <cperciva@FreeBSD.org>2021-09-16 02:15:44 +0000
committerColin Percival <cperciva@FreeBSD.org>2021-09-16 19:23:19 +0000
commit0aa2a94ea6359fb2587af81841fbf8eb30ab36b0 (patch)
treefb2baadc5bd35f58adaf3a5b8dc0d627d26e90f3
parentadb56e58e8db84d8087ebe3d3e7def0074cb5a90 (diff)
downloadsrc-0aa2a94ea6359fb2587af81841fbf8eb30ab36b0.tar.gz
src-0aa2a94ea6359fb2587af81841fbf8eb30ab36b0.zip
EC2: Allow AMI boot mode to be specified
The default boot method for amd64 AMIs is BIOS, but at AMI creation time a flag can be set to specify that UEFI should be used instead. This commit adds a variable AMIBOOTMETHOD which, if set to "UEFI", causes the appropriate flag to be set during AMI creation. The only boot method supported by EC2 for arm64 is UEFI. The names of AMIs are also amended to include the boot method; they now look like "FreeBSD 14.0-CURRENT-amd64-20210915 UEFI". MFC after: 1 week Sponsored by: https://www.patreon.com/cperciva
-rw-r--r--release/Makefile.ec214
1 files changed, 12 insertions, 2 deletions
diff --git a/release/Makefile.ec2 b/release/Makefile.ec2
index 5683cb6634b6..ce21d93c37ad 100644
--- a/release/Makefile.ec2
+++ b/release/Makefile.ec2
@@ -24,6 +24,16 @@ SSMOPTS= --ssm-name ${SSMPREFIX}/${TARGET_ARCH:S/aarch64/arm64/}/base/ufs/${REVI
.if ${TARGET_ARCH} != "amd64"
EC2ARCH= --${TARGET_ARCH:S/aarch64/arm64/}
.endif
+.if !defined(AMIBOOTMETHOD)
+.if ${TARGET_ARCH} == "amd64"
+AMIBOOTMETHOD= BIOS
+.else
+AMIBOOTMETHOD= UEFI
+.endif
+.endif
+.if ${AMIBOOTMETHOD} == "UEFI" && ${TARGET_ARCH} == "amd64"
+BOOTMODEOPT= --uefi
+.endif
CLEANFILES+= ec2ami
@@ -65,9 +75,9 @@ ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL}
@false
.endif
/usr/local/bin/bsdec2-image-upload ${PUBLISH} ${PUBLICSNAP} \
- ${EC2ARCH} ${SSMOPTS} --sriov --ena \
+ ${EC2ARCH} ${SSMOPTS} ${BOOTMODEOPT} --sriov --ena \
${.OBJDIR}/ec2.raw \
- "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}" \
+ "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX} ${AMIBOOTMETHOD}" \
"${TYPE}/${TARGET} ${GITBRANCH}@${GITREV}" \
${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE} \
${EC2SNSTOPIC} ${EC2SNSREL} ${EC2SNSVERS}