From owner-freebsd-arch@FreeBSD.ORG Thu Apr 8 03:49:26 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 8F2C71065670; Thu, 8 Apr 2010 03:49:26 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.221.181]) by mx1.freebsd.org (Postfix) with ESMTP id 1F47A8FC0A; Thu, 8 Apr 2010 03:49:25 +0000 (UTC) Received: by qyk11 with SMTP id 11so1111442qyk.13 for ; Wed, 07 Apr 2010 20:49:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=9YpFvk2Wm07U/BVzIlyCkV1XSuUBz7YGADb6v6PIeYA=; b=pH/+wBF6bIeex7eEf5+cIY6RsjzVlArNSymdonron28spo7/GM4mkugOZs6cvqecRM bGC3dIrMUACwch7IyDHiyEAbk5zLe16Vv+cpPKonZX5UZ9p6sJkx/mGt2Q6Eqdmk+zIh JJkBFm6bcw1yF1XRX0YAkY5ipsW/CS2WitUj8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=AO1r7036Hz2zVtGszIZ/y4ZcRtBqYw18mlSBJLyUynOlHTqelQlzFmSQ/q4x5XeSdb m8+/lpPMdkzLcyEKQyLOESjopWivxTjIzfMuJiNZfS18nFd1YC4vd+Xh9Z8SaB13azJb g6CBRy3pSkqQBGL+Bbm5VGdXk4lSG54naPUkM= MIME-Version: 1.0 Received: by 10.229.33.72 with HTTP; Wed, 7 Apr 2010 20:49:25 -0700 (PDT) In-Reply-To: <4BBD3DCB.4030902@freebsd.org> References: <4BBD3DCB.4030902@freebsd.org> Date: Wed, 7 Apr 2010 20:49:25 -0700 Received: by 10.229.35.80 with SMTP id o16mr14714862qcd.93.1270698565280; Wed, 07 Apr 2010 20:49:25 -0700 (PDT) Message-ID: From: Garrett Cooper To: Tim Kientzle Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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 03:49:26 -0000 On Wed, Apr 7, 2010 at 7:22 PM, Tim Kientzle wrote: > Garrett Cooper wrote: >> >> =A0 =A0There's an outstanding bug to fix chroot(2)'ing functionality wit= h >> 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: > =A0* update $ROOTDIR/var/db/pkg > =A0* 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". As discussed in #bsdports with flz, it's much more complicated because in the future we'll most likely have mainstream support for cross-building where this isn't possible, i.e. build arm on i386 -- the point is that there are some steps that must be run on the target system or chroot, and this quite frankly isn't possible without being able to install directly on the target. Regardless, cross-building right now requires that one define the proper environment, and again that can't be delivered with pkg_add without introducing unneeded complexity. Point being, if someone wants to chroot, and they understand the complete exercise, or if we have documentation provided which demonstrates how to do so, people will use it, and potentially grow upon it in a positive way. Right now this is just a vestige of brokenness in pkg_install that should go IMO. > Of course, this isn't particularly easy to do when > forking tar(1), so the libarchive integration > might be a necessary prerequisite. =A0(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. =A0On 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). =A0On 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). Bingo -- that is the cruxt of the problem with doing chroot(2) with pkg_add. From a support perspective it's a nightmare because when something does go south, you're up a crik without a paddle trying to figure out what the heck is going on... it's better for us that someone is running with a stable, pre-defined system than try and force them to use a home grown / unknown method built around a shaky base. Thanks, -Garrett