Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Jun 2020 09:22:17 +0200
From:      Ede Wolf <listac@nebelschwaden.de>
To:        freebsd-questions@freebsd.org
Subject:   Re: Moving sources (base/ports) from /usr
Message-ID:  <b437bb57-fa0f-e68b-891c-ed2cc04180fe@nebelschwaden.de>
In-Reply-To: <690ef022-1afe-645a-aec9-30f9d84561f6@nebelschwaden.de>
References:  <8d48921e-7af1-9313-0781-4ba4bd9c1f10@nebelschwaden.de> <ee6f9d59-9ac3-5d1e-baec-405fc1b24ab2@nebelschwaden.de> <20200520110833.f47610a48f0f28dd563c13aa@sohara.org> <2c3bd26c-aaa3-9998-e5e5-e3f4f3796ffc@nebelschwaden.de> <0b98639e-e714-412c-950e-7d20be5d1147@hedeland.org> <c7cd6f22-6d6f-9b3a-919e-24972a0f26c1@nebelschwaden.de> <20200520144555.2e935417.freebsd@edvax.de> <690ef022-1afe-645a-aec9-30f9d84561f6@nebelschwaden.de>

next in thread | previous in thread | raw e-mail | index | archive | help
With a little delay, here is just the conclusion. Moving ports or src to 
another location is actually way more simple than it seemed at first 
impression. Seems like well structured OS.
So, to the best of my knowledge:

For ports, simple move to the desired location and specify in 
/etc/make.conf:

PORTSDIR=/clutter/ports
WRKDIRPREFIX=/clutter/work
DISTDIR=/clutter/binpkg

SRCCONF=/etc/src.conf
SRC_ENV_CONF=/etc/src-env.conf

That's it, you are set. Works without any modification for portmaster as 
well.
I do not know about other tools that have an own configuration files, 
like portsnap, as I have not have them used yet.

WRKDIRPREFIX is where stuff is build, but it also keeps your config 
settings?
DISTDIR is where the downloaded source is kept.

Moving /usr/src is even more effortless, just set following variable in 
/etc/src-env.conf (or whatever you have defined this file to be in 
make.conf):


MAKEOBJDIRPREFIX?=/clutter/obj


That's it. There is one more environmant variable, that can optionally 
be exported in the shell of your choice, that is SOURCEDIR

setenv SOURCEDIR /clutter/src
OR
export SOURCEDIR=/clutter/src

Or your respective configuration file.

This is only used by mergemaster, and if not set, mergemaster will ask 
during invocation.
Just be aware, if not net and you have not deleted the contents below 
/usr/src, mergemaster may use /usr/src if a certain makefile is present 
and this may lead to unexpected results.

Remaining open questions:
- Is it possible for makeworld/kernek to move the workdir out of 
/usr/obj? So temporary stuff may go to /tmp

- Is there a way to prevent installworld from creating /usr/src if it 
not present?

- Why are portvariables defined in make.conf, not in src-env.conf?

But those are minuscule.

Thanks everybode for your time, help and explanations.

Ede



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?b437bb57-fa0f-e68b-891c-ed2cc04180fe>