Difference between pages "Install/fr/Configuring" and "Virtual Packages"

< Install‎ | fr(Difference between pages)
(Created page with "<noinclude> {{InstallPart|configuration du système Funtoo Linux}} </noinclude> === Configuration du système === Comme toutes les distributions Linux, Funtoo Linux possède...")
 
(two first cases for virtuals)
 
Line 1: Line 1:
<noinclude>
+
Virtual packages are special packages that correspond to a feature that can be satisfied by one or more package(s). This Wiki page aims to describe when and how to use them correctly, and what are their implications.
{{InstallPart|configuration du système Funtoo Linux}}
+
</noinclude>
+
=== Configuration du système ===
+
  
Comme toutes les distributions Linux, Funtoo Linux possède son lot de fichiers de configuration. Un fichier qui ne doit en aucun cas échapper à votre attention est <code>/etc/fstab</code>. À défaut de le configurer correctement, Funtoo Linux refusera de démarrer.
+
== Virtual packages, metapackages and package sets ==
 +
Virtual packages, metapackages and package sets are similar concepts. However, they have a few important differences that make them fit for different use cases.
  
==== L'éditeur nano ====
+
Virtual packages and metapackages are regular Funtoo packages (ebuilds) that install no files. Instead, they cause other packages to be installed by specifying them in their runtime dependencies. They can both be used in any context valid for regular packages. They can have multiple versions, slots and USE flags. They have to be located in an active repository, and once there they can be installed and uninstalled like regular packages.
  
L'éditeur de texte disponible dans l'environnement «chroot» se nomme <code>nano</code>. Pour éditer l'un des fichiers ci-dessous, vous le lancez ainsi:
+
Package sets are not packages but special atoms supported by Portage. Package sets can only specify other packages, either via a static list or dynamically (e.g. via running Python code that determines the package list). Package sets can't be versioned and don't have USE flags. Package sets can be used alongside packages in emerge commands and other package sets but they can't be referenced inside regular packages. Package sets can be installed into user's system, located in repositories or created by user in Portage configuration.
  
<console>
+
Virtual packages represent a commonly used feature that can be provided by multiple different providers. Virtuals provide a convenient way of specifying all possible alternatives without having to update multiple ebuilds.
(chroot) # ##i##nano -w /etc/fstab
+
</console>
+
  
