EC2: Respect ${VMFS}

Prior to this commit, ${VMFS} controlled the filesystem used for
building EC2 images, but the AMIs were recorded with SSM Parameter
paths which indicated that they were UFS.

This commit (a) uses ${VMFS} in the SSM parameter path instead of
a hard-coded "ufs", and (b) adds the filesystem to the AMI name.

Reviewed by:	gjb
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D41342
This commit is contained in:
Colin Percival 2023-08-06 18:55:37 -07:00
parent 8dec47387b
commit 4c9c9b4b74

View File

@ -19,7 +19,7 @@ EC2SNSREL= ${REVISION}-${BRANCH}
EC2SNSVERS= ${GITBRANCH}@${GITREV} EC2SNSVERS= ${GITBRANCH}@${GITREV}
.endif .endif
.if defined(SSMPREFIX) && !empty(SSMPREFIX) .if defined(SSMPREFIX) && !empty(SSMPREFIX)
SSMOPTS= --ssm-name ${SSMPREFIX}/${TARGET_ARCH:S/aarch64/arm64/}/base/ufs/${REVISION}/${BRANCH} SSMOPTS= --ssm-name ${SSMPREFIX}/${TARGET_ARCH:S/aarch64/arm64/}/base/${VMFS}/${REVISION}/${BRANCH}
.endif .endif
.if ${TARGET_ARCH} != "amd64" .if ${TARGET_ARCH} != "amd64"
EC2ARCH= --${TARGET_ARCH:S/aarch64/arm64/} EC2ARCH= --${TARGET_ARCH:S/aarch64/arm64/}
@ -54,7 +54,7 @@ cw-ec2-portinstall:
.endif .endif
@touch ${.TARGET} @touch ${.TARGET}
ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL} ec2ami-${VMFS}: cw-ec2-${VMFS} ${CW_EC2_PORTINSTALL}
.if !defined(AWSKEYFILE) || !exists(${AWSKEYFILE}) .if !defined(AWSKEYFILE) || !exists(${AWSKEYFILE})
@echo "--------------------------------------------------------------" @echo "--------------------------------------------------------------"
@echo ">>> AWSKEYFILE must point at AWS keys for EC2 AMI creation" @echo ">>> AWSKEYFILE must point at AWS keys for EC2 AMI creation"
@ -76,8 +76,10 @@ ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL}
/usr/local/bin/bsdec2-image-upload ${PUBLISH} ${PUBLICSNAP} \ /usr/local/bin/bsdec2-image-upload ${PUBLISH} ${PUBLICSNAP} \
${EC2ARCH} ${SSMOPTS} ${BOOTMODEOPT} --sriov --ena \ ${EC2ARCH} ${SSMOPTS} ${BOOTMODEOPT} --sriov --ena \
${.OBJDIR}/ec2.raw \ ${.OBJDIR}/ec2.raw \
"${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX} ${AMIBOOTMETHOD}" \ "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX} ${AMIBOOTMETHOD} ${VMFS:tu}" \
"${TYPE}/${TARGET} ${GITBRANCH}@${GITREV}" \ "${TYPE}/${TARGET} ${GITBRANCH}@${GITREV}" \
${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE} \ ${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE} \
${EC2SNSTOPIC} ${EC2SNSREL} ${EC2SNSVERS} ${EC2SNSTOPIC} ${EC2SNSREL} ${EC2SNSVERS}
@touch ${.TARGET} @touch ${.TARGET}
ec2ami: ec2ami-${VMFS}