Cross compiling FreeBSD

Andrew Reilly andrew-freebsd at areilly.bpc-users.org
Wed Jan 14 20:05:25 PST 2009


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.

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...

Cheers,

Andrew


More information about the freebsd-amd64 mailing list