GitPackagingSbuildBtrfs » Historique » Version 4
Daniel Dehennin, 10/05/2012 17:04
Utilisation d’un compte system pour l’usage de sudo
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 | 2 | Daniel Dehennin | h3. Adaptation de schroot pour @btrfs@ |
33 | 2 | Daniel Dehennin | |
34 | 1 | Daniel Dehennin | Nous devons ensuite adapter la configuration de @schroot@ à |
35 | 1 | Daniel Dehennin | l’utilisation des snapshot @btrfs@ : |
36 | 1 | Daniel Dehennin | |
37 | 1 | Daniel Dehennin | <pre> |
38 | 4 | Daniel Dehennin | system@build:~$ sudo mkdir -p /srv/chroot/snapshots |
39 | 4 | Daniel Dehennin | system@build:~$ sudo sed -i -e "s,type=directory,type=btrfs-snapshot,; /directory=/ d" \ |
40 | 3 | Daniel Dehennin | -e "/type=/ialiases=eole-2.3,eole-2.3-dev,eole-2.3-proposed,eole-2.3-security" \ |
41 | 1 | Daniel Dehennin | /etc/schroot/chroot.d/$dist-$arch-sbuild* |
42 | 1 | Daniel Dehennin | buildd@build:~$ sudo /bin/sh -c "cat >> `expr /etc/schroot/chroot.d/$dist-$arch-sbuild*` <<EOT |
43 | 1 | Daniel Dehennin | btrfs-source-subvolume=/srv/chroot/$dist-$arch-sbuild |
44 | 1 | Daniel Dehennin | btrfs-snapshot-directory=/srv/chroot/snapshots |
45 | 1 | Daniel Dehennin | EOT |
46 | 1 | Daniel Dehennin | " |
47 | 1 | Daniel Dehennin | </pre> |
48 | 1 | Daniel Dehennin | |
49 | 1 | Daniel Dehennin | {{include(eole:GitPackagingWebographie)}} |