Arch64 Install bundled 32bit system
From ArchWiki
| i18n |
|---|
| English |
| Czech |
Contents |
[edit] Arch64 Install bundled 32bit system
Note that this script doesn't try to change anything out of the 32bit directory. I'm no expert so there is maybe errors or some "bad things".
This howto is just for those who really need to run 32 bit apps and to install it easily. As Arch64 tries to be a pure 64 bit distro, it seems the devs won't provide any compatibility libs, this system seems to me the cleaner.
[edit] Install the base 32 bit system
We create the repository.
mkdir /opt/arch32 vim /etc/pacman.d/mirrorlist
Here you'll have to replace in the first address x86_64 by i686. Don't forget to revert it at the end of the howto or your system can be screwed when you install something.
As soon as you use the --root switch to the pacman command below, all the files /var/log/pacman.log /var/lib/pacman/db.lck will be created inside your /opt/arch32 directory. So the log of pacman will be /opt/arch32/var/log/pacman.log and will NOT mess up with your 64bit installation. There is no need for a LogFile directive in /etc/pacman.conf or a --logfile switch unless you want the log file to be elsewhere.
The --cachedir switch is for the package to be cached in the /opt/arch32/var/cache/pacman/pkg directory instead of /var/cache/pacman/pkg
We now create that directory, just to be sure:
mkdir -p /opt/arch32/var/{cache/pacman/pkg,lib/pacman}
Now proceed to sync up pacman:
pacman --root /opt/arch32 --cachedir /opt/arch32/var/cache/pacman/pkg -Sy
Now we can install the base packages:
pacman --root /opt/arch32 --cachedir /opt/arch32/var/cache/pacman/pkg -S base base-devel
If you don't intend to compile packages inside this chroot, you can omit the base-devel group:
pacman --root /opt/arch32 --cachedir /opt/arch32/var/cache/pacman/pkg -S base
You can now revert your pacman.d/mirrorlist file to x86_64.
[edit] /etc/rc.d/arch32 rc script
To initiate the 32bit environment at startup, create a script in /etc/rc.d/ called "arch32":
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
case $1 in
start)
stat_busy "Starting Arch32 chroot"
mount --bind /proc /opt/arch32/proc
mount --bind /proc/bus/usb /opt/arch32/proc/bus/usb
mount --bind /dev /opt/arch32/dev
mount --bind /dev/pts /opt/arch32/dev/pts
mount --bind /dev/shm /opt/arch32/dev/shm
mount --bind /sys /opt/arch32/sys
mount --bind /tmp /opt/arch32/tmp
mount --bind /home /opt/arch32/home
add_daemon arch32
stat_done
;;
stop)
stat_busy "Stopping Arch32 chroot"
umount /opt/arch32/proc/bus/usb
umount /opt/arch32/proc
umount /opt/arch32/dev/pts
umount /opt/arch32/dev/shm
umount /opt/arch32/dev
umount /opt/arch32/sys
umount /opt/arch32/tmp
umount /opt/arch32/home
rm_daemon arch32
stat_done
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0
Then allow execution of this script:
chmod +x /etc/rc.d/arch32
And add it to "/etc/rc.conf":
DAEMONS=(syslog-ng network netfs crond arch32 gdm)
[edit] Configure the new installed system
First, copy some meaningful config files over....
cd /opt/arch32/etc ln -f /etc/passwd* . ln -f /etc/shadow* . ln -f /etc/group* . ln -f /etc/rc.conf . ln -f /etc/resolv.conf . ln -f /etc/localtime . ln -f /etc/locale.gen . ln -f /etc/profile.d/locale.sh profile.d cp /etc/vimrc . cp /etc/mtab .
Now chroot in your new system
/etc/rc.d/arch32 start xhost +local: chroot /opt/arch32
I recommend that you use a custom bash prompt inside your 32bit chroot installation to know where you are (i.e. inside the 32bit chroot). You can, for example, add a ARCH32 string to your PS1 string that you may have defined in .bashrc or other config file.
Fix some future locale issues
/usr/sbin/locale-gen pacman -S ttf-bitstream-vera ttf-ms-fonts
Note that you can install any other font. You just need one or your apps won't display any text.
Also, keep in mind that the "/etc/pacman.conf" file from the 32bit environment is the default one. The [community] repo is enabled by default now.
Now you can install any apps you need (*note for firefox with the nonfree flash plugin, you will need to install libxmu as well! Apparently this dependency has not been taken care of yet; see Flyspray).
pacman -S acroread opera pacman -S mozilla-firefox pacman -S libxmu flashplugin pacman -S mplayer-plugin
You can also clean up to win back some space by removing some unnecessary packages. This cleanup is for your 32 bit root" environment and must then be done inside it after chrooting! Below is a list of package you might want to remove...
pacman -Rd mkinitcpio pacman -R kernel26 pacman -R grub pacman -R dhcpcd pacman -R rp-pppoe pacman -R ppp pacman -R xfsprogs pacman -R reiserfsprogs pacman -R jfsutils pacman -R hdparm pacman -R hwdetect pacman -R syslog-ng pacman -R logrotate pacman -R lvm2 pacman -R dcron pacman -R wpa_supplicant pacman -R pcmciautils
[edit] Consider also clearing out your pacman cache (regularly)
Note: this is not a command that you'll only have to run just onc. As packages accumulate, you'll have to keep doing this if you want to clear out the space from the pacman cache:
pacman -Scc
[edit] Execute a 32bit apps from a 64bit env
[edit] Download and install dchroot
Install "dchroot" to your 64-bit installation from the community repository:
pacman -S dchroot
[edit] Configuration
Now, we must edit the configuration file (/etc/dchroot.conf) and add this line:
arch32 /opt/arch32
[edit] Execute 32bit apps
Finally, to use your 32bit apps:
dchroot -d "opera -notrayicon" dchroot -d acroread
It will launch Opera, without the systray icon, from your 32bit environment. The second example is for Acrobat Reader, where there is no "" since we don't need to add switches.
[edit] Using sound
The most used application in 32 bits is flash, for YouTube for example.
To get sound from the flash player in firefox, open a terminal and chroot inside the 32-bit system:
chroot /opt/arch32
From there, install alsa-oss:
pacman -S alsa-oss
Then type:
export FIREFOX_DSP="aoss"
Every chroot into the 32-bit system will require this export command to be entered so it may be best to incorporate it into a script.
Finally, launch Firefox.
[edit] Example script for Firefox with sound
Open a text editor and save the following in /usr/bin/firefox32 (as root, use sudo):
#!/bin/sh dchroot -d "firefox $1;export FIREFOX_DSP="aoss""
Make it executable:
sudo chmod +x /usr/bin/firefox32
Now you can make an alias for firefox if you want:
alias firefox="firefox32"
Add this to your $HOME/.bashrc file at the end, and type it into bash to make the alias available immediately. Or you can just change all your DE launchers to firefox32 if you still want 64 bit firefox to be available.