Projet

Général

Profil

GitPackagingSbuildBtrfs » Historique » Version 6

Daniel Dehennin, 11/05/2012 10:34
Correction intitulé

1 1 Daniel Dehennin
{{include(eole:GitPackagingSbuildCommon)}}
2 1 Daniel Dehennin
3 2 Daniel Dehennin
h3. Un volume logique pour tous les chroots
4 1 Daniel Dehennin
5 1 Daniel Dehennin
Ce volume contiendra les chroots des différents systèmes pour lesquels
6 1 Daniel Dehennin
vous ferez des compilation.
7 1 Daniel Dehennin
8 1 Daniel Dehennin
Un snapshot sera créé avant chaque build et détruit après, cela permet
9 1 Daniel Dehennin
de gagner le temps du debootstrap.
10 1 Daniel Dehennin
11 1 Daniel Dehennin
<pre>
12 4 Daniel Dehennin
system@build:~$ sudo apt-get install btrfs-tools
13 4 Daniel Dehennin
system@build:~$ sudo lvcreate -L20g -n schroot ${YOUR_VG}
14 4 Daniel Dehennin
system@build:~$ sudo mkfs.btrfs -L schroot -m0 /dev/${YOUR_VG}/schroot
15 4 Daniel Dehennin
system@build:~$ sudo mkdir -p /srv/chroot
16 4 Daniel Dehennin
system@build:~$ sudo /bin/sh -c "echo /dev/${YOUR_VG}/schroot /srv/chroot btrfs rw,noatime 0 3 >> /etc/fstab"
17 4 Daniel Dehennin
system@build:~$ sudo mount /srv/chroot
18 1 Daniel Dehennin
</pre>
19 1 Daniel Dehennin
20 2 Daniel Dehennin
h3. Création d’un sous volume par chroot
21 1 Daniel Dehennin
22 1 Daniel Dehennin
Il est nécessaire de mettre en place un sous volume par distribution/architecture
23 1 Daniel Dehennin
24 1 Daniel Dehennin
<pre>
25 4 Daniel Dehennin
system@buildd:~$ sudo btrfs subvolume create /srv/chroot/${dist}-${arch}-sbuild
26 1 Daniel Dehennin
</pre>
27 1 Daniel Dehennin
28 2 Daniel Dehennin
h3. Installation du système de base
29 1 Daniel Dehennin
30 2 Daniel Dehennin
{{include(eole:GitPackagingCreateSchroot)}}
31 2 Daniel Dehennin
32 6 Daniel Dehennin
h3. Adaptation post-installation
33 2 Daniel Dehennin
34 1 Daniel Dehennin
Nous devons ensuite adapter la configuration de @schroot@ à
35 5 Daniel Dehennin
l’utilisation des snapshot @btrfs@.
36 1 Daniel Dehennin
37 5 Daniel Dehennin
h4. Création du répertoires contenant les points de montages temporaires
38 5 Daniel Dehennin
39 4 Daniel Dehennin
<pre>
40 1 Daniel Dehennin
system@build:~$ sudo mkdir -p /srv/chroot/snapshots
41 5 Daniel Dehennin
</pre>
42 5 Daniel Dehennin
43 5 Daniel Dehennin
h4. Changement du type de schroot
44 5 Daniel Dehennin
45 5 Daniel Dehennin
<pre>
46 1 Daniel Dehennin
system@build:~$ sudo sed -i -e "s,type=directory,type=btrfs-snapshot,; /directory=/ d" \
47 1 Daniel Dehennin
    /etc/schroot/chroot.d/$dist-$arch-sbuild*
48 5 Daniel Dehennin
</pre>
49 5 Daniel Dehennin
50 5 Daniel Dehennin
h4. Paramétrage spécifique Btrfs
51 5 Daniel Dehennin
52 5 Daniel Dehennin
<pre>
53 1 Daniel Dehennin
buildd@build:~$ sudo /bin/sh -c "cat >> `expr /etc/schroot/chroot.d/$dist-$arch-sbuild*` <<EOT
54 1 Daniel Dehennin
btrfs-source-subvolume=/srv/chroot/$dist-$arch-sbuild
55 1 Daniel Dehennin
btrfs-snapshot-directory=/srv/chroot/snapshots
56 1 Daniel Dehennin
EOT
57 1 Daniel Dehennin
"
58 1 Daniel Dehennin
</pre>
59 5 Daniel Dehennin
60 5 Daniel Dehennin
h4. Gestion des alias
61 5 Daniel Dehennin
62 5 Daniel Dehennin
{{include(eole:GitPackagingSbuildAliases)}}
63 1 Daniel Dehennin
64 1 Daniel Dehennin
{{include(eole:GitPackagingWebographie)}}