{{Note|L'argument '''w''' prévient le retour à la ligne automatique. On le recommande lors de l'édition de fichiers de configuration. Cela évite la possible insertion de caractères étrangers générant une erreur à l'exécution du contenu.}}
+
Metapackages and package sets are used to represent lists of packages that user may want to install together. They provide a convenience for users, e.g. providing a shortcut to install all packages comprising a desktop environment.
+
Utilisez les touches fléchées pour vous déplacez dans l'éditeur. Les touches telles «backspace» et «delete» réagissent tel que prévu. Appuyez sur Ctrl+X pour sauvegarder le fichier en quittant l'éditeur.
+
  
==== Fichiers de configuration ====
+
== When virtual packages can be used? ==
 +
For virtual package ebuild to work correctly, the two following requirements must be met:
 +
# the virtual providers must be interchangeable at runtime with no consequences to the reverse dependencies. In other words, installing another provider and removing the currently used provider must not cause any breakage or require reverse dependencies to be rebuilt.
 +
# Reverse dependencies need to have consistent, predictable requirements for the alternatives. In other words, the packages must not require a very specific versions of the alternatives.
  
Voici une liste de fichiers de configuration à éditer pour modification selon vos besoins:
+
Virtuals can not be used if the underlying packages don't provide binary compatibility at least between predictable range of versions.
  
{{TableStart}}
+
== Common uses for virtual packages ==
<tr class="active"><th>Fichier</th>
+
=== System components and services ===
<th>Dois-je le modifier?</th>
+
Example: ''virtual/service-manager''
<th>Description</th>
+
</tr><tr  class="danger">
+
<td><code>/etc/fstab</code></td>
+
<td>'''Oui - requis'''</td>
+
<td>Instructions de montage de vos partitions lors du démarrage.</td>
+
</tr><tr>
+
<td><code>/etc/localtime</code></td>
+
<td>''Recommandé''</td>
+
<td>Votre fuseau horraire. Lien symbolique vers /usr/share/zoneinfo (i.e. /usr/share/zoneinfo/America/Toronto) </td>
+
</tr><tr>
+
<td><code>/etc/portage/make.conf</code></td>
+
<td>''Recommandé''</td>
+
<td>Paramètres utilisés par gcc (compilateur), portage, et make.</td>
+
</tr><tr>
+
<td><code>/etc/conf.d/hostname</code></td>
+
<td>''Recommandé''</td>
+
<td>Sert à affecter un nom à la machine.</td>
+
</tr><tr>
+
<td><code>/etc/conf.d/keymaps</code></td>
+
<td>Optionnel</td>
+
<td>Fichier de configuration pour le mappage du clavier. À modifier si votre clavier n'est pas US.</td>
+
</tr><tr>
+
<td><code>/etc/conf.d/hwclock</code></td>
+
<td>Optionnel</td>
+
<td>Fichier de configuration de l'horloge du système.</td>
+
</tr><tr>
+
<td><code>/etc/conf.d/modules</code></td>
+
<td>Optionnel</td>
+
<td>Modules du noyau à charger automatiquement au démarrage. Voir [[Additional Kernel Resources]] pour plus de détails.</td>
+
</tr><tr>
+
<td><code>/etc/conf.d/consolefont</code></td>
+
<td>Optionnel</td>
+
<td>Définition de la police d'affichage en console. Le service consolefont doit être actif. Démarrez-le ainsi: rc-update add consolefont.</td>
+
</tr><tr>
+
<td><code>profiles</code></td>
+
<td>Optionnel</td>
+
<td>Réglages pour Portage.</td>
+
</tr>
+
{{TableEnd}}
+
  
{{Warning|Éditez le fichier <code>etc/fstab</code> avant de redémarrer. Vous devez modifier le contenu des colonnes «fs» et «type» afin qu'il soit conforme aux partitions et aux systèmes de fichiers que vous avez créés avec <code>gdisk</code> ou <code>fdisk</code>. Vous pourriez être incapale de lancer Funtoo Linux en passant outre à cette étape.}}
+
One of the common uses for virtuals is to define abstract ''system services''. Those virtuals are not very specific on how those services are provided. They are mostly intended to be used in the @system package set, to ensure that the user system doesn't lack key components such as a service manager or a package manager.
  
==== /etc/fstab ====
+
The providers for this kind of virtuals do not have to meet any specific requirements except for having a particular function. In particular, there's no requirement for common configuration or provided executables. The user is responsible for ensuring that the installed implementation is set up and working.
  
<code>/etc/fstab</code> is used by the <code>mount</code> command which is ran when your system boots. Statements of this file inform <code>mount</code> about partitions to be mounted and how they are mounted. In order for the system to boot properly, you must edit <code>/etc/fstab</code> and ensure that it reflects the partition configuration you used earlier:
+
=== Tools provided by multiple packages ===
 +
Example: ''virtual/eject''
  
<console>
+
This kind of virtuals is used when multiple packages may provide tools with the same names. The virtual is used in packages that rely on those tools being present, in particular when the tools are used at build-time of the package or are called by package's scripts (executables).
(chroot) # ##i##nano -w /etc/fstab
+
</console>
+
  
<pre>
+
While the tools don't necessarily need to be fully compatible, they need to have a common basic usage. In particular, when a tool from one provider is replaced by a tool from another, the reverse dependencies must remain in working state, with no need for rebuilds or configuration adjustments.
# The root filesystem should have a pass number of either 0 or 1.
+
# All other filesystems should have a pass number of 0 or greater than 1.
+
#
+
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
+
#
+
# See the manpage fstab(5) for more information.
+
#
+
# <fs>     <mountpoint>  <type>  <opts>        <dump/pass>
+
 
+
/dev/sda1    /boot        ext2    noauto,noatime 1 2
+
/dev/sda2    none          swap    sw            0 0
+
/dev/sda3    /            ext4    noatime        0 1
+
#/dev/cdrom  /mnt/cdrom    auto    noauto,ro      0 0
+
</pre>
+
 
+
{{Note|Currently, our default <code>/etc/fstab</code> has the root filesystem as <code>/dev/sda4</code> and the swap partition as <code>/dev/sda3</code>. These will need to be changed to <code>/dev/sda3</code> and <code>/dev/sda2</code>, respectively.}}
+
 
+
{{Note|If you're using UEFI to boot, change the <code>/dev/sda1</code> line so it says <code>vfat</code> instead of <code>ext2</code>. Similarly, make sure that the <code>/dev/sda3</code> line specifies either <code>xfs</code> or <code>ext4</code>, depending on which filesystem you chose at filesystem-creation time.}}
+
 
+
==== /etc/localtime ====
+
 
+
<code>/etc/localtime</code> is used to specify the timezone that your machine is in, and defaults to UTC. If you would like your Funtoo Linux system to use local time, you should replace <code>/etc/localtime</code> with a symbolic link to the timezone that you wish to use.
+
 
+
<console>
+
(chroot) # ##i##ln -sf /usr/share/zoneinfo/MST7MDT /etc/localtime
+
</console>
+
 
+
The above sets the timezone to Mountain Standard Time (with daylight savings). Type <code>ls /usr/share/zoneinfo</code> to see what timezones are available. There are also sub-directories containing timezones described by location.
+
 
+
==== /etc/make.conf ====
+
 
+
MAKEOPTS can be used to define how many parallel compilations should occur when you compile a package, which can speed up compilation significantly. A rule of thumb is the number of CPUs (or CPU threads) in your system plus one. If for example you have a dual core processor without [[wikipedia:Hyper-threading|hyper-threading]], then you would set MAKEOPTS to 3:
+
 
+
<pre>
+
MAKEOPTS="-j3"
+
</pre>
+
 
+
If you are unsure about how many processors/threads you have then use nproc to help you.
+
<console>
+
(chroot) # ##i##nproc
+
16
+
</console>
+
 
+
Set MAKEOPTS to this number plus one:
+
 
+
<pre>
+
MAKEOPTS="-j17"
+
</pre>
+
 
+
USE flags define what functionality is enabled when packages are built. It is not recommended to add a lot of them during installation; you should wait until you have a working, bootable system before changing your USE flags. A USE flag prefixed with a minus ("<code>-</code>") sign tells Portage not to use the flag when compiling.  A Funtoo guide to USE flags will be available in the future. For now, you can find out more information about USE flags in the [http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=2&chap=2 Gentoo Handbook].
+
 
+
LINGUAS tells Portage which local language to compile the system and applications in (those who use LINGUAS variable like OpenOffice). It is not usually necessary to set this if you use English. If you want another language such as French (fr) or German (de), set LINGUAS appropriately:
+
 
+
<pre>
+
LINGUAS="fr"
+
</pre>
+
 
+
==== /etc/conf.d/hwclock ====
+
If you dual-boot with Windows, you'll need to edit this file and change the value of '''clock''' from '''UTC''' to '''local''', because Windows will set your hardware clock to local time every time you boot Windows. Otherwise you normally wouldn't need to edit this file.
+
<console>
+
(chroot) # ##i##nano -w /etc/conf.d/hwclock
+
</console>
+
 
+
==== Localization ====
+
 
+
By default, Funtoo Linux is configured with Unicode (UTF-8) enabled, and for the US English locale and keyboard. If you would like to configure your system to use a non-English locale or keyboard, see [[Funtoo Linux Localization]].
+

Revision as of 13:31, February 7, 2015

Virtual packages are special packages that correspond to a feature that can be satisfied by one or more package(s). This Wiki page aims to describe when and how to use them correctly, and what are their implications.

Virtual packages, metapackages and package sets

Virtual packages, metapackages and package sets are similar concepts. However, they have a few important differences that make them fit for different use cases.

Virtual packages and metapackages are regular Funtoo packages (ebuilds) that install no files. Instead, they cause other packages to be installed by specifying them in their runtime dependencies. They can both be used in any context valid for regular packages. They can have multiple versions, slots and USE flags. They have to be located in an active repository, and once there they can be installed and uninstalled like regular packages.

Package sets are not packages but special atoms supported by Portage. Package sets can only specify other packages, either via a static list or dynamically (e.g. via running Python code that determines the package list). Package sets can't be versioned and don't have USE flags. Package sets can be used alongside packages in emerge commands and other package sets but they can't be referenced inside regular packages. Package sets can be installed into user's system, located in repositories or created by user in Portage configuration.

Virtual packages represent a commonly used feature that can be provided by multiple different providers. Virtuals provide a convenient way of specifying all possible alternatives without having to update multiple ebuilds.

Metapackages and package sets are used to represent lists of packages that user may want to install together. They provide a convenience for users, e.g. providing a shortcut to install all packages comprising a desktop environment.

When virtual packages can be used?

For virtual package ebuild to work correctly, the two following requirements must be met:

  1. the virtual providers must be interchangeable at runtime with no consequences to the reverse dependencies. In other words, installing another provider and removing the currently used provider must not cause any breakage or require reverse dependencies to be rebuilt.
  2. Reverse dependencies need to have consistent, predictable requirements for the alternatives. In other words, the packages must not require a very specific versions of the alternatives.

Virtuals can not be used if the underlying packages don't provide binary compatibility at least between predictable range of versions.

Common uses for virtual packages

System components and services

Example: virtual/service-manager

One of the common uses for virtuals is to define abstract system services. Those virtuals are not very specific on how those services are provided. They are mostly intended to be used in the @system package set, to ensure that the user system doesn't lack key components such as a service manager or a package manager.

The providers for this kind of virtuals do not have to meet any specific requirements except for having a particular function. In particular, there's no requirement for common configuration or provided executables. The user is responsible for ensuring that the installed implementation is set up and working.

Tools provided by multiple packages

Example: virtual/eject

This kind of virtuals is used when multiple packages may provide tools with the same names. The virtual is used in packages that rely on those tools being present, in particular when the tools are used at build-time of the package or are called by package's scripts (executables).

While the tools don't necessarily need to be fully compatible, they need to have a common basic usage. In particular, when a tool from one provider is replaced by a tool from another, the reverse dependencies must remain in working state, with no need for rebuilds or configuration adjustments.