From owner-freebsd-cloud@freebsd.org Tue Jan 2 03:05:43 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 7E3F0EAC98E for ; Tue, 2 Jan 2018 03:05:43 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CD226AC82 for ; Tue, 2 Jan 2018 03:05:42 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (203-206-51-137.dyn.iinet.net.au [203.206.51.137] (may be forged)) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id w0235abQ027498 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 1 Jan 2018 19:05:39 -0800 (PST) (envelope-from julian@freebsd.org) Subject: Re: AMI building AMI To: Rafal Lukawiecki , Colin Percival Cc: freebsd-cloud@freebsd.org 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> From: Julian Elischer Message-ID: <004116c5-0938-5570-f119-fdc21e91b2ad@freebsd.org> Date: Tue, 2 Jan 2018 11:05:30 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US 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: Tue, 02 Jan 2018 03:05:43 -0000 On 2/1/18 12:16 am, Rafal Lukawiecki wrote: >> On 29 Dec 2017, at 02:44, Colin Percival wrote: >> >> 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 “make kernel” 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=YES > PKGS_TO_INSTALL=lots of packages go here > pkg -r /mnt fetch -d $PKGS_TO_INSTALL > pkg -c /mnt install $PKGS_TO_INSTALL please explain to me the  use of -r AND -c? if you use -r to populate a chroot for -c then should that be pkg add rater than pkg install? > svnlite co https://svn.freebsd.org/base/releng/11.1/ /usr/src/ > cd /usr/src > cat > /tmp/kernel.patch < Patch goes here > EOT > patch < /tmp/kernel.patch > make kernel -j16 > *** How to copy the new kernel into the AMI’s kernel on /mnt without messing anything up *** > mkami "FreeBSD 11.1 for PB” “PB Customised FreeBSD" > shutdown -p now > > Afterwards I copy my new AMI to eu-west-1. > > Does this make sense? Is there documentation to mkami? I could not find it. I am curious if I could parametrise it to create an encrypted volume snapshot of a given target size. > > Many, many thanks and my regards from Ireland, > Rafal > _______________________________________________ > freebsd-cloud@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-cloud > To unsubscribe, send any mail to "freebsd-cloud-unsubscribe@freebsd.org" > >