From owner-freebsd-current@FreeBSD.ORG Wed Feb 6 06:55:20 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 881FB137; Wed, 6 Feb 2013 06:55:20 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-ea0-f180.google.com (mail-ea0-f180.google.com [209.85.215.180]) by mx1.freebsd.org (Postfix) with ESMTP id 9FB0816F; Wed, 6 Feb 2013 06:55:19 +0000 (UTC) Received: by mail-ea0-f180.google.com with SMTP id c1so387522eaa.25 for ; Tue, 05 Feb 2013 22:55:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=WpLURna2Ixeo7onmSiJ0vov0wxbeNmMWog1a50aJvYE=; b=n/DZtZEpe4HXprsmaAnuFs5DoHdR1i25ZVD8hqhSUhTAJhfIB9jaFmdiNN+0fYWxg8 lKUy03mYJEalnBzllFuckP40RCpccZvoEhZB6dvYg/oUJ1memtPkrJ2tT8mynPyiUs0/ ysIQJWnDQTc0jdfwpCglyUy4i/iWkgo4IGldiuonXMEZ6hY16a41cubqRoOUkh4ZLymv AAG7OqiRwoGObPyzsdc4cQH1qrrVTplHOdw2sEt5QEfMq7yF7Y+E0PVoyHE5g337yUvC anhyaJwU/DjjmmEjHFLq/+8XQa9fBlD509dGafXYSTwp6SqmTu1rU1VNZwvuRqD3DZfj p0Ag== X-Received: by 10.14.173.69 with SMTP id u45mr93547261eel.21.1360133718147; Tue, 05 Feb 2013 22:55:18 -0800 (PST) Received: from ithaqua.etoilebsd.net (ithaqua.etoilebsd.net. [37.59.37.188]) by mx.google.com with ESMTPS id q42sm25885961eem.14.2013.02.05.22.55.16 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 05 Feb 2013 22:55:17 -0800 (PST) Sender: Baptiste Daroussin Date: Wed, 6 Feb 2013 07:55:15 +0100 From: Baptiste Daroussin To: Tim Kientzle Subject: Re: Cross-architecture package installs Message-ID: <20130206065514.GB1268@ithaqua.etoilebsd.net> References: <4703DEB0-E2DC-403E-9F14-DE968CBE4921@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tjCHc7DPkfUGtrlw" Content-Disposition: inline In-Reply-To: <4703DEB0-E2DC-403E-9F14-DE968CBE4921@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: pkg@FreeBSD.org, freebsd-current Current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 06 Feb 2013 06:55:20 -0000 --tjCHc7DPkfUGtrlw Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 05, 2013 at 10:34:18PM -0800, Tim Kientzle wrote: > I'm working on tools to build ARM system images. > Usually, these tools run on x86, which creates a problem > for packages. First Yes cross-installation of packages is something we highly want in pkg= ng and is plan since the beginning, that is one of the reason pkg -c is readig= the ABI from the DESTDIR, to make sure we only install things that are abi compatible.. >=20 > I would like to install packages onto the image as it's built. > So I've been experimenting with variations of > pkg -c add > I'm running into a few problems but I think they can all be > solved. Only the first is critical; the rest are relatively > minor annoyances. >=20 > 1) Pre-install/post-install scripts. >=20 > These obviously don't work since the DESTDIR > is for a different architecture. >=20 > At least for post-install, it should be possible to > record which packages still need their post-install > scripts run and arrange to run them after first > boot. I'm picturing an rc.d script that invokes pkg > with appropriate options to find all packages > that still need their post-install run and runs them. >=20 > This won't work for pre-install, but those are rarer > and we can hopefully work around them on a > case-by-case basis. This is imho the main problem, and one of the long term goal of pkgng is to= remove as much as possible any pre-instal/post-install scripts. The second problem= you will get into is the API that call system()/exec()/etc for example all the = call the pw_mkdb from libutil :( We are open for all suggestions here >=20 > 2) The chroot happens before opening the package files. >=20 > It's possible to work around this by copying all of the > package files into DESTDIR first, but that's both > time-consuming and rather awkward. (And quite > tricky if you're installing directly onto a mounted > image that has very little free space.) >=20 > It should be feasible to open the package files first > and then chroot. Then the actual installation still > happens entirely inside DESTDIR. In fact pkg add is only mean to be used in special case if in that particul= ar case you would have used pkg -c DESTDIR install using a repos= itory you would have created on your host using pkg repo to create the metadata t= hing necessary. problem your packagesite should served via a http/ftp not file e= xcept if the files are also locate inside the chroot. >=20 > 3) Bogus "failed to install" messages. >=20 > As far as I can tell, if "bar" depends on "foo", then > "pkg add bar foo" will do this: >=20 > Installing bar =E2=80=A6 > Installing foo =E2=80=A6 > done > done > Installing foo =E2=80=A6 foo already installed. Yeah as said above pkg add as to be forgotten as much as possible, it has b= een created mostly for the ports tree and the ports build script so that they d= on't need too much changes other that s/pkg_add/pkg add/g >=20 > Failed to install the following package: foo. >=20 > This is surprising since foo did in fact get installed. >=20 > In my case, I want to say "pkg add *" and just have > it DTRT. It mostly does get the ordering right (I'm impressed!) > but the error message is a bit odd. Just do "pkg install -x ." or "pkg install -g *" ordering would be ok witho= ut odd message. pkg add does not ordering, I'm surprised you got it right :) regards, Bapt PS: I CCed freebsd-pkg@, which is a new mailing list dedicated to this kind= of discussion --tjCHc7DPkfUGtrlw Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlER/lIACgkQ8kTtMUmk6EwWwwCeLQA2NF/FMU/MGDxCmBPZlhbf N/0AoLZ04bVsLLzY3qG4pGdmRYpLO8RC =tOn2 -----END PGP SIGNATURE----- --tjCHc7DPkfUGtrlw--