Projet

Général

Profil

GitPackagingSbuildLVM » Historique » Version 12

Daniel Dehennin, 29/10/2013 14:42

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 12 Daniel Dehennin
h4. Démontage du système de fichier
26 12 Daniel Dehennin
27 12 Daniel Dehennin
<pre>
28 12 Daniel Dehennin
system@build:~$ sudo umount /srv/chroot/${dist}-${arch}-sbuild
29 12 Daniel Dehennin
</pre>
30 12 Daniel Dehennin
31 3 Daniel Dehennin
h3. Adaptation post-installation
32 3 Daniel Dehennin
33 2 Daniel Dehennin
Nous devons adapter la configuration de @schroot@ à l’utilisation des
34 10 Daniel Dehennin
snapshot @LVM@ une fois le système installé.
35 1 Daniel Dehennin
36 10 Daniel Dehennin
h4. Changement du type de schroot
37 10 Daniel Dehennin
38 2 Daniel Dehennin
<pre>
39 5 Daniel Dehennin
system@build:~$ sudo sed -i -e "s,type=directory,type=lvm-snapshot," \
40 2 Daniel Dehennin
    -e "/directory=/d" \
41 1 Daniel Dehennin
    /etc/schroot/chroot.d/$dist-$arch-sbuild*
42 10 Daniel Dehennin
</pre>
43 10 Daniel Dehennin
44 10 Daniel Dehennin
h4. Paramétrage spécifique LVM
45 10 Daniel Dehennin
46 10 Daniel Dehennin
<pre>
47 2 Daniel Dehennin
buildd@build:~$ sudo /bin/sh -c "cat >> `expr /etc/schroot/chroot.d/$dist-$arch-sbuild*` <<EOT
48 2 Daniel Dehennin
lvm-snapshot-options=--size 2G
49 2 Daniel Dehennin
mount-options=-o noatime
50 2 Daniel Dehennin
device=/dev/${YOUR_VG}/$dist-$arch-sbuild
51 2 Daniel Dehennin
source-groups=root,sbuild
52 2 Daniel Dehennin
source-root-groups=root,sbuild
53 2 Daniel Dehennin
EOT
54 2 Daniel Dehennin
"
55 2 Daniel Dehennin
</pre>
56 1 Daniel Dehennin
57 9 Daniel Dehennin
{{include(eole:GitPackagingSbuildAliases)}}
58 7 Daniel Dehennin
59 2 Daniel Dehennin
{{include(eole:GitPackagingWebographie)}}