Re: Cross-architecture package installs

From: Tim Kientzle <kientzle_at_FreeBSD.org>
Date: Wed, 6 Feb 2013 18:32:53 -0800
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.
> 
>> 1) Pre-install/post-install scripts.
>> 
>>    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 <packages>"

* 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 :(
> 
> 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


Received on Thu Feb 07 2013 - 01:32:58 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:34 UTC