Re: 32-bit system, 64-bit chroot?
Hmm, well, with my 32bit chroot, I simply use the dchroot command to execute
commands from outside the chroot. This way you are not messing up any files
outside the chroot by pointing them to files inside the chroot. In other
words, the system outside the chroot should not have to know *anything* about
the libraries, etc inside the chroot.
Specifically, my chroot is in /ia32-root.
I have /home and /tmp bind mounted inside the chroot:
(/etc/fstab outside chroot):
/home /ia32-root/home none bind 0 0
/tmp /ia32-root/tmp none bind 0 0
Then I make sure that the /etc/passwd file contains the same UID <-> user
mapping both inside and out of the chroot.
Next install dchroot and edit /etc/dchroot.conf:
ia32 /ia32-root
Now let's say that I want to run my 32bit copy of the IDL program, which is
installed inside my chroot. I have the following small script outside the
chroot:
/usr/local/bin/idl:
#!/bin/sh
exec dchroot -c ia32 -d "$(basename $0)" -- "$@"
so this switches to the chroot and executes the identically named command
(idl), and passes any extra arguments to the command inside the chroot. This
configuration has been working great both for commercial software like IDL
and also things like OpenOffice. Also it maintains a clean separation
between the 32bit and 64bit software
Hope this helps!
-Ted
On Tuesday 15 February 2005 09:54, Bob Proulx wrote:
> I would like to configure a 32-bit base system, use a amd64-k8 kernel
> such as the kernel-image-2.6.8-10-amd64-k8-smp kernel, and set up a
> 64-bit chroot on the machine. This mostly works. But I am missing
> something. I am trying to follow the ia32 chroot howto in reverse to
> install an amd64 chroot.
>
> On a freshly installed i686 sarge system I have installed the
> kernel-image-2.6.8-10-amd64-k8-smp kernel. 'uname -m' reports x86-64.
> I then installed an amd64 chroot at /emul/amd64-linux. In the chroot
> everything is working fine and I can run 64-bit executables.
>
> I would like to be able to run 64-bit executables on the 32-bit system
> outside of the chroot similarly but in reverse to the way one can run
> 32-bit executables on a 64-bit system using the /emul layer. But this
> is not working. I am sure I am missing something silly and trivial.
>
> I included the following as additional entries in /etc/ld.so.conf.
>
> /emul/amd64-linux/lib
> /emul/amd64-linux/usr/lib
> /emul/amd64-linux/usr/X11R6/lib
>
> I installed this symlink:
>
> /lib/ld-linux-x86-64.so.2 -> /emul/amd64-linux/lib/ld-linux-x86-64.so.2
>
> I ran 'ldconfig' to update the cache.
>
> I can run 64-bit exectuables with ld.so. This works:
>
> /lib/ld-linux-x86-64.so.2 /emul/amd64-linux/bin/ls --help
>
> But running 64-bit executables directly fails. This appears to not
> recognize the binary file format. I get a bash error saying no such
> file or directory.
>
> /emul/amd64-linux/bin/ls --help
> -bash: /emul/amd64-linux/bin/ls: No such file or directory
>
> I tried installed amd64-libs to do an A-B comparison. But that fails
> to function with a missing libacl.so.1 library. I don't get the no
> such file or directory error however so it is working better.
>
> As a wild guess I tried changing all amd64 paths to x86_64. But that
> had no affect. That is, /emul/x86_64-linux for the emulation layer
> did not work any differently than /emul/amd64-linux. Neither did
> /emul/x86-64-linux.
>
> Does anyone see the mistake I have made here?
>
> Thanks
> Bob
Reply to: