Improve schroot documentation. Add code tags
[mirror/dsa-wiki.git] / input / doc / schroot.mdwn
1 using schroot in debian.org porterboxes
2 =======================================
3
4 When logging into Debian porterbox machine, it should display similar message:
5
6 <pre><code>
7 Welcome to porterbox.debian.org, the Debian arch porterbox.
8
9 See 'schroot -l' for a list of available chroots.  Start new sessions
10 with 'schroot --begin-session -c <chroot>', run commands in sessions using
11 'schroot --run-session -c <session> [-- command]', and tear down sessions
12 using 'schroot --end-session -c <session>'.  You can run a limited set of
13 privileged commands, for instance some of apt-get, using
14 'dd-schroot-cmd -c <session> <command>'.
15 Use 'schroot --list --all-sessions' or 'schroot-list-sessions [<userglob>]'
16 to list (your) open sessions.
17
18 This server is hosted at data centre.
19 </code></pre>
20
21 The previous description is rather compact and dense, so let's try to describe the usage in more friendly way.
22
23 * List available chroots:
24
25 <pre><code>
26         $ schroot -l
27 </code></pre>
28
29 * Begin a persistent schroot session on Debian unstable:
30
31 <pre><code>
32         $ schroot -b -c sid -n mysid
33 </code></pre>
34
35 * Update and upgrade Debian unstable chroot:
36
37 <pre><code>
38         $ dd-schroot-cmd -c mysid apt-get update
39         $ dd-schroot-cmd -c mysid apt-get upgrade
40         [..]
41         Do it for real [Y/n]: <Enter>
42         [..]
43 </code></pre>
44
45 * Install your broken package build dependencies:
46
47 <pre><code>
48         $ dd-schroot-cmd -c mysid apt-get build-dep gentoo
49         [..]
50         Do it for real [Y/n]: <Enter>
51         [..]
52 </code></pre>
53
54 * Change root to Debian unstable chroot:
55
56 <pre><code>
57         $ schroot -r -c mysid
58 </code></pre>
59
60 * Download your broken package source:
61
62 <pre><code>
63         (sid_arch-dchroot)user@porterbox:~$ apt-get source gentoo
64 </code></pre>
65
66 * You should be able to reproduce your issue, hack on the package, fix the bug. Once you are done with your work, please, finish your schroot session:
67
68 <pre><code>
69         (sid_arch-dchroot)user@porterbox:~$ exit
70         $ schroot -e -c mysid
71         $ exit
72 </code></pre>
73
74 * You should be done by now. If you find any issue, please report to debian-admin@lists.debian.org.