Difference between pages "Install/pt-br/Portage" and "Install/pt-br/Kernel"

< Install‎ | pt-br(Difference between pages)
(Introduzindo o Portage)
 
(Created page with "=== Configuring and installing the Linux kernel === Now it's time to build and install a Linux kernel, which is the heart of any Funtoo Linux system. The kernel is loaded by...")
 
Line 1: Line 1:
=== Introduzindo o Portage ===
+
=== Configuring and installing the Linux kernel ===
  
Portage, o gerenciador de pacotes do Funtoo Linux possui um comando chamado <code>emerge</code> que é utilizado para construir e instalar pacotes a partir do código fonte. ele também cuida para instalar todas as dependências de pacotes. Você invoca o emerge assim:
+
Now it's time to build and install a Linux kernel, which is the heart of any Funtoo Linux system. The kernel is loaded by the boot loader, and interfaces directly with your system's hardware, and allows regular (userspace) programs to run.
 +
 
 +
A kernel must be configured properly for your system's hardware, so that it supports your hard drives, file systems, network cards, and so on. More experienced Linux users can choose to install kernel sources and configure and install their own kernel. If you don't know how to do this, we provide ebuilds that will automatically build a "univeral" kernel, modules and initramfs for booting your system that supports all hardware. This is an extremely simple way of building a kernel that will get your system booted.
 +
 
 +
What is our goal? To build a kernel that will recognize all the hardware in your system necessary for booting, so that you will be greeted by a friendly login prompt after installation is complete. These instructions will guide you through the process of installing a kernel the "easy" way -- without requiring user configuration, by using a "universal" kernel.
 +
 
 +
==== Package Sets ====
 +
 
 +
Before we install a kernel, we're going to cover a feature of Portage called package sets. Portage, the package manager/ports system for Funtoo Linux, will keep track of system packages as well as packages you have installed by calling <code>emerge</code> directly. These packages that are part of the base system are considered part of the "system" package set, while packages that you have installed by typing them on the command line (such as "gnome" in <code>emerge gnome</code>) will be added to the "world" package set. This provides an easy way to update your entire system.
 +
 
 +
However, sometimes it's nice to be able to update the kernel all by itself, or leave a kernel update out of your regular whole system update. To do this, we will create a new package set called "kernel".
 +
 
 +
==== Kernel Package Set ====
 +
 
 +
To create the kernel package set, perform the following steps:
  
 
<console>
 
<console>
(chroot) # ##i##emerge packagename
+
(chroot) # ##i##mkdir /etc/portage/sets
 +
(chroot) # ##i##echo sys-kernel/debian-sources > /etc/portage/sets/kernel
 
</console>
 
</console>
  
Quando você instala um pacote especificando seu nome na linha de comando, o Portage grava seu nome no arquivo <code>/var/lib/portage/world</code>. Ele faz assim por que ele assume que, desde que você tem instalado o pacote por nome, você quer considerá-lo parte do seu sistema e quer manter o pacote atualizado no futuro. Isso é recurso útil, desde quando pacotes estão sendo adicionados a configuração <code>world</code>, podemos atualizar nosso sistema inteiro ao digitar:
+
Now, we'll want to set a USE variable to tell <code>debian-sources</code> to build a "universal" kernel and initramfs for us, to take the guess-work out of getting Funtoo Linux booted. To do this, we're going to set the <code>binary</code> USE variable for <code>debian-sources</code>, as follows:
  
 
<console>
 
<console>
(chroot) # ##i##emerge --sync
+
(chroot) # ##i##echo "sys-kernel/debian-sources binary" >> /etc/portage/package.use
(chroot) # ##i##emerge -auDN @world
+
 
</console>
 
</console>
  
Esse é o modo "oficial" de atualizar o seu sistema Funtoo Linux. Acima, nós atualizamos nossa arvore Portage (Portage tree) utilizando o git para obter a ultima versão dos ebuilds (scripts), e depois executar um comando emerge para atualizar o conjunto de pacotes <code>world</code>. As opções especificadas diz ao <code>emerge</code> para:
+
If USE variables are new to you, you'll be getting a lot more familiar with them as you use Funtoo Linux. At their essence, they are "switches" that you can set to configure options that can be built in to various packages. They're used to customize your Funtoo Linux system to meet your exact needs. We added support for a <code>binary</code> USE flag to the <code>debian-sources</code> ebuilds, as well as a few other of our kernel ebuilds, to make it easier for new users to get Funtoo Linux up and running.
  
