Building world/kernel in RAM

Hi. In my /etc/make.conf I have:
Code:
WRKDIRPREFIX=/ram
so that all my ports get built in a tmpfs RAM filesystem, but when I # make buildworld or # make buildkernel that option is not respected, and everything still goes in /usr/obj. Is there a way to make rebuilding world and kernel also put all the work files there?
 
Greetings.

The WRKDIRPREFIX variable targets only the port, not kernel and world builds. Also is /etc/make.conf not the right place for the objects directory environment variable. From build(7)():

MAKEOBJDIRPREFIX

Defines the prefix for directory names in the tree of
built objects. Defaults to /usr/obj if not defined.
This variable should only be set in the environment and
not via /etc/make.conf or the command line.
 
Thanks for your reply! Is there a reason it can't be set in /etc/make.conf? Seems only natural to put it there instead of specifying it every single time I rebuild.

Though I guess I can just put it in /etc/profile.
 
Use a tmpfs(5) device for /usr/obj:

/etc/fstab
Code:
tmpfs                   /usr/obj        tmpfs   rw,mode=01777   0       0

This works. My tests have shown it really makes little difference to speed of buildworld.
 
baot said:
Is there a reason it can't be set in /etc/make.conf?
I'm not sure. Also I've noticed, that many users set MAKEOBJDIRPREFIX from command line, contrary to the demanding statement in build(7) and /usr/share/examples/etc/make.conf. If you want to look into it deeper, you could contact the author of the build(7) man page, ask here or at the mailing list.

Though I guess I can just put it in /etc/profile.
/root/.cshrc would be a better choise. It's more appropiate, since you are root when building kernel/world. In /etc/profile normally you put things for system-wide use, where all users benefit from it, but in this case, because of write permissions, it's useless for others then root.
 
Back
Top