Difference between pages "Install/pt-br/Configuring" and "Repository Configuration"

From Funtoo
< Install(Difference between pages)
Jump to navigation Jump to search
 
 
Line 1: Line 1:
=== Configurando seu sistema ===
{{Warning|This article is a work-in-progress referring to a future Portage version. It does not apply to the current Funtoo Portage version. Please do not update your configuration yet.}}
Como é esperado de uma distribuição Linux, Funtoo Linux tem seu compartilhamento de arquivos de configuração. O arquivo que absolutamente requer que você edite de forma a assegurar que o Funtoo Linux inicialize com sucesso é <code>/etc/fstab</code>. Os outros são opcionais.  


==== Utilizando o Nano ====
Starting with Portage-2.3.8, a switch to a new repository configuration framework is complete and users may want to update their configuration files. This document aims to describe the goals for the new framework and how to use it.


O editor padrão incluso no ambiente chroot é chamado de <code>nano</code>. Para editar um dos arquivos abaixo, chame o nano como a seguir:
== Multiple repository layout ==
One of the most important changes is the switch from the old ''overlay'' layout to a new cleaner ''repository'' system. The new layout is more flexible and more predictable. For example, repositories can now use resources (eclasses, for example) provided by other repositories.


<console>
The old layout was based on the concept of one ''main tree'' and optionally a number of overlays. The main tree provided base system ebuilds, eclasses, profiles, while overlays mostly were able to provide their own ebuilds. The ebuild provided by overlays overrode the ebuilds in main tree to the extend of making it impossible to install the main tree version. Overlays could also provide eclasses for their own ebuilds and package.* entries that applied to all overlays and to the main tree. The Package Manager is responsible for updating the main tree, while overlays are managed externally.
(chroot) # ##i##nano /etc/fstab
</console>


