From owner-dev-commits-src-all@freebsd.org Thu Sep 16 19:23:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E85567F82C; Thu, 16 Sep 2021 19:23:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9RpB2fM1z4S1X; Thu, 16 Sep 2021 19:23:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3AC68271F2; Thu, 16 Sep 2021 19:23:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18GJNkFC067171; Thu, 16 Sep 2021 19:23:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18GJNkWt067170; Thu, 16 Sep 2021 19:23:46 GMT (envelope-from git) Date: Thu, 16 Sep 2021 19:23:46 GMT Message-Id: <202109161923.18GJNkWt067170@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 0aa2a94ea635 - main - EC2: Allow AMI boot mode to be specified MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0aa2a94ea6359fb2587af81841fbf8eb30ab36b0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 19:23:46 -0000 The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=0aa2a94ea6359fb2587af81841fbf8eb30ab36b0 commit 0aa2a94ea6359fb2587af81841fbf8eb30ab36b0 Author: Colin Percival AuthorDate: 2021-09-16 02:15:44 +0000 Commit: Colin Percival CommitDate: 2021-09-16 19:23:19 +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". MFC after: 1 week Sponsored by: https://www.patreon.com/cperciva --- release/Makefile.ec2 | 14 ++++++++++++-- 1 file 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}