From owner-freebsd-current@FreeBSD.ORG Mon Sep 8 18:36:48 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8299016A; Mon, 8 Sep 2014 18:36:48 +0000 (UTC) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) by mx1.freebsd.org (Postfix) with ESMTP id 591C91820; Mon, 8 Sep 2014 18:36:48 +0000 (UTC) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 6D6A05A9F23; Mon, 8 Sep 2014 18:36:47 +0000 (UTC) Date: Mon, 8 Sep 2014 18:36:47 +0000 From: Brooks Davis To: Julio Merino Subject: Re: make -DNO_ROOT to create chroot, problem installing into chroot with pkg Message-ID: <20140908183647.GD35236@spindle.one-eyed-alien.net> References: <20140908154858.GB35236@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="E/DnYTRukya0zdZ1" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Craig Rodrigues , freebsd-current Current , freebsd-pkg@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Sep 2014 18:36:48 -0000 --E/DnYTRukya0zdZ1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 08, 2014 at 01:06:38PM -0400, Julio Merino wrote: > On Mon, Sep 8, 2014 at 11:48 AM, Brooks Davis wrote: > > > > If you don't mind the ownership being wrong and there being a few extra > > +FOO files tar works. It would be great for someone to teach package to > > install without root and to update a METALOG file. That's not 100% of > > the solution, but it's a solid 80-90% solution. >=20 > (This is just my completely uninformed opinion as I don't know the > internals of pkg.) There are other issues to be addressed. >=20 > Teaching pkg to install without root means changing pkg to not use > chroot: i.e. to make pkg be able to deal with the concept of a > "destdir" for package installations. That is probably easy: just > prefixing a bunch of destdir to the locations being touched. This should be pretty easy given that most of the process is extracting files from the tarball. > However, the tricky part here is dealing with any package-specific > post-install scripts to ensure they understand destdir, which in turn > means that any tools executed by the scripts must also be capable of > dealing with a destdir. Also, the scripts (being potentially-untrusted > code) cannot be guaranteed to behave correctly on the > outside-of-the-chroot system. I believe the majority of packages don't suffer from post-install scripts hence the suggestion that extracting in the right place without root would solve 80-90% of the problem (and probably take no more than 10% of the work). I could live with the pain of not having scripts run during install. The correct long term fix as proposed by bapt is the do anyway with most scripts in favor of common actions and if any significant scripts remain add the ability to run them on first boot. -- Brooks --E/DnYTRukya0zdZ1 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlQN9z4ACgkQXY6L6fI4GtTn6ACghIqbUMnugSjv0x5ahH6Yj1LG cD0AnRBkIvXDeI3RVq8dCmFGqVajFh6E =viv6 -----END PGP SIGNATURE----- --E/DnYTRukya0zdZ1--