From owner-freebsd-current@FreeBSD.ORG Wed Feb 6 06:34:29 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0CEB58D5 for ; Wed, 6 Feb 2013 06:34:29 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id C6A8E29 for ; Wed, 6 Feb 2013 06:34:28 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id r166YLL3090386 for freebsd-current@freebsd.org; Wed, 6 Feb 2013 06:34:21 GMT (envelope-from kientzle@freebsd.org) Received: from [192.168.2.143] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id vz8qvujrqskzj3x8ycmuhdfmqe; for freebsd-current@freebsd.org; Wed, 06 Feb 2013 06:34:21 +0000 (UTC) (envelope-from kientzle@freebsd.org) From: Tim Kientzle Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Cross-architecture package installs Date: Tue, 5 Feb 2013 22:34:18 -0800 Message-Id: <4703DEB0-E2DC-403E-9F14-DE968CBE4921@freebsd.org> To: freebsd-current Current Mime-Version: 1.0 (Apple Message framework v1283) X-Mailer: Apple Mail (2.1283) 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:34:29 -0000 I'm working on tools to build ARM system images. Usually, these tools run on x86, which creates a problem for packages. 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. 1) Pre-install/post-install scripts. These obviously don't work since the DESTDIR is for a different architecture. 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. This won't work for pre-install, but those are rarer and we can hopefully work around them on a case-by-case basis. 2) The chroot happens before opening the package files. 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.) It should be feasible to open the package files first and then chroot. Then the actual installation still happens entirely inside DESTDIR. 3) Bogus "failed to install" messages. As far as I can tell, if "bar" depends on "foo", then "pkg add bar foo" will do this: Installing bar =85 Installing foo =85 done done Installing foo =85 foo already installed. Failed to install the following package: foo. This is surprising since foo did in fact get installed. 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.