Quando estiver no editor, você pode utilizar as teclas de cetas para mover o cursor, e teclas comuns como backspace e delete funcionarão como esperado. Para salvar o arquivo, pressione Control-X, e responda <code>y</code> quando solicitado para salvar o buffer modificado se você gostaria de salvar suas alterações.
The new layout is based on the concept of one or more configurable repositories. Each repository can either be stand-alone or depend upon other repositories. The distribution provides a repository called ''funtoo'' (a drop-in replacement for Gentoo's ''gentoo'' repository). Users can install more repositories at they will, the repositories providing their own ebuilds, eclasses and profiles as necessary and/or using them from other repositories. Users can explicitly choose the repository they want to install packages from. The Package Manager can update all repositories.


==== Configuration Files ====
== Portage configuration ==
=== New repository layout ===
The repository configuration should be stored in <code>/etc/portage/repos.conf</code>. It can be either a single file or a directory containing one or more ''.conf'' files.


Aqui estão uma lista completa de arquivos que você pode queres editar, dependendo de suas necessidades:
The default configuration is installed as <code>/usr/share/portage/config/repos.conf</code>. This file is internal configuration file installed with portage ebuild and should '''not''' be modified. Instead, the configuration in <code>/etc/portage/repos.conf</code> can override the defaults specified there.
{{TableStart}}
<tr class="active"><th>Arquivo</th>
<th>Preciso alter-á-lo?</th>
<th>Descrição</th>
</tr><tr  class="danger">
<td><code>/etc/fstab</code></td>
<td>'''SIM - exigido'''</td>
<td>Pontos de montagem para todos os filesystems a serem utilizados no momento do boot. Esse arquivo deve refletir sua configuação de partição de disco. Vamos lhe guiar através da modificação desse arquivo abaixo.</td>
</tr><tr>
<td><code>/etc/localtime</code></td>
<td>''Talvez - recomendável''</td>
<td>Seu fuso horário (timezone), que será padrão ao UTC se não definido. Esse deve ser um link simbólico para algo localizado sob /usr/share/zoneinfo (ex. /usr/share/zoneinfo/America/Montreal) </td>
</tr><tr>
<td><code>/etc/make.conf</code> (symlink) - also known as:<br/><code>/etc/portage/make.conf</code></td>
<td>''Talvêz - recomendado''</td>
<td>Parâmetros utilizado pelo gcc (compilador), pelo portage, e pelo make. É uma boa ideia definir o MAKEOPTS. Isso é coberto mais para frente nessa documentação.</td>
</tr><tr>
<td><code>/etc/conf.d/hostname</code></td>
<td>''Talvez - recomendado''</td>
<td>Utilizado para definir o hostname do sistema. Defina a variável <code>hostname</code> como nome fully-qualified (com pontos, ex. <code>foo.funtoo.org</code>) se você tiver um. Caso contrário, defina para o hostname do sistema local (sem pontos, ex. <code>foo</code>). Padrões para <code>localhost</code> se não definido.</td>
</tr><tr>
<td><code>/etc/hosts</code></td>
<td>''Não''</td>
<td> Você não precisa mais definir manual o hostname nesse arquivo. Esse arquivo é gerado manualmente pelo <code>/etc/init.d/hostname</code>.</td>
</tr><tr>
<td><code>/etc/conf.d/keymaps</code></td>
<td>Opcional</td>
<td>Arquivo de configuração de mapeamento do teclado (fara console pseudo terminais). Configure se você não possui um teclado no padrão americano (non-US). Veja [[Funtoo Linux Localization]].</td>
</tr><tr>
<td><code>/etc/conf.d/hwclock</code></td>
<td>Opcional</td>
<td>Como o tempo de clock do hardware mantido pela bateria (battery-backed) do sistema é interpretado [UTC ou hora local (local time)]. Linux utiliza o clock do hardware mantido pela bateria para inicializar a hora do sistema quando o sistema é inicializado.</td>
</tr><tr>
<td><code>/etc/conf.d/modules</code></td>
<td>Opcional</td>
<td>Módulos do Kernel para carregar automaticamente na inicialização do sistema. Tipicamente não exigido. Veja [[Additional Kernel Resources]] para mais informações.</td>
</tr><tr>
<td><code>/etc/conf.d/consolefont</code></td>
<td>Opcional</td>
<td>Lhe permite especificar a font padrão do console. Para aplicar essa font, habilite o serviço consolefont ao executar rc-update add consolefont.</td>
</tr><tr>
<td><code>profiles</code></td>
<td>Opcional</td>
<td>Algumas configurações úteis para o portage que podem ajudar a acelerar a configuração inicial.</td>
</tr>
{{TableEnd}}


Se você estiver instalando uma versão em Inglês do Funtoo Linux, você está com sorte desde que muitos dos arquivos de configuração pode ser utilizadas como é. Se estiver instalando para outra localidade, não se preocupe. Vamos lhe orientar através dos passos para a configuração necessária na página [[Funtoo Linux Localization]], e se necessário, sempre há muito suporte amigável e útil. (Veja [[#Community portal|Community]])
The configuration uses format similar to Windows .ini files. Each section heading (repository name in square brackets) signifies a single repository, followed by one or more key-value option pairs. For example, the following file copies default configuration for Funtoo repository:


Vamos seguir em frente e ver o que temos que fazer. Utilize <code>nano -w <name_of_file></code> para editar os arquivos -- o "<code>-w</code>" desabilita empacotamento de palavras (word-wrapping), que útil quando editar arquivos de configurações. Você pode copiar e colar a partir dos exemplos.
{{file|name=/etc/portage/repos.conf/funtoo.conf|desc=Example configuration override for Funtoo repository to move it to non-standard location|body=
[funtoo]
# moved to non-standard location!
location = /var/db/repos/funtoo
sync-type = git
sync-uri = git://github.com/funtoo/ports-2015.git
auto-sync = yes
}}


{{fancywarning|É importante editar seu arquivo <code>/etc/fstab</code> antes de você reinicializar! Você precisará modificar ambas as colunas  "fs" e "type" para equiparar as configurações para as suas partições e filesystems que você criou com o <code>gdisk</code> ou <code>fdisk</code>. Pulando esses podem impedir que o Funtoo Linux de inicializar com sucesso.}}
The most useful repository configuration options are listed below:
;location: ''Obligatory.'' Specifies the directory where repository is/will be stored. If Portage knows how to sync the repository and the location does not exist, it will be created on next ''emerge --sync''. Otherwise, the directory must exist.
;priority: Specifies the priority used for ordering ebuilds from different repositories. If two repositories provide an ebuild with matching versions, the repository with higher priority will be used.
;auto-sync: Specifies whether ''emerge --sync'' should update the repository. Defaults to ''yes'' if ''sync-type'' is specified, ''no'' otherwise.
;sync-depth: Specifies ''--depth'' for git clone. Used only on initial sync. Defaults to 1. Can be set to 0 to force full clone (not pass ''--depth'' at all).
;sync-type: Specifies syncing/update method. Can be one of: ''cvs'', ''git'', ''rsync'', ''svn''.
;sync-umask: Specifies the umask used when updating/syncing the repository.
;sync-uri: Specifies remote URI from which the repository will be cloned/synced. Can use any syntax valid for a particular syncing method.
;sync-user: Specifies the user[:group] used to update/sync the repository. If ''FEATURES=usersync'' is used, defaults to the credentials of directory owner.


==== /etc/fstab ====
Additionally a <code>[DEFAULT]</code> section may be specified. Options in this section are used as defaults for all repositories.


<code>/etc/fstab</code> é utilizado pelo comando <code>mount</code> que é executado quando seu sistema inicializa. Afirmações desse arquivo informam <code>mount</code> a respeito das partições a serem montadas e como elas são montadas. No intuito que o sistema inicialize devidamente, você deve editar <code>/etc/fstab</code> e assegurar de que isso reflita a configuração de partições que você utilizou anteriormente:
=== Migrating existing configurations ===
The new configuration format provides replacement for existing configuration done through <code>/etc/portage/make.conf</code> and environment variables. While the variables are still supported for backwards compatibility, users are recommended to move to the new configuration scheme. Funtoo portage ebuild is planned to  make the migration unattended (repos.conf installed automatically to ease the config steps) with the following file:
{{file|name=/etc/portage/repos.conf/funtoo.conf|body=
[funtoo]
location = /usr/portage
sync-type = git
sync-uri = git://github.com/funtoo/ports-2015.git
auto-sync = yes
}}
The following replacements are provided for existing variables:
;PORTDIR: Used to specify main tree location. Replaced by ''location'' key in the section corresponding to the default repository (<code>[funtoo]</code> by default).
;PORTDIR_OVERLAY: Used to specify locations of overlays. Each of the paths needs to be replaced with a separate repository section, with the path placed in ''location'' key. Additionally, ''priority'' may be used to force specific ordering of ebuild overrides.
;SYNC: Used to specify URI for syncing the main repository, also implied a protocol for doing that. Replaced by the ''sync-uri'' and ''sync-type'' keys in the default repository section.
;SYNC_UMASK: Used to specify umask for syncing repositories. Replaced by ''sync-umask'' key in repository configuration. Can be specified in <code>[DEFAULT]</code> section to apply to all repositories.
;SYNC_USER: Used to specify user credentials for syncing repositories. Replaced by ''sync-user'' key in repository configuration. Can be specified in <code>[DEFAULT]</code> section to apply to all repositories.


<console>
{{file|name=/etc/portage/make.conf|desc=Example old make.conf file|body=
(chroot) # ##i##nano -w /etc/fstab
# user changed PORTDIR location
</console>
PORTDIR="/var/db/repos/funtoo"
PORTDIR_OVERLAY="/var/db/repos/foo /var/db/repos/bar"


<pre>
SYNC="git://github.com/funtoo/ports-2015.git"
# The root filesystem should have a pass number of either 0 or 1.
SYNC_USER="oleg"
# All other filesystems should have a pass number of 0 or greater than 1.
SYNC_UMASK="022"
#
}}
# 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
{{file|name=/etc/portage/repos.conf|desc=Replacement repos.conf file|body=
/dev/sda2    none          swap    sw            0 0
[DEFAULT]
/dev/sda3    /            ext4    noatime        0 1
sync-user = oleg
#/dev/cdrom  /mnt/cdrom    auto    noauto,ro      0 0
sync-umask = 022
</pre>


{{Note|Atualmente, noso <code>/etc/fstab</code> padrão tem o filesystem root como <code>/dev/sda4</code> e a partição swap como <code>/dev/sda3</code>. Esses precisarão ser alterados para <code>/dev/sda3</code> e <code>/dev/sda2</code>, respectivamente.}}
[funtoo]
location = /var/db/repos/funtoo
sync-type = git
sync-uri = git://github.com/funtoo/ports-2015.git


{{Note|Se você estiver utilizando UEFI para inicializar (boot), altere a linha <code>/dev/sda1</code> então ela diz <code>vfat</code> ao invés de <code>ext2</code>. Similarmente, certifique-se de que a linha <code>/dev/sda3</code> especifica ou <code>xfs</code> ou <code>ext4</code>, dependendo de qual filesystem você escolher em filesystem-creation time.}}
[foo]
location = /var/db/repos/foo
priority = 1


==== /etc/localtime ====
[bar]
location = /var/db/repos/bar
priority = 2
}}


<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.  
The <code>repos.conf</code> configuration can be further extended with ''sync-type'' and ''sync-uri'' for overlays to get ''emerge --sync'' updating them automatically.


<console>
let's see a real example of tree and overlays added.
(chroot) # ##i##ln -sf /usr/share/zoneinfo/MST7MDT /etc/localtime
{{file|name=/etc/portage/repos.conf|desc=Replacement repos.conf file|body=
</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.
[gentoo]
 
location = /usr/portage
==== /etc/make.conf ====
sync-type = git
 
sync-uri = git://github.com/funtoo/ports-2012.git
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:
 
[funtoo-overlay]
<pre>
location = /root/git/funtoo-overlay
MAKEOPTS="-j3"
</pre>
[funtoo-gnome]
 
location = /root/git/funtoo-gnome-overlay
If you are unsure about how many processors/threads you have then use nproc to help you.
}}
<console>
funtoo-overlay and funtoo-gnome-overlay are an overlays added on top of regular portage tree.
(chroot) # ##i##nproc
[[Category:Portage]]
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 05:39, February 21, 2015

   Warning

This article is a work-in-progress referring to a future Portage version. It does not apply to the current Funtoo Portage version. Please do not update your configuration yet.

Starting with Portage-2.3.8, a switch to a new repository configuration framework is complete and users may want to update their configuration files. This document aims to describe the goals for the new framework and how to use it.

Multiple repository layout

One of the most important changes is the switch from the old overlay layout to a new cleaner repository system. The new layout is more flexible and more predictable. For example, repositories can now use resources (eclasses, for example) provided by other repositories.

The old layout was based on the concept of one main tree and optionally a number of overlays. The main tree provided base system ebuilds, eclasses, profiles, while overlays mostly were able to provide their own ebuilds. The ebuild provided by overlays overrode the ebuilds in main tree to the extend of making it impossible to install the main tree version. Overlays could also provide eclasses for their own ebuilds and package.* entries that applied to all overlays and to the main tree. The Package Manager is responsible for updating the main tree, while overlays are managed externally.

The new layout is based on the concept of one or more configurable repositories. Each repository can either be stand-alone or depend upon other repositories. The distribution provides a repository called funtoo (a drop-in replacement for Gentoo's gentoo repository). Users can install more repositories at they will, the repositories providing their own ebuilds, eclasses and profiles as necessary and/or using them from other repositories. Users can explicitly choose the repository they want to install packages from. The Package Manager can update all repositories.

Portage configuration

New repository layout

The repository configuration should be stored in /etc/portage/repos.conf. It can be either a single file or a directory containing one or more .conf files.

The default configuration is installed as /usr/share/portage/config/repos.conf. This file is internal configuration file installed with portage ebuild and should not be modified. Instead, the configuration in /etc/portage/repos.conf can override the defaults specified there.

The configuration uses format similar to Windows .ini files. Each section heading (repository name in square brackets) signifies a single repository, followed by one or more key-value option pairs. For example, the following file copies default configuration for Funtoo repository:

   /etc/portage/repos.conf/funtoo.conf - Example configuration override for Funtoo repository to move it to non-standard location
[funtoo]
# moved to non-standard location!
location = /var/db/repos/funtoo
sync-type = git
sync-uri = git://github.com/funtoo/ports-2015.git
auto-sync = yes

The most useful repository configuration options are listed below:

location
Obligatory. Specifies the directory where repository is/will be stored. If Portage knows how to sync the repository and the location does not exist, it will be created on next emerge --sync. Otherwise, the directory must exist.
priority
Specifies the priority used for ordering ebuilds from different repositories. If two repositories provide an ebuild with matching versions, the repository with higher priority will be used.
auto-sync
Specifies whether emerge --sync should update the repository. Defaults to yes if sync-type is specified, no otherwise.
sync-depth
Specifies --depth for git clone. Used only on initial sync. Defaults to 1. Can be set to 0 to force full clone (not pass --depth at all).
sync-type
Specifies syncing/update method. Can be one of: cvs, git, rsync, svn.
sync-umask
Specifies the umask used when updating/syncing the repository.
sync-uri
Specifies remote URI from which the repository will be cloned/synced. Can use any syntax valid for a particular syncing method.
sync-user
Specifies the user[:group] used to update/sync the repository. If FEATURES=usersync is used, defaults to the credentials of directory owner.

Additionally a [DEFAULT] section may be specified. Options in this section are used as defaults for all repositories.

Migrating existing configurations

The new configuration format provides replacement for existing configuration done through /etc/portage/make.conf and environment variables. While the variables are still supported for backwards compatibility, users are recommended to move to the new configuration scheme. Funtoo portage ebuild is planned to make the migration unattended (repos.conf installed automatically to ease the config steps) with the following file:

   /etc/portage/repos.conf/funtoo.conf
[funtoo]
location = /usr/portage
sync-type = git
sync-uri = git://github.com/funtoo/ports-2015.git
auto-sync = yes

The following replacements are provided for existing variables:

PORTDIR
Used to specify main tree location. Replaced by location key in the section corresponding to the default repository ([funtoo] by default).
PORTDIR_OVERLAY
Used to specify locations of overlays. Each of the paths needs to be replaced with a separate repository section, with the path placed in location key. Additionally, priority may be used to force specific ordering of ebuild overrides.
SYNC
Used to specify URI for syncing the main repository, also implied a protocol for doing that. Replaced by the sync-uri and sync-type keys in the default repository section.
SYNC_UMASK
Used to specify umask for syncing repositories. Replaced by sync-umask key in repository configuration. Can be specified in [DEFAULT] section to apply to all repositories.
SYNC_USER
Used to specify user credentials for syncing repositories. Replaced by sync-user key in repository configuration. Can be specified in [DEFAULT] section to apply to all repositories.
   /etc/portage/make.conf - Example old make.conf file
# user changed PORTDIR location
PORTDIR="/var/db/repos/funtoo"
PORTDIR_OVERLAY="/var/db/repos/foo /var/db/repos/bar"

SYNC="git://github.com/funtoo/ports-2015.git"
SYNC_USER="oleg"
SYNC_UMASK="022"
   /etc/portage/repos.conf - Replacement repos.conf file
[DEFAULT]
sync-user = oleg
sync-umask = 022

[funtoo]
location = /var/db/repos/funtoo
sync-type = git
sync-uri = git://github.com/funtoo/ports-2015.git

[foo]
location = /var/db/repos/foo
priority = 1

[bar]
location = /var/db/repos/bar
priority = 2

The repos.conf configuration can be further extended with sync-type and sync-uri for overlays to get emerge --sync updating them automatically.

let's see a real example of tree and overlays added.

   /etc/portage/repos.conf - Replacement repos.conf file
[gentoo]
location = /usr/portage
sync-type = git
sync-uri = git://github.com/funtoo/ports-2012.git
 
[funtoo-overlay]
location = /root/git/funtoo-overlay
 
[funtoo-gnome]
location = /root/git/funtoo-gnome-overlay

funtoo-overlay and funtoo-gnome-overlay are an overlays added on top of regular portage tree.