git: c34cce0a2bae - releng/14.0 - EC2: Flavour existing AMIs as "base"

From: Colin Percival <cperciva_at_FreeBSD.org>
Date: Thu, 05 Oct 2023 15:54:34 UTC
The branch releng/14.0 has been updated by cperciva:

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

commit c34cce0a2bae98ca1fcd1bba6c462f99e733d36b
Author:     Colin Percival <cperciva@FreeBSD.org>
AuthorDate: 2023-09-09 00:51:57 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2023-10-05 15:54:04 +0000

    EC2: Flavour existing AMIs as "base"
    
    Using the recently-added "cloudware flavours" mechanism, turn the
    existing EC2 AMIs into a new "base" flavour.  The only user-visible
    change is that AMI names now include the word "base".
    
    Approved by:    re (gjb)
    Sponsored by:   https://www.patreon.com/cperciva
    Differential Revision:  https://reviews.freebsd.org/D41791
    
    (cherry picked from commit 7494fb6b7d809257d4eb9eff06ce226143f27add)
    (cherry picked from commit a18905a9bfccc962f67b8a6067e7cbd4eb2bba17)
---
 release/Makefile.ec2                      | 16 +++++++++-------
 release/Makefile.vm                       |  1 +
 release/tools/{ec2.conf => ec2-base.conf} |  0
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/release/Makefile.ec2 b/release/Makefile.ec2
index b3f32d0e3efb..c674c967ff57 100644
--- a/release/Makefile.ec2
+++ b/release/Makefile.ec2
@@ -51,11 +51,12 @@ cw-ec2-portinstall:
 	@touch ${.TARGET}
 
 .for _FS in ${EC2_FSLIST}
+.for _FL in ${EC2_FLAVOURS:tl}
 .if defined(SSMPREFIX) && !empty(SSMPREFIX)
-SSMOPTS_${_FS}=	--ssm-name ${SSMPREFIX}/${TARGET_ARCH:S/aarch64/arm64/}/base/${_FS}/${REVISION}/${BRANCH}
+SSMOPTS_${_FL}_${_FS}=	--ssm-name ${SSMPREFIX}/${TARGET_ARCH:S/aarch64/arm64/}/${_FL}/${_FS}/${REVISION}/${BRANCH}
 .endif
-EC2AMILIST+=	ec2ami-${_FS}
-ec2ami-${_FS}: cw-ec2-${_FS} ${CW_EC2_PORTINSTALL}
+EC2AMILIST+=	ec2ami-${_FL}-${_FS}
+ec2ami-${_FL}-${_FS}: cw-ec2-${_FL}-${_FS} ${CW_EC2_PORTINSTALL}
 .if !defined(AWSKEYFILE) || !exists(${AWSKEYFILE})
 	@echo "--------------------------------------------------------------"
 	@echo ">>> AWSKEYFILE must point at AWS keys for EC2 AMI creation"
@@ -75,14 +76,15 @@ ec2ami-${_FS}: cw-ec2-${_FS} ${CW_EC2_PORTINSTALL}
 	@false
 .endif
 	/usr/local/bin/bsdec2-image-upload ${PUBLISH} ${PUBLICSNAP} \
-	    ${EC2ARCH} ${SSMOPTS_${_FS}} ${BOOTMODEOPT} --sriov --ena \
-	    ${.OBJDIR}/${EC2${_FS:tu}IMAGE} \
-	    "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX} ${AMIBOOTMETHOD} ${_FS:tu}" \
+	    ${EC2ARCH} ${SSMOPTS_${_FL}_${_FS}} ${BOOTMODEOPT} --sriov --ena \
+	    ${.OBJDIR}/${EC2-${_FL:tu}${_FS:tu}IMAGE} \
+	    "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX} ${AMIBOOTMETHOD} ${_FL} ${_FS:tu}" \
 	    "${TYPE}/${TARGET} ${GITBRANCH}@${GITREV}" \
 	    ${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE} \
 	    ${EC2SNSTOPIC} ${EC2SNSREL} ${EC2SNSVERS}
 	@touch ${.TARGET}
 .endfor
+.endfor
 
-ec2ami: ec2ami-${VMFS}
+ec2ami: ec2ami-base-${VMFS}
 ec2amis: ${EC2AMILIST}
diff --git a/release/Makefile.vm b/release/Makefile.vm
index e7ff86c28df3..8828b99599e7 100644
--- a/release/Makefile.vm
+++ b/release/Makefile.vm
@@ -31,6 +31,7 @@ BASIC-CI_DESC=		Image for CI
 EC2_FORMAT=	raw
 EC2_FSLIST=	ufs zfs
 EC2_DESC=	Amazon EC2 image
+EC2_FLAVOURS=	BASE
 GCE_FORMAT=	raw
 GCE_FSLIST=	ufs
 GCE_DESC=	Google Compute Engine image
diff --git a/release/tools/ec2.conf b/release/tools/ec2-base.conf
similarity index 100%
rename from release/tools/ec2.conf
rename to release/tools/ec2-base.conf