Weblog entry #4 for trakic
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
[ Send Message | View Utumno's Scratchpad | 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:
- cd /bin
- mv uname uname.backup
now create the following simple bash script
#!/bin/bash
echo armv5tel
name it 'uname' and move it to '/bin'. Voilla:
- 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 | Reply to this comment ]
[ Send Message | View Utumno's Scratchpad | 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 | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Send Message | View Utumno's Scratchpad | 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 | Reply to this comment ]
[ Send Message | View Utumno's Scratchpad | 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 | Reply to this comment ]
[ Send Message | View Utumno's Scratchpad | 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 | Reply to this comment ]
[ Parent | Reply to this comment ]
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 | Reply to this comment ]
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 | Reply to this comment ]
;-)
I would deffenetly give a try and even post a (new) article here?br.a
[ Parent | Reply to this comment ]