Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 105 lines (72 sloc) 2.666 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
A way to use a 32 bit system on 64 bit host
===========================================

1. install schroot and debootstrap
----------------------------------

Note: just cut and paste the commands from this file
      after adjusting for your environment

sudo apt-get install schroot debootstrap


2. configure schroot for a 32 bit system
----------------------------------------

   e.g. Ubuntu jaunty i386
   this is added to /etc/schroot/schroot.conf
   or put into /etc/schroot/schroot.d/jaunty_i386.conf
   (depending on your system)
   (substitute ${USER} when creating the file, cat will do this)

$ cat <<EOF >jaunty_i386.conf
[jaunty_i386]
description=Ubuntu 9.04 Jaunty for i386
location=/data/chroot/jaunty_i386
personality=linux32
root-users=${USER}
run-setup-scripts=true
run-exec-scripts=true
type=directory
users=${USER}
EOF


e.g to append to /etc/schroot/schroot.conf (if not using schroot.d)

cat jaunty_i386.conf | sudo tee -a /etc/schroot/schroot.conf


3. download and create the initial chroot
-----------------------------------------

sudo debootstrap --variant=buildd --arch i386 jaunty /data/chroot/jaunty_i386 http://archive.ubuntu.com/ubuntu/


4. configure the schroot by running as root
-------------------------------------------

schroot -c jaunty_i386 -u root

# Now run these commands in the this chroot:

mv /etc/apt/sources.list /etc/apt/sources.list.ORIG
cat >/etc/apt/sources.list <<EOF
deb http://tw.archive.ubuntu.com/ubuntu jaunty main
deb http://tw.archive.ubuntu.com/ubuntu/ jaunty-updates main
deb http://tw.archive.ubuntu.com/ubuntu/ jaunty universe
deb http://tw.archive.ubuntu.com/ubuntu/ jaunty-updates universe
EOF


# choose your locale
locale-gen en_GB.UTF-8

# make sure apt database is up-to-date
apt-get update

apt-get install dialog

dpkg-reconfigure locales

# install editor, browser and programs necessary for building
apt-get install --no-install-recommends jove
apt-get install lynx-cur sudo wget
apt-get install python-gd gawk gforth flex bison m4
apt-get install netpbm qt4-qmake libqt4-dev
apt-get install python-serial sqlite3 php5-cli python-dev

# enable bash in the dialog box
# (or find and fix the shell scripts that fail when run under
# dash [some part of one of the Makefiles])
dpkg-reconfigure dash

# done with the chroot
exit


5. create a little script to use schroot
----------------------------------------

cat <<EOF >m
#!/bin/sh

schroot -c jaunty_i386 -- make "\$@"
EOF
chmod +x m


6. build the system
-------------------

cp samo-lib/include/config.h-default samo-lib/include/config.h
# uncomment the correct hardware version in config.h
${EDITOR} samo-lib/include/config.h
./m
Something went wrong with that request. Please try again.