From owner-freebsd-arch@FreeBSD.ORG Thu Apr 8 02:36:12 2010 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F33A51065674; Thu, 8 Apr 2010 02:36:11 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from monday.kientzle.com (kientzle.com [66.166.149.50]) by mx1.freebsd.org (Postfix) with ESMTP id A72518FC16; Thu, 8 Apr 2010 02:36:11 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.3/8.14.3) id o382MHYo072983; Thu, 8 Apr 2010 02:22:17 GMT (envelope-from kientzle@freebsd.org) Received: from horton.x.kientzle.com (fw2.kientzle.com [10.123.1.2]) by kientzle.com with SMTP id 8rackpa725pptxeb3j83xyc6xi; Thu, 08 Apr 2010 02:22:17 +0000 (UTC) (envelope-from kientzle@freebsd.org) Message-ID: <4BBD3DCB.4030902@freebsd.org> Date: Wed, 07 Apr 2010 19:22:03 -0700 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.23) Gecko/20100314 SeaMonkey/1.1.18 MIME-Version: 1.0 To: Garrett Cooper References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: arch@freebsd.org, portmgr@freebsd.org Subject: Re: [RFC] Remove pkg_add -C (chroot functionality) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Apr 2010 02:36:12 -0000 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