From owner-freebsd-arch@freebsd.org Wed Dec 4 16:33:12 2019 Return-Path: Delivered-To: freebsd-arch@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 2E6061CDEF0; Wed, 4 Dec 2019 16:33:12 +0000 (UTC) (envelope-from paul@gromit.dlib.vt.edu) Received: from gromit.dlib.vt.edu (gromit.dlib.vt.edu [128.173.49.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "gromit.dlib.vt.edu", Issuer "Chumby Certificate Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 47SktJ0Pvnz42rb; Wed, 4 Dec 2019 16:33:11 +0000 (UTC) (envelope-from paul@gromit.dlib.vt.edu) Received: from pmather-dld-1.lib.vt.edu (pmather-dld-1.lib.vt.edu [128.173.51.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gromit.dlib.vt.edu (Postfix) with ESMTPSA id C3B392E8; Wed, 4 Dec 2019 11:33:09 -0500 (EST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: arm64 as Tier 1 for FreeBSD 13 From: Paul Mather In-Reply-To: Cc: Robert Clausecker , freebsd-arm , freebsd-arch Content-Transfer-Encoding: quoted-printable Message-Id: <8ED17B73-97C0-4843-900D-0EC13C87651C@gromit.dlib.vt.edu> References: <17938.1575444597@critter.freebsd.dk> <20191204092402.GA82492@fuz.su> To: Ed Maste X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 47SktJ0Pvnz42rb X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; REPLY(-4.00)[] X-Mailman-Approved-At: Wed, 29 Jan 2020 20:49:31 +0000 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Wed, 04 Dec 2019 16:33:12 -0000 X-Original-Date: Wed, 4 Dec 2019 11:33:09 -0500 X-List-Received-Date: Wed, 04 Dec 2019 16:33:12 -0000 On Dec 4, 2019, at 6:30 AM, Ed Maste wrote: > On Wed, 4 Dec 2019 at 09:49, Paul Mather = wrote: >>=20 >> I'm running FreeBSD/arm64 12-STABLE on a Raspberry Pi 3 using a = root-on-ZFS setup. I've been using packaged base for quite some time, = cross-building on FreeBSD/amd64. Every time I upgrade FreeBSD via "pkg = upgrade" it seems to me that it does not take an inordinately long time. = It takes longer than packaged base on a regular FreeBSD/amd64 server = with spinning disk, but not an excessive amount of time. It's certainly = on the order of minutes, not hours. >=20 > Indeed, migrating to pkg base is the presumed solution for the > "freebsd-update would be too slow on SD card root" issue. >=20 > Perhaps you wouldn't mind writing up the steps you're using to > cross-build and install updates? I am using already existing documentation from the FreeBSD project. = (Many thanks to the original authors!) 1. Building and serving pkg packages For a long time I have built packages for my FreeBSD systems using = Poudriere and serve them over the network via the Poudriere build = machine. See: - https://www.freebsd.org/doc/handbook/ports-poudriere.html I use Nginx (via www/nginx) to serve the pkg repos (based on the = /usr/local/share/examples/poudriere/nginx.conf.sample file in the = ports-mgmt/poudriere installed port). Note, you don't really need Poudriere in all this, but I find it useful = for also cross-building my FreeBSD/arm64 ports. Because I was using = Poudriere long before PkgBase, I included it here as something folks = might also want to use. 2. Cross-building for FreeBSD/arm64 To cross-build, I use the "mk" script provided at the arm/crossbuild = section of the FreeBSD Wiki. See: - https://wiki.freebsd.org/arm/crossbuild In the case of my FreeBSD/arm64 systems, my "config/mk.conf" and = "config/make.conf" consist solely of the following: =3D=3D=3D=3D=3D config/mk.conf =3D=3D=3D=3D=3D mk_arch=3D"aarch64" mk_kernel=3D"GENERIC" =3D=3D=3D=3D=3D config/mk.conf =3D=3D=3D=3D=3D =3D=3D=3D=3D=3D config/make.conf =3D=3D=3D=3D=3D REPODIR=3D/build/repo =3D=3D=3D=3D=3D config/make.conf =3D=3D=3D=3D=3D I have a simple script, "rebuild_os_pkgs" that cross-builds everything = and makes the base packages that end up under /build/repo: =3D=3D=3D=3D=3D rebuild_os_pkgs =3D=3D=3D=3D=3D #!/bin/sh mk buildworld mk buildkernel mk packages =3D=3D=3D=3D=3D rebuild_os_pkgs =3D=3D=3D=3D=3D (My "mk" script is in /usr/local/bin.) To build an updated OS I run that script after first having updated the = OS source in the "src" subdirectory (e.g., via "make update"). (You can = symlink "src" to "/usr/src" if you want to save space.) The "mk = packages" step results in a pkg-compliant repository with all the = PkgBase packages in it. 3. FreeBSD/arm64 PkgBase I followed the PkgBase documentation at the FreeBSD Wiki to set up my = Raspberry Pi 3 to use the OS packages build on the FreeBSD/amd64 build = machine using the "rebuild_os_pkgs" script. See: - https://wiki.freebsd.org/PkgBase I have this snippet on the OS package build machine to serve out the pkg = repository created as part of the rebuild_os_pkgs run: =3D=3D=3D=3D=3D location /FreeBSD-base { alias /build/repo; autoindex on; allow all; } =3D=3D=3D=3D=3D If you are used to building and serving pkg packages (e.g., ports = packages) then the real workhorse in all this is the "mk" cross-building = script + FreeBSD build system that is cross-building capable. I encourage folks to check out the FreeBSD documentation on = cross-building for ARM and PkgBase that I mention above. They have a = lot of useful information. Cheers, Paul.=