From owner-freebsd-cloud@freebsd.org Mon Jan 1 17:43:18 2018 Return-Path: Delivered-To: freebsd-cloud@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FF5AEB4893 for ; Mon, 1 Jan 2018 17:43:18 +0000 (UTC) (envelope-from raf@rafal.net) Received: from fbo-2.mxes.net (mxout-22.mxes.net [216.86.168.222]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76A98756DE for ; Mon, 1 Jan 2018 17:43:17 +0000 (UTC) (envelope-from raf@rafal.net) Received: from smtp-out-1.mxes.net (smtp-out-1.mxes.net [67.222.241.250]) by fbi-2.mxes.net (Postfix) with ESMTP id BA3E02753E for ; Mon, 1 Jan 2018 12:43:09 -0500 (EST) Received: from [192.168.40.41] (86-40-118-125-dynamic.agg2.bri.bbh-prp.eircom.net [86.40.118.125]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id 5295527553; Mon, 1 Jan 2018 12:42:46 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: AMI building AMI From: Rafal Lukawiecki In-Reply-To: <01000160a0283ad5-12b330d3-3f4b-43ea-9cdc-2524f5f42f4a-000000@email.amazonses.com> Date: Mon, 1 Jan 2018 17:42:44 +0000 Cc: freebsd-cloud@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <0C1308D4-AFD6-4216-83A6-4687157EC8D3@rafal.net> References: <085D225B-2E99-4540-B693-223087B14A27@rafal.net> <0100016099578ea7-02da1d5c-997d-47be-9cd8-dc6b75bbeda6-000000@email.amazonses.com> <8BCB67B8-DE56-491A-8E6A-95AFB83F71D6@rafal.net> <0100016099671dff-32d986bf-3979-40a3-accf-4d17c2020403-000000@email.amazonses.com> <8538BFB9-B82C-4520-ADB3-E25040EA1B30@rafal.net> <01000160a0283ad5-12b330d3-3f4b-43ea-9cdc-2524f5f42f4a-000000@email.amazonses.com> To: Colin Percival X-Mailer: Apple Mail (2.3445.5.20) X-BeenThere: freebsd-cloud@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "FreeBSD on cloud platforms \(EC2, GCE, Azure, etc.\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jan 2018 17:43:18 -0000 PS. Could it be as easy as make DESTDIR=3D/mnt installkernel in the = config init? > On 29 Dec 2017, at 02:44, Colin Percival wrote: >=20 > us-east-1 ami-e6a6ea9c is a FreeBSD 11.1-RELEASE AMI-building AMI. Many thanks, Colin. And a Happy New Year! May I ask you if what I am hoping to do makes sense? Taking the gist = from = http://www.daemonology.net/blog/2015-11-21-FreeBSD-AMI-builder-AMI.html = I plan to make an AMI, install packages, patch and install the kernel, = all in one go. I am unsure how to =E2=80=9Cmake kernel=E2=80=9D so that = it ends up in the new AMI, rather than just in the builder AMI. Firs, I create an IAM role with a policy which grants access to the EC2 = CreateImage API. Then I launch your AMI building AMI ami-e6a6ea9c in = us-east-1 using config init script as follows, on a sufficiently large = c5: #!/bin/sh export ASSUME_ALWAYS_YES=3DYES PKGS_TO_INSTALL=3Dlots of packages go here pkg -r /mnt fetch -d $PKGS_TO_INSTALL pkg -c /mnt install $PKGS_TO_INSTALL svnlite co https://svn.freebsd.org/base/releng/11.1/ /usr/src/ cd /usr/src cat > /tmp/kernel.patch <