Peter Humphrey wrote:
On Sunday 21 August 2011 04:04:05 Matthew Finkel wrote:

On Sat, Aug 20, 2011 at 10:46 PM, Dale<rdalek1...@gmail.com>  wrote:
How hard is it to set up a 64 bit machine to compile programs for a 32
bit system?

Dale

:-)  :-)
It's actually quite easy. IIRC, when I did it last, the only difference
is that when you chroot into the subsystem you need prefix the command
with linux32, e.g. linux32 chroot /path/to/chroot /bin/bash
Yes, just follow this guide:
http://www.gentoo.org/proj/en/base/amd64/howtos/chroot.xml

I did that and it was straightforward as far as I remember. I did spend some
time thinking at a few stages, to get an understanding of what I was doing
rather than just blindly following somebody else's prescription.

Then it's a matter of writing some simple scripts to mount the packages
directory on the big host. Here's mine, most of which I scrounged from
somewhere:

$ cat /etc/init.d/atom
#!/sbin/runscript

depend() {
    need localmount
    need bootmisc
}

start() {
     ebegin "Mounting 32-bit chroot dirs"
     mount -o bind /dev /mnt/atom/dev>/dev/null
     mount -o bind /dev/pts /mnt/atom/dev/pts>/dev/null
     mount -o bind /dev/shm /mnt/atom/dev/shm>/dev/null
     mount -t proc /proc /mnt/atom/proc>/dev/null
     mount -o bind /sys /mnt/atom/sys>/dev/null
     mount -o bind /tmp /mnt/atom/tmp>/dev/null
     mount -t nfs -o vers=3 192.168.2.2:/usr/portage/packages
/mnt/atom/usr/portage/packages
     eend $? "An error occurred while attempting to mount 32-bit chroot
directories"
     ebegin "Copying 32-bit chroot files"
     cp -pf /etc/resolv.conf /mnt/atom/etc/>/dev/null
     cp -pf /etc/passwd /mnt/atom/etc/>/dev/null
     cp -pf /etc/shadow /mnt/atom/etc/>/dev/null
     cp -pf /etc/group /mnt/atom/etc/>/dev/null
     cp -pf /etc/hosts /mnt/atom/etc/>  /dev/null
     cp -Ppf /etc/localtime /mnt/atom/etc/>/dev/null
     eend $? "An error occurred while attempting to copy 32-bit chroot files."
}

stop() {
     ebegin "Unmounting 32-bit chroot dirs"
     umount -f /mnt/atom/dev/pts>/dev/null
     umount -f /mnt/atom/dev/shm>/dev/null
     umount -f /mnt/atom/dev>/dev/null
     umount -f /mnt/atom/proc>/dev/null
     umount -f /mnt/atom/sys>/dev/null
     umount -f /mnt/atom/tmp>/dev/null
     umount -f /mnt/atom/usr/portage/packages>/dev/null
     eend $? "An error occurred while attempting to unmount 32-bit chroot
directories"
}

I could list the steps of my daily routine to upgrade both the client and
the chroot if that would help.


I followed the guide and some info here and it seems to have worked great. I'm glad. The cooler on the heatsink is VERY whimpy. It's aluminum and has a little 60mm fan on it. I didn't measure it but its certainly not as big as my 80mm. I can barely feel the air it moves. Compiling on htat would likely be a problem pretty quick.

Now to get the install moved over to the other rig. DVD and a tarball maybe? Hmmmm, I got to think on this one. It's almost 5Gbs worth. Maybe man scp will help. ;-)

Thanks for the link.  This was awesome!!

Dale

:-)  :-)

P. S.  Now I can build binaries for my old rig too.  :-D

Reply via email to