From owner-freebsd-arch@FreeBSD.ORG Thu Jan 15 05:45:05 2009 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44649106566B for ; Thu, 15 Jan 2009 05:45:05 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id AC0948FC17 for ; Thu, 15 Jan 2009 05:45:04 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from Macintosh-4.local ([10.0.0.194]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n0F5HB06025844 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 14 Jan 2009 21:17:11 -0800 (PST) (envelope-from sam@freebsd.org) Message-ID: <496EC6D7.4090003@freebsd.org> Date: Wed, 14 Jan 2009 21:17:11 -0800 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.19 (Macintosh/20081209) MIME-Version: 1.0 To: Brooks Davis References: <20090114211616.GC16116@server.vk2pj.dyndns.org> <20090115031847.GA52343@duncan.reilly.home> <20090115044309.GA72611@lor.one-eyed-alien.net> In-Reply-To: <20090115044309.GA72611@lor.one-eyed-alien.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-DCC-Misty-Metrics: ebb.errno.com; whitelist Cc: Andrew Hotlab , freebsd-arch@freebsd.org Subject: Re: Cross compiling FreeBSD X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 05:45:05 -0000 Brooks Davis wrote: > On Thu, Jan 15, 2009 at 02:18:47PM +1100, Andrew Reilly wrote: >> On Thu, Jan 15, 2009 at 08:16:17AM +1100, Peter Jeremy wrote: >>> This won't work because install{world,kernel} uses programs (under >>> /usr/obj) that were built to run on the build system (amd64 in >>> your case) and so won't run on the target (i386) system. >>> >>> The supported approach is to NFS mount the target machines onto the >>> build machine and run "make DESTDIR=/mount/point install{world,kernel}" >>> on the build machine. Note that this will report errors since NFS >>> cannot handle UFS flags - you will need to manually remove/add schg flags. >> Is there any reason (apart from using more space on the build >> machine) not to install to a DESTDIR (not /) on the build >> machine, and then tar/pax/cpio that tree across to the client >> system? Presumably something like that must be done for the >> distribution builds that go into making the CD and DVD images. > > This should work just fine. I use installs to DESTDIR to build images to be > run at NFS root file systems. +1 > >> NetBSD has (had? it's been a while since I looked) a cool >> mechanism that allowed the whole tree to be built (and >> "installed" to a DESTDIR) without root permissions, using a >> variation on install that copied the file as the running user >> and recorded the intended user/group/mod/flags in an mtree file. >> Then a subsequent task created a tarball that contained the file >> contents and the mtree permissions, all as a non-root user. So >> you don't even need to muck about with root-over-nfs issues for >> deployment: just log into the client and untar the distribution >> over the network (as root). Very, very neat, IMO. I used to >> build embedded i386 NetBSD installations on my amd64 FreeBSD >> system that way without much in the way of trouble. Haven't had >> to do it for a while, though, so perhaps it's all changed. I >> wouldn't hate to discover that FreeBSD can do that too, >> though... > > We don't have this yet, but lots of people would like to see this (just > not quite enough to do it yet :). I've used netbsd and didn't find the unprivileged build process as useful as I expected but I'm certainly a fan of eliminating root use. I recently added makefs to the base system which simplifies setting up a cross-devel environment but we still lack bi-endian native filesystem support. Otherwise the key issues in improving cross-build support are: ports and requiring freebsd as the build host. With the advent of virtual machines however the build host issue is less critical. Sam