Title: Setup dboostrap and schroot Subject: Better than vmware. Build 32bit env on 64bit platform. I am specificly setting up a 32bit ubuntu on 64bit gentoo or ubuntu #------------------------------------------------------------------------------- # Dbootstrap #------------------------------------------------------------------------------- export CHROOT="/home/srv/chroot/12.04LTS_i386" # https://help.ubuntu.com/community/DebootstrapChroot #Step 1: Install packages on the host computer. # Ubuntu: aptitude install \ debootstrap \ schroot # Gentoo: emerge \ debootstrap \ schroot #Step 2: Create a configuration file for schroot. cat >> /etc/schroot/chroot.d/ubuntu_1204LTS_i386.conf < ${CHROOT}/etc/apt/sources.list <<'PUTUS' deb http://archive.ubuntu.com/ubuntu precise main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu precise main main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu precise-backports main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu precise-backports main restricted universe multiverse PUTUS # Step 5: schroot into the shell do { schroot -c 1204LTS_i386 } or { # Get into chroot export CHROOT="/home/srv/chroot/12.04LTS_i386" mount -o bind /dev/ ${CHROOT}/dev mount none ${CHROOT}/dev/pts -t devpts mount none ${CHROOT}/proc -t proc mount none ${CHROOT}/sys -t sysfs # mount -l # /dev on /home/srv/chroot/12.04LTS_i386/dev type none (rw,bind) # none on /home/srv/chroot/12.04LTS_i386/dev/pts type devpts (rw) # none on /home/srv/chroot/12.04LTS_i386/proc type proc (rw) # none on /home/srv/chroot/12.04LTS_i386/sys type sysfs (rw) # enter chroot chroot ${CHROOT} /bin/bash } Test: # Check arch type uname -a Linux buildlnx1 3.2.0-33-generic #52-Ubuntu SMP Thu Oct 18 16:29:15 UTC 2012 i686 athlon i386 GNU/Linux # Step 6: Update packages nstall updates apt-get update apt-get dist-upgrade WARNING instlaling packages: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), FIX: # set time zone apt-get install language-pack-id language-pack-en dpkg-reconfigure tzdata # US/Pacific locale-gen en_US.UTF-8 dpkg-reconfigure locales # Step 7: Install helpful programs apt-get install \ aptitude \ file \ vim \ git \ subversion \ fuser \ locate # Step 8: Setup user (this is for an autobuild system) adduser build # pass: pass_for_good # Add to sudo group adduser build sudo # install low latency kernel apt-get install linux-lowlatency-pae # hit enter to select no device to install grub into # Continue without installing GRUB? y # Step 9: Tweek environment fariables # Tell make to use all CPU cores cat >> /home/build/.bashrc <<'EOF' export MAKEFLAGS=-j9 EOF cat >> /root/.bashrc <<'EOF' export MAKEFLAGS=-j9 EOF . /root/.bashrc echo $MAKEFLAGS # Step 10: Build qt cd /opt/ tar -xzvpf qt-everywhere-commercial-src-4.8.1.tar.gz cd qt-everywhere-commercial-src-4.8.1 make confclean time ./configure \ -release \ -static \ -prefix /opt/qt \ -no-qt3support \ -commercial \ -confirm-license \ -no-qt3support \ -qt-libjpeg NOTE: If the schroot is correct, you should not need these configure options -arch i386 \ -platform linux-g++-32 ERROR: Basic XLib functionality test failed! You might need to modify the include and library search paths by editing QMAKE_INCDIR_X11 and QMAKE_LIBDIR_X11 in /opt/qt-everywhere-commercial-src-4.8.1/mkspecs/linux-g++-32. FIX: aptitude install libx11-dev libfreetype6-dev libXrender-dev libfontconfig-dev libXext-dev gcc-multilib time ./configure \ -release \ -static \ -prefix /opt/qt \ -no-qt3support \ -commercial \ -confirm-license \ -no-qt3support \ -qt-libjpeg \ -arch i386 \ -platform linux-g++-32 time make -k sub-src 2>&1 | tee make_sub-src_32bit.txt # new build requirement aptitude install \ libssh2-1-dev \ libpcap-dev \ pcaputils \ # Step 11: Test build script su - build ./bin/buildbot_myprogram.bash # this was not needed aptitude install libgnutls-dev # this was needed aptitude install libssl-dev # Step 12: Setup build-slave aptitude install buildbot-slave The following NEW packages will be installed: buildbot-slave python-twisted-words{a} 0 packages upgraded, 2 newly installed, 0 to remove and 99 not upgraded. Need to get 308 kB of archives. After unpacking 1,660 kB will be used. Do you want to continue? [Y/n/?] y Get: 1 http://us.archive.ubuntu.com/ubuntu/ precise/main python-twisted-words all 11.1.0-1 [215 kB] Get: 2 http://us.archive.ubuntu.com/ubuntu/ precise/universe buildbot-slave all 0.8.5-2 [92.5 kB] Fetched 308 kB in 0s (434 kB/s) Selecting previously unselected package python-twisted-words. (Reading database ... 206663 files and directories currently installed.) Unpacking python-twisted-words (from .../python-twisted-words_11.1.0-1_all.deb) ... Selecting previously unselected package buildbot-slave. Unpacking buildbot-slave (from .../buildbot-slave_0.8.5-2_all.deb) ... Processing triggers for man-db ... Processing triggers for ureadahead ... Setting up python-twisted-words (11.1.0-1) ... Setting up buildbot-slave (0.8.5-2) ... Creating Buildbot system user ... vi /etc/default/buildslave cat >> /etc/default/buildslave <<'EOF' SLAVE_ENABLED[1]=1 # 1-enabled, 0-disabled SLAVE_NAME[1]="buildlnx1.my.domain.com" # short name printed on start/stop SLAVE_USER[1]="build" # user to run slave as SLAVE_BASEDIR[1]="/home/build/MyProgram_linux" # basedir to slave (absolute path) SLAVE_OPTIONS[1]="" # buildbot options SLAVE_PREFIXCMD[1]="" # prefix command, i.e. nice, linux32, dchroot su - build buildslave create-slave /home/build/MyProgram_linux buidlnx1.my.domain.com:9989 buildlnx1.my.domain.com 'pass_for_good' mkdir /home/build/MyProgram_linux chdir /home/build/MyProgram_linux mkdir /home/build/MyProgram_linux/info Creating info/admin, you need to edit it appropriately Creating info/host, you need to edit it appropriately Not creating info/access_uri - add it if you wish Please edit the files in /home/build/MyProgram_linux/info appropriately. buildslave configured in /home/build/MyProgram_linux echo 'John Stile ' > /home/build/MyProgram_linux/info/admin echo 'buildlnx1: 32bin and 64bit Linux buildslave Host' > /home/build/MyProgram_linux/info/host exit