From owner-freebsd-cloud@freebsd.org Sun Jan 3 18:49:07 2021 Return-Path: Delivered-To: freebsd-cloud@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 28CBD4DA0CB for ; Sun, 3 Jan 2021 18:49:07 +0000 (UTC) (envelope-from raf+GG=480eb49c@rafal.net) Received: from smtp-out-4.mxes.net (smtp-out-4.mxes.net [198.205.123.69]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4D878K6lCZz3nth for ; Sun, 3 Jan 2021 18:49:05 +0000 (UTC) (envelope-from raf+GG=480eb49c@rafal.net) Received: from Customer-MUA (mua.mxes.net [10.0.0.1]) (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 32E7575996; Sun, 3 Jan 2021 13:49:02 -0500 (EST) From: Rafal Lukawiecki Message-Id: <58E304B3-F75C-4470-996F-3EF28438033E@rafal.net> Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: FreeBSD on AWS Graviton (t4g) Date: Sun, 3 Jan 2021 18:49:01 +0000 In-Reply-To: <21F56FA2-8DBA-4D6F-B08F-848F56233B45@rafal.net> Cc: freebsd-cloud@freebsd.org To: Colin Percival References: <7AA5AFAB-E42A-4A59-BCA5-9B15BD58B81B@rafal.net> <01000176bfa4236e-f12b57d0-7000-4a31-acb2-5660d60eb714-000000@email.amazonses.com> <4E347E37-113D-4AFC-BD7E-AC83FF27C2E0@rafal.net> <01000176bfc11df8-fbb42271-1837-409b-9ce5-13577e938d1c-000000@email.amazonses.com> <21F56FA2-8DBA-4D6F-B08F-848F56233B45@rafal.net> X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Sent-To: X-Rspamd-Queue-Id: 4D878K6lCZz3nth X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.60 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:198.205.123.0/25]; URI_COUNT_ODD(1.00)[3]; DKIM_TRACE(0.00)[mxes.net:+,rafal.net:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[rafal.net,reject]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCVD_IN_DNSWL_LOW(-0.10)[198.205.123.69:from]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:19844, ipnet:198.205.122.0/23, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[198.205.123.69:from]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[mxes.net:s=mta,rafal.net:s=tm]; TAGGED_FROM(0.00)[GG=480eb49c]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; SPAMHAUS_ZRD(0.00)[198.205.123.69:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-cloud] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: freebsd-cloud@freebsd.org X-Mailman-Version: 2.1.34 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: Sun, 03 Jan 2021 18:49:07 -0000 Once again, thanks for your help, Colin. The suggested steps worked and = I have managed to build an updated ARM AMI with all the extra packages. = I am testing it now and seems quite good. Shutdown behaviour does not = bother me. Indeed, there was not enough space for make in /usr/obj (and not enough = for pkg either) so I had to add a couple of memory disks. FYI, the below = user data script works well. I run it on a spot instance of a = c6g.8xlarge and it was done in just under 30 mins. I wonder if I am replicating what your AMI maker does anyway by building = things using make, or is this still the right way to go around. I=E2=80=99ve one more question: where can find out the currently = *available* level of the patches, ie. the =E2=80=9C-p2=E2=80=9D in = "12.2-RELEASE-p2=E2=80=9D? There is nowhere I could see on freebsd.org = that publishes that, and I assume it has to be = somewhere in the svn trees but I cannot find it. I would like a way of = being able to check if I am current. My user data script, perhaps I should post it somewhere=E2=80=A6: #!/bin/sh PKGS_TO_INSTALL=3D=E2=80=9CLots of package names go here :)" export ASSUME_ALWAYS_YES=3DYES export PATH=3D"$PATH:/usr/local/bin" mount -t devfs devfs /mnt/dev mdconfig -a -t swap -s 8G -u 2 newfs -U md2 mount /dev/md2 /usr/src mdconfig -a -t swap -s 20G -u 3 newfs -U md3 mount /dev/md3 /bits/usr/obj svnlite co https://svn.freebsd.org/base/releng/12.2/ /usr/src/ make -j 32 -C /usr/src DESTDIR=3D/mnt buildworld buildkernel = installkernel installworld yes | /usr/bin/env PATH=3D"$PATH:/usr/local/bin" pkg -r /mnt fetch -d = $PKGS_TO_INSTALL pkg -r /mnt update -f cp /etc/resolv.conf /mnt/etc/resolv.conf yes | /usr/bin/env PATH=3D"$PATH:/usr/local/bin" pkg -c /mnt -o = ASSUME_ALWAYS_YES=3DYES install $PKGS_TO_INSTALL rm /mnt/etc/resolv.conf # You may need to check if there was already = another resolv.conf and perhaps restore it (11.1: yes, 12.x: none) sleep 10 sync; sync; sync; umount /bits/usr/obj umount /mnt/src umount -f /mnt/dev sync; sync; sync; sleep 10 sync; sync; sync; sleep 10 umount -f /mnt sleep 10 mkami "FreeBSD 12.2 PB 3.16" "Project Botticelli Ltd Customised FreeBSD = 12.2" shutdown -p now The two memory disks are bit oversized. The pkg cache only needs 4 GB = (not 8) and /usr/obj needs just under 10 (not 20) but it saves me from = surprises, I hope, as I continue using it over the next few months. Thanks a lot and regards from Ireland, Rafal -- Rafal Lukawiecki Data Scientist=20 Project Botticelli Ltd From owner-freebsd-cloud@freebsd.org Sun Jan 3 20:42:44 2021 Return-Path: Delivered-To: freebsd-cloud@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 776644DEB1F for ; Sun, 3 Jan 2021 20:42:44 +0000 (UTC) (envelope-from 01000176c9fce377-7cb81a34-1d18-4c1f-8505-7c088db39809-000000@amazonses.com) Received: from a8-176.smtp-out.amazonses.com (a8-176.smtp-out.amazonses.com [54.240.8.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D89gR469Pz4kcJ for ; Sun, 3 Jan 2021 20:42:43 +0000 (UTC) (envelope-from 01000176c9fce377-7cb81a34-1d18-4c1f-8505-7c088db39809-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn; d=tarsnap.com; t=1609706562; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=CTbZoj9MkLT9TjxMVNSPnoSQ0itlep4WfbSxZBzy++I=; b=XMirBV71JN8E4qSEF/ofolh7NtDJxUDiSGbwfojvUxNzLCjMwIpdw082I4O2Dye2 cCcXMNivjLA5CTf+M6Y8lP8KdbR1hVWGJ5xKZxDbFQJgd/vyvbsliG3vy+jtkh8rBcg 2TYV10pdcKrXkksquAvp8Ns2D3uFMX9vwHiih6oQ= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=224i4yxa5dv7c2xz3womw6peuasteono; d=amazonses.com; t=1609706562; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=CTbZoj9MkLT9TjxMVNSPnoSQ0itlep4WfbSxZBzy++I=; b=hg62NRoVCTMmziuJ9C8ftwyI1vS4c8rNw6acjJ5S0LnGeG1ISJaUgm/EsG2Poosr H5HcVTwOmFIKBZ+QguuLxA5StisiZ7fuGJZzATdLw0gkAXmRXaxhpa+yCLCIRvSdYDl X8djdOowP9ziDkc70RdBiQQ8FMLsIOsAJ/1eu4XA= Subject: Re: FreeBSD on AWS Graviton (t4g) To: Rafal Lukawiecki Cc: freebsd-cloud@freebsd.org References: <7AA5AFAB-E42A-4A59-BCA5-9B15BD58B81B@rafal.net> <01000176bfa4236e-f12b57d0-7000-4a31-acb2-5660d60eb714-000000@email.amazonses.com> <4E347E37-113D-4AFC-BD7E-AC83FF27C2E0@rafal.net> <01000176bfc11df8-fbb42271-1837-409b-9ce5-13577e938d1c-000000@email.amazonses.com> <21F56FA2-8DBA-4D6F-B08F-848F56233B45@rafal.net> <58E304B3-F75C-4470-996F-3EF28438033E@rafal.net> From: Colin Percival Message-ID: <01000176c9fce377-7cb81a34-1d18-4c1f-8505-7c088db39809-000000@email.amazonses.com> Date: Sun, 3 Jan 2021 20:42:42 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <58E304B3-F75C-4470-996F-3EF28438033E@rafal.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-SES-Outgoing: 2021.01.03-54.240.8.176 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-Rspamd-Queue-Id: 4D89gR469Pz4kcJ X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=tarsnap.com header.s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn header.b=XMirBV71; dkim=pass header.d=amazonses.com header.s=224i4yxa5dv7c2xz3womw6peuasteono header.b=hg62NRoV; dmarc=pass (policy=none) header.from=tarsnap.com; spf=pass (mx1.freebsd.org: domain of 01000176c9fce377-7cb81a34-1d18-4c1f-8505-7c088db39809-000000@amazonses.com designates 54.240.8.176 as permitted sender) smtp.mailfrom=01000176c9fce377-7cb81a34-1d18-4c1f-8505-7c088db39809-000000@amazonses.com X-Spamd-Result: default: False [-0.91 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[tarsnap.com:s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn,amazonses.com:s=224i4yxa5dv7c2xz3womw6peuasteono]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:54.240.0.0/18]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; SPAMHAUS_ZRD(0.00)[54.240.8.176:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[tarsnap.com:+,amazonses.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[54.240.8.176:from]; NEURAL_HAM_SHORT(-0.71)[-0.714]; DMARC_POLICY_ALLOW(-0.50)[tarsnap.com,none]; FORGED_SENDER(0.30)[cperciva@tarsnap.com,01000176c9fce377-7cb81a34-1d18-4c1f-8505-7c088db39809-000000@amazonses.com]; RCVD_COUNT_ZERO(0.00)[0]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[54.240.8.176:from]; ASN(0.00)[asn:14618, ipnet:54.240.8.0/21, country:US]; FORGED_MUA_THUNDERBIRD_MSGID_UNKNOWN(2.50)[]; FROM_NEQ_ENVFROM(0.00)[cperciva@tarsnap.com,01000176c9fce377-7cb81a34-1d18-4c1f-8505-7c088db39809-000000@amazonses.com]; MAILMAN_DEST(0.00)[freebsd-cloud] X-BeenThere: freebsd-cloud@freebsd.org X-Mailman-Version: 2.1.34 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: Sun, 03 Jan 2021 20:42:44 -0000 On 1/3/21 10:49 AM, Rafal Lukawiecki wrote: > I wonder if I am replicating what your AMI maker does anyway by building > things using make, or is this still the right way to go around. This is the right approach. The AMI Builder extracts a disk image of the release -- it doesn't do any building itself. > I’ve one more question: where can find out the currently *available* level of > the patches, ie. the “-p2” in "12.2-RELEASE-p2”? There is nowhere I could see > on freebsd.org  that publishes that, and I assume it has > to be somewhere in the svn trees but I cannot find it. I would like a way of > being able to check if I am current. src/sys/conf/newvers.sh has the value you're looking for. > My user data script, perhaps I should post it somewhere…: > [...] > sleep 10 > sync; sync; sync; > umount /bits/usr/obj > umount /mnt/src > umount -f /mnt/dev > sync; sync; sync; > sleep 10 > sync; sync; sync; > sleep 10 > umount -f /mnt > sleep 10 > mkami "FreeBSD 12.2 PB 3.16" "Project Botticelli Ltd Customised FreeBSD 12.2" All of the sync and sleep is unnecessary here; for that matter, the `umount /mnt` is also unnecessary. The mkami script takes care of that. (But you do still need to unmount anything you mounted *under* /mnt/.) -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid