From nobody Wed Sep 04 05:57:20 2024 X-Original-To: dev-commits-src-main@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 4WzBbN5mXFz5VBRf; Wed, 04 Sep 2024 05:57:20 +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 4WzBbN317xz43mf; Wed, 4 Sep 2024 05:57:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725429440; 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=fBffU+5tT9ofJP2K4qraU3ZcUj6/Xgx1tdOXlSSEYDI=; b=MEoaKwBrIGqSif3isDkJ3diZC6GJ9jADx1ppOlq+jZtpEQLAqLX4nzWWVnziw/Dsx+CaYq qzsDu6CNACzeSRw8KpcoaTpmyrcW5AEJZv/ydc/QR2d0oT2EvrHeq0H4nZNvjtKt3DbPp8 mWQ/0mkLRimZTEWNPb0+l6qDhpCEP9ujAW2W5tLrA83Vo/zmTVkvLIQKKlx1KUv2m8zdX7 ZWreEr0Sghiq8Oh6Pp6WtYI933b1nhl2x4ofc1ADbwIFc+FNhavNyP95B87J5JEHT+BHC5 wvlHE6Xcy3251BovMon2mHqX8qTln8/S/EKvtYUV5GsrXBDxPqAp8VNi0CtrGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725429440; a=rsa-sha256; cv=none; b=a23+bkFSKS61lsLqEk75Gz9wrsAKgo0jDnFj6E1SvJAEipZ9YyHGUHG3H0JspkTNSalN3N mtqn/p7bgy1KaCDxKcbb5hnaU4ikwqutG8lLam8epKWVzNJY3oH37nI68AbAxAjrTwpUrT v2xDlHRWOY8HsWb694c5LMkbO4H9ILNAAVR367m1s09Ne4yr0FgFBMarfNueO9DN2myQ3k SZJoBvzAfGuPVmTcvw0yUb4qhez6EudpCVf8JkoGIBu4Fr3qyHnuLx0f9K0ps+05D1rRgf u4Cxtuph9BvLpRYY7/iHbW97ddBx0dhbwWp3fdEr/Q/OLtNGurZrNNtJuE2n0g== 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=1725429440; 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=fBffU+5tT9ofJP2K4qraU3ZcUj6/Xgx1tdOXlSSEYDI=; b=HrA8gfHP8LOM2Qr07GKX+0sWA+3GQH8CAxELz4NXZpWexOF4zI+BwiAWAvwzE0vXSCQPr6 IW/uk5utayCnidxGQgqYYVBO+Lrpc3/Mt9tH0BhThHmoYHoczZR3+UNR7MhJnA6+2l7kXM qpJHP5/1vr7hoOeyXYz9Yse/WxH+CAei5fvT7741zEQw5ylnJh7ehtGQQ99Cc+gN7z3Qgf ZT8elA0/LDfqTkqeTTeePZ6cn0LBT5iGLqk96ZxLOnsxaTLNTP5EAskkWFyI9L7c5Lpy84 KnCblBEyJYqxQ3PY2QiMjQxerROa3d5ZNen6GSORA8LmP7Ei/qm8EheSjDzChQ== 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 4WzBbN2Y2Kz1BRY; Wed, 4 Sep 2024 05:57:20 +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 4845vK3P099421; Wed, 4 Sep 2024 05:57:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4845vKdE099418; Wed, 4 Sep 2024 05:57:20 GMT (envelope-from git) Date: Wed, 4 Sep 2024 05:57:20 GMT Message-Id: <202409040557.4845vKdE099418@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: 647299caa06e - main - EC2: Add new "small" AMIs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 647299caa06e38622dc05a4358f9407b62a9bdda Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=647299caa06e38622dc05a4358f9407b62a9bdda commit 647299caa06e38622dc05a4358f9407b62a9bdda Author: Colin Percival AuthorDate: 2024-08-31 23:55:06 +0000 Commit: Colin Percival CommitDate: 2024-09-04 05:57:06 +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 --- 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 d8914d305e2f..b4fe6e23ffcd 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -39,9 +39,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 +}