Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Oct 2012 18:18:50 +1030
From:      Shane Ambler <FreeBSD@ShaneWare.Biz>
To:        dweimer@dweimer.net
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: ZFS / Boot Environments / Jails / Upgrading form Source Code
Message-ID:  <508105E2.5060208@ShaneWare.Biz>
In-Reply-To: <b878d51c3123f86ec6e02349a6ecac7a@dweimer.net>
References:  <b878d51c3123f86ec6e02349a6ecac7a@dweimer.net>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On 19/10/2012 07:44, dweimer wrote:

> First step replace the usr/src within the jail with new source using
>  svn, easy enough.  Then start make buildworld... oops, I have a
> problem now, the usr/obj/usr stuff is now under
> /usr/obj/usr/jails/release91rc2..., However I want it to be under
> /usr/jails/release91rc2/usr/obj/usr.

If the jails base dir is /usr/obj/usr/jails/release91rc2 then it can
only access files below that base dir. That is part of the jails security.

If your jail is based at /usr/obj/usr/jails/release91rc2 then the jail
by default will buildworld into /usr/obj of the jail system which
translates to /usr/obj/usr/jails/release91rc2/usr/obj on the base system.

You can adjust the settings within the jail but it will always be
within the release91rc2 dir so you can't use the jail to install into
/usr/jails of the base system.

> From looking at the usr/src/Makefile  It looks like I need to set the
>  MAKEOBJDIRPREFIX=/usr/jails/relase91rc2/usr/obj/usr/src/tmp
> environment variable, but is that the best solution here? There's
> also a /usr/obj/lib32 directory (system is running amd64, I assume
> this is for 32 bit libraries), so I would likely need to do something
> here as well, that I haven't gotten to yet.

lib32 is part of the final system - you don't need to handle it
separately. See man src.conf if you want to turn off the creation of
32bit libs.

You can set MAKEOBJDIRPREFIX (default /usr/obj ) to define where the
binary files are made.
You can also set DESTDIR (default is / ) for the installworld step to
define where they get installed.

When you start a buildworld or buildkernel the compiled binaries are
stored within MAKEOBJDIRPREFIX. When that is complete the installworld
or installkernel steps install the files from MAKEOBJDIRPREFIX into
DESTDIR to create a workable system. That prevents a failed build from
destroying part of your running system.

If you want to experiment with different versions then you can also try-

mkdir /usr/jails
cd /usr/jails
svn co http://svn0.us-west.FreeBSD.org/base/releng/9.0 9.0-src
cd 9.0-src
set MAKEOBJDIRPREFIX = /usr/jails/9.0-obj
set DESTDIR = /usr/jails/9.0-base
make buildworld && make installworld

cd /usr/jails
svn co http://svn0.us-east.FreeBSD.org/base/releng/9.1 9.1-src
cd 9.1-src
set MAKEOBJDIRPREFIX = /usr/jails/9.1-obj
set DESTDIR = /usr/jails/9.1-base
make buildworld && make installworld

> I know the /usr/obj/usr directory can be deleted after the
> installation of the source, does the same go for the /usr/obj/lib32
> directory?  if so

Anything in MAKEOBJDIRPREFIX (/usr/obj) can be deleted after you have
installed it, including lib32 which are libs to allow running 32bit
programs on a 64bit system.





Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?508105E2.5060208>