* '''<code>a</code>''' - Nos mostra o que será emergido (emerged), e nos '''perguntará''' se queremos prosseguir.
+
Now, when we just want to update our system's packages, we'll type <code>emerge -auDN @world</code>, and it will update our world set, leaving out the kernel. Likewise, when we just want to update our kernel, we'll type <code>emerge -au @kernel</code>, and it will update our kernel, leaving out the world set.
* '''<code>u</code>''' - ''Atualiza'' os pacotes que especificarmos -- não emerja-os novamente se eles já estão emergidos.
+
* '''<code>D</code>''' - Considere a arvore de dependência inteira de pacotes quando procurar por atualizações. Em outras palavras, faça uma atualização '''profunda'''.
+
* '''<code>N</code>''' - Atualizar quaisquer pacotes que tenha alterado ('''novas''') configurações de USO.
+
  
Você deve também considerar passar <code>--with-bdeps=y</code> quando emergir @world, ao menos de vez em quando. Isso atualizará as build dependencies também.
+
==== Building the Kernel ====
  
Claro que, as vezes queremos instalar um pacote mas não adicioná-lo ao arquivo <code>world</code>. Com frequência isso é feito por que você só quer o pacote instalado temporariamente ou por que você sabe que pacote é uma dependência de outro pacote. Se esse comportamento for desejado, você invoca o emerge assim:
+
{{Fancynote|1=
 +
See [[Funtoo Linux Kernels]] for a full list of kernels supported in Funtoo Linux. We recommend <code>debian-sources</code> for new users.}}
 +
 
 +
{{fancyimportant|1=
 +
<code>debian-sources</code> with <code>binary</code> USE flag requires at least 14GB free in <code>/var/tmp</code> and takes around 1 hour to build on a Intel Core i7 Processor.}}
 +
 
 +
Let's emerge our kernel:
  
 
<console>
 
<console>
(chroot) # ##i##emerge -1 packagename
+
(chroot) # ##i##emerge -1 @kernel
 
</console>
 
</console>
  
Usuários avançados podem estar interessado na página wiki do [[Pt-br/Emerge|Emerge]].
+
{{Important|Right now, the <code>-1</code> option is required to not add our <code>@kernel</code> set to <code>world-sets</code>. This allows you to emerge it independently from @world. If you forget to use this option, edit <code>/var/lib/portage/world-sets</code> and remove the <code>@kernel</code> line. This will prevent kernel updates from being included in @world updates.}}
  
