git: c6bdb5d46872 - stable/13 - EC2: Allow AMI boot mode to be specified

Colin Percival cperciva at FreeBSD.org
Sat Sep 25 16:23:51 UTC 2021


The branch stable/13 has been updated by cperciva:

URL: https://cgit.FreeBSD.org/src/commit/?id=c6bdb5d46872386ce4eeab8c47937c73ab7be92e

commit c6bdb5d46872386ce4eeab8c47937c73ab7be92e
Author:     Colin Percival <cperciva at FreeBSD.org>
AuthorDate: 2021-09-16 02:15:44 +0000
Commit:     Colin Percival <cperciva at FreeBSD.org>
CommitDate: 2021-09-25 16:11:48 +0000

    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".
    
    Sponsored by:   https://www.patreon.com/cperciva
    
    (cherry picked from commit 0aa2a94ea6359fb2587af81841fbf8eb30ab36b0)
---
 release/Makefile.ec2 | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/release/Makefile.ec2 b/release/Makefile.ec2
index 58042cba1f88..c82620ea5cd6 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}


More information about the dev-commits-src-branches mailing list