From nobody Tue Oct 03 17:28:43 2023 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 4S0Ptg5Gj8z4vmKh; Tue, 3 Oct 2023 17:28:43 +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 4S0Ptg4Jqrz4L59; Tue, 3 Oct 2023 17:28:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696354123; 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=5h8lbvQW9RHSTkMww4l4OTvxnPosv6dmjnizcfrgoRA=; b=P560mI/G/+aAU0KYhtoQbBo/jjHltDYZvPk4SDZGiWP0fzzp4LTNOz55zifvezwR3YzA58 qUm4uaJQ3hdgmBIWMpVOMihtUwpstbgj1a44H/Jby01Syau2RLYhKyY/zIlsK+G48T7jyH tSSJoYqMTv1WX8DiF3T+J17mcB2YyUpNESnXW5gdOJKW55jHNb4ioOK/IziBeY9VH12WJF 9FcrqALlDzzyP6bw9uPqMh+VbCvck86c5kV8i9M3gd+0vfYDI3QAoAiDcoWoNG3MztoXsx g6Q5Pw518/YnIaI2W1E/nO4q38xc3dJQNBPB5AhbDRH3zqhOWcBzAYe5YgnhOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696354123; a=rsa-sha256; cv=none; b=TmKZbqw6OcIyN0cP72UcvhDEFdWYO2YtSpOvMm/uSHYnOvOPtYz31iauWkNpZPRSHDTXBm 7FiidxjMoekBmCXs3ElgWbgzI0k5AUqn73nBpmUP3IQjh6NMfvRB24MJREs7o16WyNW8PK hWG09JhWHuD4eq66Jg3dJHxL/fyC8J6Bzrs504Q9tBRygyiCMTjgNs8eQfZRsCa2ZfVVBb 40TSecB1sR9zX5kiegjJqlDbqrpBldl9jaSaKWdKfZK7cF3pYnRGEBEofczHSkSFmbJd02 flt4J1pp1Z26VQTi2xg4Dsv7PeuIBraxnRkB00BZlrcGIqB+QocTMy54EMPSHg== 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=1696354123; 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=5h8lbvQW9RHSTkMww4l4OTvxnPosv6dmjnizcfrgoRA=; b=bby9iGzjYIfgtOE0GMsvZVhRnNS8utFEUnnCXLWrJvbmIdy9VBdfmifVAaawS74y9+0Aqe DjUzwGqIJghbj3zf/56izUeK/5CqxBfKwHqolOerQI16L/HRbIH/aKUH+joH0hSGHzSS89 CcdIBjz+Qo0EwPadGRIBLjtrQLrGwtZhFgqJ30xSwtd3Bp8LePxk79LQy9TGWZMSNGmPRp sjvqf82lO/ZQDS0kbb8Vi6XnBiM3V03Hrxw4wRHjo3ubZdzgH6Ka0U5ubc367ddVRxM9dp tKv1SRGGrN4pnzqo43nvTtOI2MTxeFFFn4CeRylR/ILQPiQuqLjXYiXcOQSp3A== 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 4S0Ptg3L7Wz13s7; Tue, 3 Oct 2023 17:28:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 393HShIc085669; Tue, 3 Oct 2023 17:28:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 393HShbV085666; Tue, 3 Oct 2023 17:28:43 GMT (envelope-from git) Date: Tue, 3 Oct 2023 17:28:43 GMT Message-Id: <202310031728.393HShbV085666@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: d9243c1ab3cd - stable/14 - EC2: Add experimental cloud-init images 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: d9243c1ab3cd8e744aaf54177232cdbffa07392d Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=d9243c1ab3cd8e744aaf54177232cdbffa07392d commit d9243c1ab3cd8e744aaf54177232cdbffa07392d Author: Colin Percival AuthorDate: 2023-09-09 00:55:16 +0000 Commit: Colin Percival CommitDate: 2023-10-03 17:28:18 +0000 EC2: Add experimental cloud-init images Known issues: 1. The ec2-user user is created with a homedir of /usr/home/ec2-user instead of /home/ec2-user; this appears to be a bug in cloud-init's FreeBSD support. 2. Cloud-init configures IPv4 networking but not IPv6 networking. releng/14.0 candidate. Discussed with: gjb Reviewed by: imp MFC after: 5 days Relnotes: yes Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D41793 (cherry picked from commit 1f4ce7a39f0f4b0621ff55d228014ccddb366d37) --- release/Makefile.vm | 5 +++-- release/tools/ec2-cloud-init.conf | 31 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/release/Makefile.vm b/release/Makefile.vm index 8828b99599e7..09e31e3c0b6f 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -30,8 +30,9 @@ BASIC-CI_FSLIST= ufs BASIC-CI_DESC= Image for CI EC2_FORMAT= raw EC2_FSLIST= ufs zfs -EC2_DESC= Amazon EC2 image -EC2_FLAVOURS= BASE +EC2_FLAVOURS= BASE CLOUD-INIT +EC2-BASE_DESC= Amazon EC2 image +EC2-CLOUD-INIT_DESC= Amazon EC2 Cloud-Init image GCE_FORMAT= raw GCE_FSLIST= ufs GCE_DESC= Google Compute Engine image diff --git a/release/tools/ec2-cloud-init.conf b/release/tools/ec2-cloud-init.conf new file mode 100644 index 000000000000..2dd4df390fa3 --- /dev/null +++ b/release/tools/ec2-cloud-init.conf @@ -0,0 +1,31 @@ +#!/bin/sh + +. ${WORLDDIR}/release/tools/ec2.conf + +# Packages to install into the image we're creating. In addition to packages +# present on all EC2 AMIs, we install cloud-init. +export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} net/cloud-init" + +# Services to enable in rc.conf(5). +export VM_RC_LIST="${VM_RC_LIST} cloudinit sshd" + +vm_extra_pre_umount() { + # Configuration common to all EC2 AMIs + ec2_common + + # Configure cloud-init + cat <<-'EOF' > ${DESTDIR}/usr/local/etc/cloud/cloud.cfg.d/98_ec2.cfg + disable_root: true + system_info: + distro: freebsd + default_user: + name: ec2-user + lock_passwd: True + groups: [wheel] + shell: /bin/sh + # Currently broken, cloud-init hard-codes to /usr/home/* + homedir: /home/ec2-user + EOF + + return 0 +}