Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My goal is to cross-compile binaries from an amd64 FreeBSD host to an armv6 RaspberryPi FreeBSD target.

The problem I am running into is I am required to be root in order to make install, where my command would be make PREFIX=/home/arm/install_dir NO_PKG_REGISTER=1 install. Even better would be to use make package for easier transfer to the target.

The issue is, while I am the sole administrator of the system and do have root capabilities, I would like to ensure I do not compromise the host system with an erroneous make install (such as one where I omit PREFIX= or NO_PKG_REGISTER=1).

As a precautionary measure, I do all the building as a separate user arm to help prevent me from unwittingly installing arm binaries on my host. In addition, this user has its own copy of the FreeBSD source and ports tree located separate from /usr/src and /usr/ports.

Is there a way for make to create a package without having root access?

Or can I have confidence that PREFIX and NO_PKG_REGISTER or make package will prevent my host from being polluted with inappropriate binaries?

EDIT: According to http://forums.freebsd.org/showpost.php?p=1518&postcount=7, the PREFIX approach is no good...hrm. Did I mean DESTDIR instead?

share|improve this question
That depends in part of the package's Makefile writer setting stuff up for installing at a place which isn't the final one. Perhaps creating a chroot for cross-builds with all the required pieces hard linked/mounted in? – vonbrand Feb 7 '13 at 17:45
Chroot or jail? I'm relatively new to FreeBSD, so both of them will be a new endeavor, but I'd love to start with the most appropriate one – hexparrot Feb 7 '13 at 18:02
up vote 0 down vote accepted

Crosscompile of ports is not a supported configuration. Same goes with building packages as unprivileged user.

It may work, but sometimes it does not.

I think setting up a chroot is a good idea, as it prevents you from accidently installing ARM binaries on your host system. a jail would also work, but is not necessary.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.