Projet

Général

Profil

GitPackagingSbuildLVM » Historique » Version 10

Daniel Dehennin, 11/05/2012 10:35
Décortique les adaptations de schroot

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