[Debian-au] Report on chroot discussion at the Sydney DebSIG on June 11th

David Creelman dave at geko.net.au
Sat Jun 28 03:51:25 UTC 2003


Hi All,

A couple of weeks ago (June 11th), the usual monthly Sydney DebSIG was
held at the Woolloomooloo bay Hotel. Usually this meeting is held in the
boardroom upstairs, but this month some swanky lawyer types, wearing
suits, pushed us out.

Undismayed, the meeting reconvened in the beer garden. Here, the tables
were rearranged for a round table discussion. Matt Hope then (unbeknown
to me) introduced me as someone who wanted to start a discussion on
chroot environments and how to use them in Debian to perform various
development tasks. There were a few tangents to the discussion which are
mentioned here, but not deeply explored.

Matt also mentioned in passing at the end of the discussion "You'll do a
report on all of that won't you ?"

If there are any errors in this report, feel free to post corrections on
debian-au to point me in the right direction.

* The Discussion

* Who am I, why did I want to talk about chroot ?

First off, I should probably introduce myself again and mention my
motivation for talking about chroot. I'm Dave Creelman and I've been
using Linux on and off for about 12 years now. I'm not a Debian
developer, but I've become interested in the Debian development model of
late. I'm an embedded developer working for Cochlear (we make bionic
ears). I wanted to know about chroot environments as they look like an
effective way of performing tests on whole subsystems of a Debian system
(in fact not only in Debian).

* What is chroot ?

Chroot (short for change root) is a system call within *NIX like systems
that reparents the root file system to a subdirectory within that file
system. This reparenting holds for any child processes of the process
that called chroot(Other processes running in the kernel continue
running with a normal root file system). Child processes of the chroot
process will be limited to a subset of the file system, sometimes called
the chroot jail. Most (all on *nix?) ftp servers use chroot to ensure
that visiting users can't move around and wreak havoc on a system.
Chroot can only be called by the root user, or by a process that has the
seteuid  bit set for root.

For a manpage, check http://www.die.net/doc/linux/man/man2/chroot.2.html

* Chroot and Debian

Debian has several utilities which use chroot to set up root jails for
testing and porting tasks. In the discussion, these tools were mentioned
:-

dchroot
This is a very basic utility that builds a very simple chroot. Other
utilities use it as a basis and build on top of it(like debbootstrap
above)

debbootstrap http://packages.debian.org/unstable/admin/debootstrap.html
(uses dchroot..)
Creates a simple root file system (usually in RAM) from the install
media and once a base file system is built, it does a chroot to change
over to the new root file system.

pbuilder http://packages.debian.org/unstable/admin/debootstrap.html
According to the manual
http://www.netfort.gr.jp/~dancer/software/pbuilder-doc/pbuilder-doc.html#aim, 'pbuilder aims to be an easy-to-setup system for auto-building Debian packages inside a clean-room environment'
It Builds a chroot environment to test packages in and then when it's
finished, packs up the environment into a .tar.gz file. The .tar.gz file
is good if you want to be able to reuse the chroot environment, but
there were some complaints that the unpack/repack takes a long time. 
There are command line flags to setup stable/unstable/testing
environments within the chroot.

sbuild


More information about the debian-au mailing list