Projet

Général

Profil

GitPackagingSbuildLVM » Historique » Version 2

Daniel Dehennin, 10/01/2012 10:52
Configuration de sbuild avec les volumes LVM

1 1 Daniel Dehennin
{{include(eole:GitPackagingSbuildCommon)}}
2 2 Daniel Dehennin
3 2 Daniel Dehennin
h3. Utilisation de LVM
4 2 Daniel Dehennin
5 2 Daniel Dehennin
h4. Avant l’installation du chroot: création d’un volume logique
6 2 Daniel Dehennin
7 2 Daniel Dehennin
Dans le modèle @LVM@ chaque chroot est installé sur un volume logique
8 2 Daniel Dehennin
dédié.
9 2 Daniel Dehennin
10 2 Daniel Dehennin
La taille de ce volume doit pouvoir contenir :
11 2 Daniel Dehennin
12 2 Daniel Dehennin
* Un système minimal ;
13 2 Daniel Dehennin
14 2 Daniel Dehennin
* L’intégralité des dépendances pour la compilation d’un paquet.
15 2 Daniel Dehennin
16 2 Daniel Dehennin
<pre>
17 2 Daniel Dehennin
buildd@build:~$ sudo lvcreate -L2g -n ${dist}-${arch}-sbuild ${YOUR_VG}
18 2 Daniel Dehennin
buildd@build:~$ sudo mkfs.ext4 -m0 -L ${dist}-${arch}-sbuild /dev/${YOUR_VG}/${dist}-${arch}-sbuild
19 2 Daniel Dehennin
buildd@build:~$ sudo mkdir /srv/chroot/${dist}-${arch}-sbuild
20 2 Daniel Dehennin
buildd@build:~$ sudo mount /dev/${YOUR_VG}/${dist}-${arch}-sbuild /srv/chroot/${dist}-${arch}-sbuild
21 2 Daniel Dehennin
</pre>
22 2 Daniel Dehennin
23 2 Daniel Dehennin
h4. Adaptation post-installation
24 2 Daniel Dehennin
25 2 Daniel Dehennin
Nous devons adapter la configuration de @schroot@ à l’utilisation des
26 2 Daniel Dehennin
snapshot @LVM@ une fois le système installé :
27 2 Daniel Dehennin
28 2 Daniel Dehennin
<pre>
29 2 Daniel Dehennin
buildd@build:~$ sudo sed -i -e "s,type=directory,type=lvm-snapshot," \
30 2 Daniel Dehennin
    -e "/directory=/d" \
31 2 Daniel Dehennin
    -e "/type=/ialiases=eole2.3,eole2.3-dev,eole-2.3-proposed,eole-2.3-security" \
32 2 Daniel Dehennin
    /etc/schroot/chroot.d/$dist-$arch-sbuild*
33 2 Daniel Dehennin
buildd@build:~$ sudo /bin/sh -c "cat >> `expr /etc/schroot/chroot.d/$dist-$arch-sbuild*` <<EOT
34 2 Daniel Dehennin
lvm-snapshot-options=--size 2G
35 2 Daniel Dehennin
mount-options=-o noatime
36 2 Daniel Dehennin
device=/dev/${YOUR_VG}/$dist-$arch-sbuild
37 2 Daniel Dehennin
source-groups=root,sbuild
38 2 Daniel Dehennin
source-root-groups=root,sbuild
39 2 Daniel Dehennin
EOT
40 2 Daniel Dehennin
"
41 2 Daniel Dehennin
</pre>
42 2 Daniel Dehennin
43 2 Daniel Dehennin
h3. Installation du système de base
44 2 Daniel Dehennin
45 2 Daniel Dehennin
{{include(eole:GitPackagingCreateSchroot)}}
46 2 Daniel Dehennin
47 2 Daniel Dehennin
{{include(eole:GitPackagingWebographie)}}