Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 07 Apr 2010 19:22:03 -0700
From:      Tim Kientzle <kientzle@freebsd.org>
To:        Garrett Cooper <yanefbsd@gmail.com>
Cc:        arch@freebsd.org, portmgr@freebsd.org
Subject:   Re: [RFC] Remove pkg_add -C (chroot functionality)
Message-ID:  <4BBD3DCB.4030902@freebsd.org>
In-Reply-To: <t2m7d6fde3d1004070216m94cfea44s86e70cf8ac9895d5@mail.gmail.com>
References:  <t2m7d6fde3d1004070216m94cfea44s86e70cf8ac9895d5@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Garrett Cooper wrote:
>     There's an outstanding bug to fix chroot(2)'ing functionality with
> pkg_add(1) [1]. Anyone that has tried this functionality knows that
> it's currently crippled

If it's currently broken, it's better to
simply remove it.

I'm not sure I understand why anyone wants
pkg_add to call chroot(2) at the top, though.
As you pointed out, "chroot pkg_add" exists
already.

The feature we need should:
  * update $ROOTDIR/var/db/pkg
  * Add $ROOTDIR as a prefix to all installed file locations
This would allow pkg_add when running outside of
a chroot to install packages into a chrooted
system, which is what you can't easily do with
"chroot pkg_add".

Of course, this isn't particularly easy to do when
forking tar(1), so the libarchive integration
might be a necessary prerequisite.  (Command-line
tar doesn't support re-rooting absolute paths.
There is a --chroot option to tar, but it's
currently broken in some rather complex ways.
As I'm composing this message, I'm starting to
wonder if it also should not use chroot(2).
Hmmm....)

The hard part is @exec/@unexec.  On the one
hand, you don't necessarily want to require
the install dependencies of a package to be
installed in the chroot, which argues against
running those under chroot(2).  On the other hand,
a lot of the commands used within @exec/@unexec
manipulate common system databases (e.g., ldconfig),
which argues that those commands should be run
under chroot(2).

Cheers,

Tim




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4BBD3DCB.4030902>