[personal profile] codedot
After `sbuild' and `debootstrap' packages and their dependencies, including schroot(1) software, had been installed, schroot(1) environment was prepared using the steps described below.

1 Adding the following configuration to /etc/schroot/schroot.conf:
[lenny]
type=directory
description=Debian Lenny (stable)
priority=1
root-groups=sbuild
location=/srv/chroot/lenny
aliases=stable,default
2 Running the following command to create the environment for schroot(1) which can be also used with sbuild(1):
sudo debootstrap --include=fakeroot --variant=buildd lenny /srv/chroot/lenny
3 Appending the file /srv/chroot/lenny/etc/apt/sources.list with the following line allowing sbuild(1) to retrieve the source packages from the local Debian repository inside schroot(1) environment, and build them:
deb-src http://localhost/debian codedot main
4 Adding the current user $username to `sbuild' group, e.g. using `sudo usermod -a -G sbuild $username' command.

5 Creating sbuild(1) configuration as follows:
$distribution = "lenny";
$chroot = "lenny";
$sbuild_mode = "user";
$log_dir = "logs";
$stats_dir = "stats";
1;
After the above steps have been done, the user (if re-logged in the system to get included into the `sbuild' group) is able to enter schroot(1) session just typing `schroot' command. /proc filesystem and home directory will be automatically mounted by schroot(1) into the guest system from the host one.

debootstrap(8) used above is also useful to install Debian userspace for those targets where Debian installers are hard to start for some reasons.

Finally, the schroot(1) environment created similarly to the above is a good way to build Debian packages using sbuild(1) to check dependency correctness. To build a source package that is available in the local repository (`schroot -u root apt-get update' is recommended before this step), the command `sbuild $package_$version' can easily be issued. It will then build the package and save the build logs and the resulting binary packages in the current directory.

Profile

Anton Salikhmetov

November 2018

S M T W T F S
    123
45678 910
11121314151617
18192021222324
252627282930 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 16th, 2025 08:18 am
Powered by Dreamwidth Studios