==== Atualizando o World ====
+
Note that while use of the <code>binary</code> USE flag makes installing a working kernel extremely simple, it is one part of Funtoo Linux that takes a ''very'' long time to build from source, because it is building a kernel that supports ''all'' hardware that Linux supports! So, get the build started, and then let your machine compile. Slower machines can take up to several hours to build the kernel, and you'll want to make sure that you've set <code>MAKEOPTS</code> in <code>/etc/portage/make.conf</code> to the number of processing cores/threads (plus one) in your system before starting to build it as quickly as possible -- see the [[#/etc/portage/make.conf|/etc/portage/make.conf section]] if you forgot to do this.
  
Agora é na verdade uma hora muito boa para atualizar o sistema por completo e pode ser uma boa ideia fazer tal antes do primeiro boot.
+
{{fancynote|NVIDIA card users: the <code>binary</code> USE flag installs the Nouveau drivers which cannot be loaded at the same time as the proprietary drivers, and cannot be unloaded at runtime because of KMS. You need to blacklist it under <code>/etc/modprobe.d/</code>.}}
  
<console>
+
{{fancynote|For an overview of other kernel options for Funtoo Linux, see [[Funtoo Linux Kernels]]. There may be modules that the Debian kernel doesn't include, a situation where [http://www.funtoo.org/wiki/Funtoo_Linux_Kernels#Using_Debian-Sources_with_Genkernel genkernel] would be useful. Also be sure to see [[:Category:Hardware Compatibility|hardware compatibility]] information.}}
(chroot) # ##i##emerge --sync
+
(chroot) # ##i##emerge -auDN @world
+
</console>
+
  
{{fancyimportant|1=
+
Once <code>emerge</code> completes, you'll have a brand new kernel and initramfs installed to <code>/boot</code>, plus kernel headers installed in <code>/usr/src/linux</code>, and you'll be ready to configure the boot loader to load these to boot your Funtoo Linux system.
Certifique-se de que leu quaisquer mensagens de post do emerge e de seguir as instruções. É especialmente verdade se você atualizou o perl ou python.}}
+

Revision as of 17:08, February 7, 2015

Configuring and installing the Linux kernel

Now it's time to build and install a Linux kernel, which is the heart of any Funtoo Linux system. The kernel is loaded by the boot loader, and interfaces directly with your system's hardware, and allows regular (userspace) programs to run.

A kernel must be configured properly for your system's hardware, so that it supports your hard drives, file systems, network cards, and so on. More experienced Linux users can choose to install kernel sources and configure and install their own kernel. If you don't know how to do this, we provide ebuilds that will automatically build a "univeral" kernel, modules and initramfs for booting your system that supports all hardware. This is an extremely simple way of building a kernel that will get your system booted.

What is our goal? To build a kernel that will recognize all the hardware in your system necessary for booting, so that you will be greeted by a friendly login prompt after installation is complete. These instructions will guide you through the process of installing a kernel the "easy" way -- without requiring user configuration, by using a "universal" kernel.

Package Sets

Before we install a kernel, we're going to cover a feature of Portage called package sets. Portage, the package manager/ports system for Funtoo Linux, will keep track of system packages as well as packages you have installed by calling emerge directly. These packages that are part of the base system are considered part of the "system" package set, while packages that you have installed by typing them on the command line (such as "gnome" in emerge gnome) will be added to the "world" package set. This provides an easy way to update your entire system.

However, sometimes it's nice to be able to update the kernel all by itself, or leave a kernel update out of your regular whole system update. To do this, we will create a new package set called "kernel".

Kernel Package Set

To create the kernel package set, perform the following steps:

(chroot) # mkdir /etc/portage/sets
(chroot) # echo sys-kernel/debian-sources > /etc/portage/sets/kernel

Now, we'll want to set a USE variable to tell debian-sources to build a "universal" kernel and initramfs for us, to take the guess-work out of getting Funtoo Linux booted. To do this, we're going to set the binary USE variable for debian-sources, as follows:

(chroot) # echo "sys-kernel/debian-sources binary" >> /etc/portage/package.use

If USE variables are new to you, you'll be getting a lot more familiar with them as you use Funtoo Linux. At their essence, they are "switches" that you can set to configure options that can be built in to various packages. They're used to customize your Funtoo Linux system to meet your exact needs. We added support for a binary USE flag to the debian-sources ebuilds, as well as a few other of our kernel ebuilds, to make it easier for new users to get Funtoo Linux up and running.

Now, when we just want to update our system's packages, we'll type emerge -auDN @world, and it will update our world set, leaving out the kernel. Likewise, when we just want to update our kernel, we'll type emerge -au @kernel, and it will update our kernel, leaving out the world set.

Building the Kernel

Note

See Funtoo Linux Kernels for a full list of kernels supported in Funtoo Linux. We recommend debian-sources for new users.

Important

debian-sources with binary USE flag requires at least 14GB free in /var/tmp and takes around 1 hour to build on a Intel Core i7 Processor.

Let's emerge our kernel:

(chroot) # emerge -1 @kernel
Important

Right now, the -1 option is required to not add our @kernel set to world-sets. This allows you to emerge it independently from @world. If you forget to use this option, edit /var/lib/portage/world-sets and remove the @kernel line. This will prevent kernel updates from being included in @world updates.

Note that while use of the binary USE flag makes installing a working kernel extremely simple, it is one part of Funtoo Linux that takes a very long time to build from source, because it is building a kernel that supports all hardware that Linux supports! So, get the build started, and then let your machine compile. Slower machines can take up to several hours to build the kernel, and you'll want to make sure that you've set MAKEOPTS in /etc/portage/make.conf to the number of processing cores/threads (plus one) in your system before starting to build it as quickly as possible -- see the /etc/portage/make.conf section if you forgot to do this.

Note

NVIDIA card users: the binary USE flag installs the Nouveau drivers which cannot be loaded at the same time as the proprietary drivers, and cannot be unloaded at runtime because of KMS. You need to blacklist it under /etc/modprobe.d/.

Note

For an overview of other kernel options for Funtoo Linux, see Funtoo Linux Kernels. There may be modules that the Debian kernel doesn't include, a situation where genkernel would be useful. Also be sure to see hardware compatibility information.

Once emerge completes, you'll have a brand new kernel and initramfs installed to /boot, plus kernel headers installed in /usr/src/linux, and you'll be ready to configure the boot loader to load these to boot your Funtoo Linux system.