32-bit Slackware Chroot on Slackware64: Multilib Alternative

by loon & intox

Basically, the process can be summed up as:

Commands:

mkdir dvd slack32_chroot 
mount slack.iso dvd/
cd dvd/slackware

installpkg –root ../../slack32_chroot a/.t?z ap/.t?z d/.t?z e/.t?z f/.t?z k/.t?z kde/.t?z kdei/.t?z l/.t?z n/.t?z t/.t?z tcl/.t?z x/.t?z xap/.t?z xfce/.t?z y/.t?z

(or whatever packages groups you want, I just went for them all because why not)

mount -o bind /dev slack32_chroot/dev
mount -o bind /proc slack32_chroot/proc
mount -o bind /sys slack32_chroot/sys
mount -o bind /tmp slack32_chroot/tmp
mount --bind /etc/resolv.conf slack32_chroot/etc/resolv.conf

Here you’ll need to create a user with the same user ID as your normal user. Give it all the permissions you normally would for whatever the applications you want to run require.

cp /home/user/.Xauthority slack32_chroot/home/user/   
chroot slack32_chroot

Setup slackpkg / sbopkg / mirror, update, upgrade, install what you want from 32 bit packages. Launch xeyes or whatever to test. Should work. Make sure when you’re configuring the mirror, you set it to a 32 bit mirror. Also, when using slackbuilds, I ran into a few problems which were fixed by manually editing the slackbuilds to use 32 bit. For example, in a slackbuild, add this after the place where it checks for architecture:

ARCH=i486

Now, every time you reboot you’ll have to re-bind and remount everything, as well as re-copy your .Xauthority. That’s a pain. So just stick this script in the same directory as the chroot and run it before chrooting into it:

#!/bin/bash
mount -o bind /dev slack32_chroot/dev
mount -o bind /sys slack32_chroot/sys
mount -o bind /tmp slack32_chroot/tmp
mount -o bind /proc slack32_chroot/proc
mount --bind /etc/resolv.conf slack32_chroot/etc/resolv.conf
mount --bind /home/user/.Xauthority slack32_chroot/home/john/.Xauthority

Of course replacing user with your user ID. Obviously chmod +x the file you put that script in, and to enter the chroot just run chroot slack32_chroot or whatever directory you made your chroot in…

Works well for me. Why not just use alienbob’s multilib support? Well, you can and it’ll probably work fine, but I’ve run into a few problems with it and this just felt safer.