From owner-freebsd-arch@FreeBSD.ORG Sat Apr 10 07:34:56 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 E5DE9106564A; Sat, 10 Apr 2010 07:34:55 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.26]) by mx1.freebsd.org (Postfix) with ESMTP id 533A88FC08; Sat, 10 Apr 2010 07:34:55 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 5so1361230qwi.7 for ; Sat, 10 Apr 2010 00:34:54 -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=MT88zgAhKXSdm95kwgOXkERDt3X362GB6qjJIgCk5Vw=; b=q847DIP64w/jCwJn43FQlsyrbGRmW2Wv5pImS3VJszOAwbnCdP6v/WHeLuS3OgDPq2 7tR+yjbtsh+eAis+mjkRgSfy/kYcRuBYZomzScPgpRbhdWSBvuud3g0ryhnFqSXApa47 eks+BbCaUmI0oy6BAF8BtrTy2v0rwJc3FdNE4= 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=W5Ozry1toQYQVPKnYq5wVajaiTYmgwMYZVxBpLGypPp7GjQSOCOH+OgMJeXGabGqmX b6myWaEITTtBBqcIzjo+ThdP1DSQkrbLaI4BLssfv2gNzAeSp2/DlSnUqikdvRAH3OVE d5BtdeULcsq+6lQ/4xFGKNKgo8eCxQDmQ1lUA= MIME-Version: 1.0 Received: by 10.229.28.85 with HTTP; Sat, 10 Apr 2010 00:34:53 -0700 (PDT) In-Reply-To: References: <4BBD3DCB.4030902@freebsd.org> Date: Sat, 10 Apr 2010 00:34:53 -0700 Received: by 10.229.239.149 with SMTP id kw21mr1609712qcb.99.1270884893614; Sat, 10 Apr 2010 00:34:53 -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, freebsd-ports , 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: Sat, 10 Apr 2010 07:34:56 -0000 On Wed, Apr 7, 2010 at 8:49 PM, Garrett Cooper wrote: > 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 wi= th >>> 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. It's been two days without a lot of commentary. Expanding to a larger audience... Thanks, -Garrett