This site is now 100% read-only, and retired.

XML logo

dpkg+apt on slow systems
Posted by trakic on Wed 17 Sep 2008 at 21:45
Tags: none.
I would really like to incomporate the idea from: http://gentoo-wiki.com/HOWTO_Emerge_on_very_slow_systems

I have following setup:
- MachineA: 512Mb,debian/testing,i686
- MachineB: 32Mb,debian/testing,armv5tel

When i enter:
debian-nvu:/tmp# setarch arm chroot /mnt/slowmachine /bin/bash
setarch: arm: Unrecognized architecture

Can anyone shed some light?
Thx in advance,admir trakic

 

Comments on this Entry

Re: dpkg+apt on slow systems
Posted by Utumno (60.248.xx.xx) on Thu 18 Sep 2008 at 07:09
[ View Weblogs ]

Well, looking at setarch's sources (https://fedorahosted.org/setarch/browser/setarch.c?rev=2) it is clear that any arm* argument is not even mentioned, so using anything like 'arm*' is totally out of question. Even those defined in setarch.c ( like, for example, "s390" ) wouldn't work on i686, because ( again looking at the source ) on i686 both variables '__s390x__' and '__s390__' are undefined.

Conclusion: if you have a i686, you can only set your architecture to 'i*86'. If you have a x86_64, you can set arch to 'x86_64' or 'i*86'.

***********************************************************

That being said, all is not lost. 'man 8 setarch' says that all it does is modify the output of the 'uname -m' command. You can do that by hand:

  1. cd /bin
  2. mv uname uname.backup

now create the following simple bash script

#!/bin/bash
echo armv5tel

name it 'uname' and move it to '/bin'. Voilla:

  1. uname -m
    armv5tel

************************************************************

That simple script has one downside: it replies 'armv5tel' no matter what argument it gets called with. To really mimic the original 'uname' you'd have to hack something a bit longer...

[ Parent ]

Re: dpkg+apt on slow systems
Posted by Utumno (60.248.xx.xx) on Thu 18 Sep 2008 at 07:23
[ View Weblogs ]

But wait, something's not right. If really all setarch does is modify the output of 'uname -m', then the command

setarch machineB_arch chroot /mnt/slowmachine /bin/bash

as advised in Gentoo's tutorial is pointless, because chroot already replaces machineA's /bin/uname with machineB's.

[ Parent ]

Re: dpkg+apt on slow systems
Posted by Anonymous (193.110.xx.xx) on Thu 18 Sep 2008 at 07:38
Utumno, thx for you comment and your suggestion. Does this implies chrooting from i686 to armv5tel is impossible idea? br.a

[ Parent ]

Re: dpkg+apt on slow systems
Posted by Utumno (60.248.xx.xx) on Thu 18 Sep 2008 at 08:28
[ View Weblogs ]

I can see no reason why a simple

#chroot /mnt/slowmachine
#apt-get update && apt-get upgrade

wouldn't work. Try it. Forget the setarch, which is most problably only for compilation (gentoo!).

[ Parent ]

Re: dpkg+apt on slow systems
Posted by Utumno (60.248.xx.xx) on Thu 18 Sep 2008 at 08:36
[ View Weblogs ]

Wait, what am I babbling about today.... Of course not, your i686 kernel wouldn't run arm binaries on machineB. So this way no...

Maybe a way to speed things up would be to set up a local arm mirror on your fast machine and point sources.list on arm to that.

[ Parent ]

Re: dpkg+apt on slow systems
Posted by Utumno (60.248.xx.xx) on Thu 18 Sep 2008 at 08:42
[ View Weblogs ]

Another idea: set up a ARM virtualized guest on the fast machine ( http://bellard.org/qemu/status.html says it is supported ) , set up QEMU networking and from there, follow the Gentoo way.

[ Parent ]

Re: dpkg+apt on slow systems
Posted by mcortese (213.70.xx.xx) on Thu 18 Sep 2008 at 09:27
[ View Weblogs ]
But is the ARM emulated on a fast machine really faster than the real one?

[ Parent ]

Re: dpkg+apt on slow systems
Posted by mcortese (213.70.xx.xx) on Thu 18 Sep 2008 at 09:34
[ View Weblogs ]

I don't see how the procedure can work, except for two machines with exactly the same arch & kernel.

If you chroot to machine B's file system, then all binaries, libraries, kernel modules, etc. will be the ones present on machine B, and will fail if called from machine A.

[ Parent ]

Re: dpkg+apt on slow systems
Posted by endecotp (86.7.xx.xx) on Sun 21 Sep 2008 at 17:59
[ View Weblogs ]
The gentoo page that you link to is about cross-compiling from the fast machine to the slow machine. If you're just using dpkg and apt, nothing is being compiled. In this case, instead of chrooting, you need to just tell dpkg and apt to use the different root. I believe that this is relatively simple for dpkg; just pass --root=/path/to/slowroot. For apt, see:

http://linux.derkeiler.com/Mailing-Lists/Debian/2004-11/3045.html

I'm unsure if this is going to work for packages with non-trivial postinst scripts. Maybe someone else can comment on that.

If you really want to cross-compile then you should probably have a look at Emdebian.

[ Parent ]

Re: dpkg+apt on slow systems
Posted by Anonymous (193.110.xx.xx) on Mon 22 Sep 2008 at 08:18
endecotp: good tip for avoiding a chrooting. I was always wondering when I would need -o switch in order to run apt/dpkg to my slow, but lowenergy and silent arm/NSLU2 box.
;-)
I would deffenetly give a try and even post a (new) article here?br.a

[ Parent ]