FS#13051 - Allow pacman to cross-install with an --arch flag
Attached to Project:
Pacman
Opened by Aaron Griffin (phrakture) - Friday, 30 January 2009, 17:19 GMT
Last edited by Xavier (shining) - Monday, 07 September 2009, 15:06 GMT
Opened by Aaron Griffin (phrakture) - Friday, 30 January 2009, 17:19 GMT
Last edited by Xavier (shining) - Monday, 07 September 2009, 15:06 GMT
|
Details
Just had an idea that might be nice. I am thinking from the
arena of installation ISOs, here.
Allow the target architecture to be passed to pacman, using $(uname -m) if none is present. This will set a $arch variable in server parsing, similar to the $repo variable. Additionally, the functionality of util-linux-ng's setarch util may need to be used before chrooting. See http://git.kernel.org/?p=utils/util-linux-ng/util-linux-ng.git;a=blob;f=sys-utils/setarch.c Doing this allows us to very simply install a different architecture. The only thing I worry about is scriptlet execution. |
This task depends upon
Closed by Xavier (shining)
Monday, 07 September 2009, 15:06 GMT
Reason for closing: Implemented
Additional comments about closing: $arch in Server parsing is implemented. for the rest, using linux32/linux64 is fine :)
Monday, 07 September 2009, 15:06 GMT
Reason for closing: Implemented
Additional comments about closing: $arch in Server parsing is implemented. for the rest, using linux32/linux64 is fine :)
I'm attaching a sample (probably broken, not tested, not inteded for use) patch to pacman that suggests a way to get pacman to parse a $arch variable in Server entries.
If it works, it would only work when you're processing a Server entry on a machine where you want to make sure you're talking to a repo of the same architecture as the running kernel.
Attaching a patch (but it depends on my two other patches for
FS#15622)About the setarch stuff, I am unsure. It only works in some situations. For example, here is my config :
Linux xps-m1530 2.6.30-ARCH #1 SMP PREEMPT Fri Jul 31 18:10:38 UTC 2009 i686 Intel(R) Core(TM)2 Duo CPU T8100 @ 2.10GHz GenuineIntel GNU/Linux
and linux64 does not allow me to run 64 bit binaries.
Maybe if I was running a 64 bit kernel, linux32 would allow me to run 32 bit binaries. But well, it looks easy enough to run manually setarch/linux32/linux64 when we know it is supposed to work and when it is appropriate.
Also I am worried about the portability of this thing.
is it sufficient to close this ?
I also made other patches for
FS#15622, but this only checks the architecture defined in the packages.For example, if you consider this package : http://aur.archlinux.org/packages/bin32-skype/bin32-skype/PKGBUILD
it is a 32bit app made for x86_64, so it will be only installable on x86_64 (if you enable the architecture check).
If you have different needs, you can just disable the check, so don't worry.
I think what Aaron was suggesting was to move this functionality inside pacman. I first found it interesting, but after some thinking, I would much prefer to keep that code and functionality outside (in linux32 / linux64).