From owner-freebsd-current@FreeBSD.ORG Thu Feb 7 02:32:58 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 5BF0F4BB; Thu, 7 Feb 2013 02:32:58 +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 F066CBD9; Thu, 7 Feb 2013 02:32:54 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id r172WsPY096226; Thu, 7 Feb 2013 02:32:54 GMT (envelope-from kientzle@FreeBSD.org) Received: from [192.168.2.143] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id 3sukwci2ei6nutm77ztf99brns; Thu, 07 Feb 2013 02:32:54 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Subject: Re: Cross-architecture package installs Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: multipart/signed; boundary="Apple-Mail=_8C6A3E66-BC58-4C99-AC56-2A77AEEB7BCE"; protocol="application/pgp-signature"; micalg=pgp-sha1 From: Tim Kientzle In-Reply-To: <20130206065514.GB1268@ithaqua.etoilebsd.net> Date: Wed, 6 Feb 2013 18:32:53 -0800 Message-Id: <1004D96B-38AF-43FA-8BE0-49046D9446E2@FreeBSD.org> References: <4703DEB0-E2DC-403E-9F14-DE968CBE4921@freebsd.org> <20130206065514.GB1268@ithaqua.etoilebsd.net> To: Baptiste Daroussin X-Mailer: Apple Mail (2.1283) 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: Thu, 07 Feb 2013 02:32:58 -0000 --Apple-Mail=_8C6A3E66-BC58-4C99-AC56-2A77AEEB7BCE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Feb 5, 2013, at 10:55 PM, Baptiste Daroussin wrote: > 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. >=20 >> 1) Pre-install/post-install scripts. >>=20 >> These obviously don't work since the DESTDIR >> is for a different architecture. > 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. Here's an approach that would handle post-install fairly graciously in this case. I'll presume you're cross-building from x86 to ARM in this example: * On x86, run "pkg -c $ARMSYS install " * During install, record the post-install scripts in the package database but don't run them. * When the ARM system is first booted, an rc.d script runs "pkg finish" (or "pkg install --some-option" if you prefer) "pkg finish" finds the post-install scripts that have not yet been run and runs them. This way, the post-install scripts always run on the native architecture. This won't work for pre-install scripts, of course. > 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 :( >=20 > We are open for all suggestions here A "first boot fixup" as above might handle some of these cases. (Instead of running these commands immediately, register them to run on next boot.) For others, I think the only feasible option is to identify them and get people to help push the necessary functionality into libraries. Tim --Apple-Mail=_8C6A3E66-BC58-4C99-AC56-2A77AEEB7BCE Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) iQEcBAEBAgAGBQJRExJVAAoJEGMNyGo0rfFB+0wH+weesTJ4K1bguEfei4OJLPCx empmVuDoPXdRvQN7c8RSfUJVB+9mcBVeknCcQj3gISvqd3BE7uW5kJPXg5wNZfzG wTVQAR/olntYEtDbuT36Nsa4xTlFtnpyd7QEzTjqqfnkCX+/Izs7MO4tOLkcqtK+ boa+ny2zqWIPlZszDj5c2XoTHWZBjZY8mBBh/Lami1Ee15Qivies2S5VRzD+aYCb p9affOExpfWu0UTyRvlfCiv+c7u5kja91d1bXkDLsVZOXeMlcU+CDslz52CyFVu3 hgfVcqG+nnbI4t14ScRQ3AYPhjkwDqJ3/RO5q1S459NTHLV81pqjz/RnIyI/Gyw= =yFPx -----END PGP SIGNATURE----- --Apple-Mail=_8C6A3E66-BC58-4C99-AC56-2A77AEEB7BCE--