Using-schroot.text 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. A way to use a 32 bit system on 64 bit host
  2. ===========================================
  3. 1. install schroot and debootstrap
  4. ----------------------------------
  5. Note: just cut and paste the commands from this file
  6. after adjusting for your environment
  7. sudo apt-get install schroot debootstrap
  8. 2. configure schroot for a 32 bit system
  9. ----------------------------------------
  10. e.g. Ubuntu jaunty i386
  11. this is added to /etc/schroot/schroot.conf
  12. or put into /etc/schroot/schroot.d/jaunty_i386.conf
  13. (depending on your system)
  14. (substitute ${USER} when creating the file, cat will do this)
  15. $ cat <<EOF >jaunty_i386.conf
  16. [jaunty_i386]
  17. description=Ubuntu 9.04 Jaunty for i386
  18. location=/data/chroot/jaunty_i386
  19. personality=linux32
  20. root-users=${USER}
  21. run-setup-scripts=true
  22. run-exec-scripts=true
  23. type=directory
  24. users=${USER}
  25. EOF
  26. e.g to append to /etc/schroot/schroot.conf (if not using schroot.d)
  27. cat jaunty_i386.conf | sudo tee -a /etc/schroot/schroot.conf
  28. 3. download and create the initial chroot
  29. -----------------------------------------
  30. sudo debootstrap --variant=buildd --arch i386 jaunty /data/chroot/jaunty_i386 http://archive.ubuntu.com/ubuntu/
  31. 4. configure the schroot by running as root
  32. -------------------------------------------
  33. schroot -c jaunty_i386 -u root
  34. # Now run these commands in the this chroot:
  35. mv /etc/apt/sources.list /etc/apt/sources.list.ORIG
  36. cat >/etc/apt/sources.list <<EOF
  37. deb http://tw.archive.ubuntu.com/ubuntu jaunty main
  38. deb http://tw.archive.ubuntu.com/ubuntu/ jaunty-updates main
  39. deb http://tw.archive.ubuntu.com/ubuntu/ jaunty universe
  40. deb http://tw.archive.ubuntu.com/ubuntu/ jaunty-updates universe
  41. EOF
  42. # choose your locale
  43. locale-gen en_GB.UTF-8
  44. # make sure apt database is up-to-date
  45. apt-get update
  46. apt-get install dialog
  47. dpkg-reconfigure locales
  48. # install editor, browser and programs necessary for building
  49. apt-get install --no-install-recommends jove
  50. apt-get install lynx-cur sudo wget
  51. apt-get install python-gd gawk gforth flex bison m4
  52. apt-get install netpbm qt4-qmake libqt4-dev
  53. apt-get install python-serial sqlite3 php5-cli python-dev
  54. # enable bash in the dialog box
  55. # (or find and fix the shell scripts that fail when run under
  56. # dash [some part of one of the Makefiles])
  57. dpkg-reconfigure dash
  58. # done with the chroot
  59. exit
  60. 5. create a little script to use schroot
  61. ----------------------------------------
  62. cat <<EOF >m
  63. #!/bin/sh
  64. schroot -c jaunty_i386 -- make "\$@"
  65. EOF
  66. chmod +x m
  67. 6. build the system
  68. -------------------
  69. cp samo-lib/include/config.h-default samo-lib/include/config.h
  70. # uncomment the correct hardware version in config.h
  71. ${EDITOR} samo-lib/include/config.h
  72. ./m