Creating Debian/Ubuntu build chroots

To create a new chroot, you usually use debootstrap:

apt-get install debootstrap

A new chroot for a given Ubuntu installation can be created with e.g

sudo debootstrap --variant=buildd --arch=amd64 raring ./13.04_amd64

In case debootstrap complains about a missing script, download the current version and run that executable directly $> sudo /home/USER/debootstrap-1.0.53/debootstrap --foreign --variant=buildd --arch=amd64 saucy ./13.10_amd64 in newer versions of debootstrap you have to run the second stage maually $> sudo /home/USER/debootstrap-1.0.53/debootstrap --second-stage

It is highly recommended to manage the chroots using schroot. See the general build server setup page for information on how to set it up.

RECOMMENDED: You can also use debootstrap on a nother system (first stage), copy the result to the target system (build server)

Finally, one can log in on the chroot and finish the setup:

schroot -c 13.04_amd64 -u root
# Make sure you don't run any services in the chroot
echo "exit 101" > /usr/sbin/policy-rc.d
chmod +x /usr/sbin/policy-rc.d
# For unbuntu users
apt-get install ubuntu-minimal
# Core utilities required by jenkins
apt-get install lsb-release default-jre wget ruby ruby-dev

Rock packages may depend on non-main packages, so you need to make sure that these are included in your sources. On Debian, /etc/apt/sources.list should read like something around the lines of

deb testing main contrib non-free

On Ubuntu, it should look like

deb precise main universe multiverse

When the chroot is Debian and the host not, it happens that the 'staff' and 'crontab' groups do not exist in the chroot (you get an error when installing some packages). Creating the group in the chroot is of no use as schroot copies this file each time you log in. Either add the group to the host, or disable copying

Install jenkins by following the instructions on this page

Sanity checks

# Verify that the locales work fine. 
LANG=en_US.UTF-8 perl
# If the above line generates warnings, do
apt-get install locales
# Select en_US.UTF-8 in the dialog shown below
locale-gen en_US.UTF-8

Finally make sure that sudo is installed and that the 'jenkins' user is setup to run without password.


cross-chroots: qemu-user-static+schroot

See and use the attached script.

Last modified 7 years ago Last modified on 06/13/14 14:47:31

Attachments (1)

Download all attachments as: .zip