Projet

Général

Profil

GitPackagingSbuildBtrfs » Historique » Version 1

Daniel Dehennin, 10/01/2012 10:53
Configuration de sbuild avec btrfs

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