From nobody Wed Sep 11 05:29:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X3Tf72vjgz5WDB0; Wed, 11 Sep 2024 05:29:35 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X3Tf71Tysz4mbl; Wed, 11 Sep 2024 05:29:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726032575; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jFF6zeR+y/UCoW8HzPTRNSJJ0G+74KyVtmWEYSJr3iU=; b=yfstM2+4Pk2NlU6VE206c0wcw1Vb15W2wF3blMtIh8zSyacWmc8/6e+GF1ihGx6e8M5x09 CsxxFgPAAlBVYjxony41XMx8oL+XQrTWsFH6DidEKPaOsw2BFQ6h9UUGRMKa7cM48KZlqJ Fc9m1I5lNoZstvA7c8NOY732GRLZoUTWP5PI6zVwjKIXwmz54Tl7Zga60pfCwIZr9eNa20 rNI5u6gmYidodTXSsbG1MjbtgI08VXlb5m9be4b2lL1tRLuMjioqSJHYWcO/eNRqz+dMoU oarHWW/e9/TUMfORW/WY+YVCyfzYppgqtGd/SIAS7xqHnJABUx95N5vWXk2Y3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726032575; a=rsa-sha256; cv=none; b=GSDNYQaVhGjOneAn9P4z1qcDl6hQcB/kefZdsyFUWjOo24/Yuwzs3c+DnpIahuXaRu+tQQ DTJ+Xq/yKrPAQB9lzIvzEOUTPiU3JE0QYMAx6MYWzEUgqtxb0LUACRnPtNn9SLt+MPjE1B Fcof+AFz62MhgwcKprx/24fc+nZDh/V1eOyP/gCAex/fPVhyDKddwr8D4Ro2KONmPn7xPn zYJiDxi5xCY0WwGzSyeAiT70qha8OEQ1Mw30yD7RfnuYVVnzqQYc2ZYazdydqqa3TZZdXK N1VjSaTkuyY0ZeaAmnNnObhwLlexhpjZNg401safXrl0g44r7k/Cj0NgU4j17g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726032575; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jFF6zeR+y/UCoW8HzPTRNSJJ0G+74KyVtmWEYSJr3iU=; b=uGNL9eXPNSApe4XALQ6GNt7ImlzwlY17orURBj0V5MZlbND767aeE982QnBAzxP2SFKU+g 2y7V0ifQ+X1gSNpgBMseKg5VcvM0mSJ2+fPC+xJUqTf1HcN+Hc88EyKYaVukXyosRiq9AP 8PGyyeX/VJaOtagabzVz1mHK/rNnkPfzbBrXyUtsJYlKJz2ZQ2qDSmYEru2N5dsUtHILNu a8svQkj7WPNVvAUuAgUQ1WStJLwKl9hbNno5/CNWapeVynHUDl+LV1SrrUHBHLlfoVxo+A b3KISwA89g8JQQMLCX3wQr4XMyb4y5XTmbndyzwkJ0Qe9TznXoUppVeTr9LZ7A== 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 4X3Tf7163XzHyQ; Wed, 11 Sep 2024 05:29:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48B5TZvg065223; Wed, 11 Sep 2024 05:29:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48B5TZo2065220; Wed, 11 Sep 2024 05:29:35 GMT (envelope-from git) Date: Wed, 11 Sep 2024 05:29:35 GMT Message-Id: <202409110529.48B5TZo2065220@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 953142d6baf3 - stable/14 - EC2: Add new "small" AMIs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 953142d6baf3f0fcde98da9455f5936f735613fb Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=953142d6baf3f0fcde98da9455f5936f735613fb commit 953142d6baf3f0fcde98da9455f5936f735613fb Author: Colin Percival AuthorDate: 2024-08-31 23:55:06 +0000 Commit: Colin Percival CommitDate: 2024-09-11 05:28:59 +0000 EC2: Add new "small" AMIs These are the same as the standard "base" images except: * They don't have kernel or world debug symbols, * They don't have FreeBSD tests, * They don't have 32-bit libraries, * They don't have LLDB, * They don't have the Amazon SSM Agent pre-installed, * They don't default to installing the awscli at first boot. This reduces the amount of disk space in use when the EC2 instance finishes booting from ~5 GB to ~1 GB. Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D46509 (cherry picked from commit 647299caa06e38622dc05a4358f9407b62a9bdda) --- release/Makefile.vm | 3 ++- release/tools/ec2-small.conf | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/release/Makefile.vm b/release/Makefile.vm index 8c48c0a13dc9..3bfe2d8bfee0 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -35,9 +35,10 @@ BASIC-CLOUDINIT_FSLIST?= ufs zfs BASIC-CLOUDINIT_DESC?= Images for VM with cloudinit disk config support EC2_FORMAT= raw EC2_FSLIST?= ufs zfs -EC2_FLAVOURS?= BASE CLOUD-INIT +EC2_FLAVOURS?= BASE CLOUD-INIT SMALL EC2-BASE_DESC= Amazon EC2 image EC2-CLOUD-INIT_DESC= Amazon EC2 Cloud-Init image +EC2-SMALL_DESC= Amazon EC2 small image GCE_FORMAT= raw GCE_FSLIST?= ufs zfs GCE_DESC= Google Compute Engine image diff --git a/release/tools/ec2-small.conf b/release/tools/ec2-small.conf new file mode 100644 index 000000000000..858836717f5a --- /dev/null +++ b/release/tools/ec2-small.conf @@ -0,0 +1,44 @@ +#!/bin/sh + +. ${WORLDDIR}/release/tools/ec2.conf + +# Build with a 4.9 GB partition; the growfs rc.d script will expand +# the partition to fill the root disk after the EC2 instance is launched. +# Note that if this is set to G, we will end up with an GB disk +# image since VMSIZE is the size of the filesystem partition, not the disk +# which it resides within. (This overrides the default in ec2.conf.) +export VMSIZE=5000m + +# Flags to installworld/kernel: We don't want debug symbols (kernel or +# userland), 32-bit libraries, tests, or the debugger. +export INSTALLOPTS="WITHOUT_DEBUG_FILES=YES WITHOUT_KERNEL_SYMBOLS=YES \ + WITHOUT_LIB32=YES WITHOUT_TESTS=YES WITHOUT_LLDB=YES" + +# Packages to install into the image we're creating. In addition to packages +# present on all EC2 AMIs, we install: +# * ec2-scripts, which provides a range of EC2ification startup scripts, +# * firstboot-freebsd-update, to install security updates at first boot, +# * firstboot-pkgs, to install packages at first boot, and +# * isc-dhcp44-client, used for IPv6 network setup. +export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} ec2-scripts \ + firstboot-freebsd-update firstboot-pkgs isc-dhcp44-client" + +# Services to enable in rc.conf(5). +export VM_RC_LIST="${VM_RC_LIST} ec2_configinit ec2_ephemeral_swap \ + ec2_fetchkey ec2_loghostkey firstboot_freebsd_update firstboot_pkgs \ + growfs sshd" + +vm_extra_pre_umount() { + # Any EC2 ephemeral disks seen when the system first boots will + # be "new" disks; there is no "previous boot" when they might have + # been seen and used already. + touch ${DESTDIR}/var/db/ec2_ephemeral_diskseen + + # Configuration common to all EC2 AMIs + ec2_common + + # Standard FreeBSD network configuration + ec2_base_networking + + return 0 +}