Difference between pages "Boot Methods" and "Install/pt-br/Kernel"

From Funtoo
(Difference between pages)
Jump to navigation Jump to search
 
 
Line 1: Line 1:
It used to be that booting a PC-compatible system didn't involve very many choices -- there was only one way to do it. All of our desktops and servers had a standard BIOS, all our hard drives used Master Boot Records, and were partitioned using the MBR partition scheme. Then, along came EFI and UEFI, which are new-style firmware designed to boot systems, along with GPT partition tables to support disks larger than 2.2TB. All of the sudden, we then had a variety of options to boot Linux systems, turning what once was a one-method-fits-all approach into something a lot more complex.
=== Configurando e instalando o kernel Linux ===


=== BIOS + GRUB (MBR) ===
Agora é hora de construir e instalar um kernel Linux, o qual é o coração de qualquer sistema Funtoo Linux. O kernel é carregado pelo boot loader, e interfaces diretamente com o hardware do seu sistema, e permite programas regulares (userspace) serem executador.


{{Note|This option is the "old school" way to boot Funtoo Linux, as documented in our [[Install|Install Guide]]. This method uses traditional MBR partitions, which have existed since the origin of the PC. }}
Um kernel deve ser configurado propriamente para o hardware do seu sistema, desse modo ele suporta seus hard drives, file systems, placas de rede, e assim por diante. Usuários de Linux mais experientes podem escolher instalar o kernel sources e configurar e instalar seu próprio kernel. Se você não sabe como fazer isso, nós fornecemos ebuilds que construirão automaticamente um kernel "universal", módulos e initramfs para a inicialização do seu sistema que suporte todo o hardware. Esse é um jeito extremamente simples de construção de um kernel que colocará seu sistema para inicializar.


Here is the typical disk layout:
Qual é o nosso objetivo? Construir um kernel que reconhecerá todo o hardware em seu sistema necessário para inicialização, você será cumprimentado por um prompt de login amigável depois que a instalação estiver completa. Estas instruções lhe guiarão através do processo de instalação de um kernel no modo "fácil" -- sem exigir configuração do usuário, ao utilizar um kernel "universal".


* MBR (master boot record) at beginning of boot disk
==== Package Sets ====
* MBR partition 1, <tt>/dev/sda1</tt> is the <tt>/boot</tt> filesystem (typically ext2)
* MBR partition 2, <tt>/dev/sda2</tt> is ''swap''.
* MBR partition 3, <tt>/dev/sda3</tt> is the <tt>/</tt> (root) filesystem.


Here's how the boot process works:
Antes que instalemos um kernel, vamos cobrir um recurso do Portage chamado package sets. Portage, o sistema gerenciador/ports de pacotes para o Funtoo Linux, manterá rastro de pacotes do sistema assim como pacotes que você tem instalado ao invocar <code>emerge</code> diretamente. Esses pacotes que são parte do sistema base são considerados parte do conjunto de pacote do "sistema" (''system'' packages sets), enquanto pacotes que você tem instalado ao digitá-los na linha de comando (tal qual "gnome" em <code>emerge gnome</code>) serão adicionados ao conjunto de pacote "world". Isso proporciona um jeito fácil de atualizar o sistema inteiro.


# The system BIOS loads the MBR from your boot disk (containing stage1 of the GRUB boot loader) and runs it.
No entanto, as vezes é bom ser capaz de atualizar o kernel todo por sim só, ou deixar uma atualização do kernel fora da sua regular atualização completa do sistema. Para fazer isso, criaremo uma nova configuração de pacote chamada "kernel".
# Extra boot-related code is loaded by the GRUB stage1 from the <tt>/boot</tt> filesystem on the disk.


Now, the boot loader is able to run and load the Linux kernel and initramfs, and start Funtoo Linux.
==== Configuração de Pacote do Kernel ====


=== BIOS + GRUB (GPT) ===
Para criar a configuração de pacote do kernel, realize os seguintes passos:


This is a more modern way to boot Linux. It uses MBR for booting but uses the more modern GPT partition scheme. Here's the disk layout:
<console>
(chroot) # ##i##mkdir /etc/portage/sets
(chroot) # ##i##echo sys-kernel/debian-sources > /etc/portage/sets/kernel
</console>


* The protective MBR is used for booting.
Agora, vamos querer definir uma variável USE para dizer ao <code>debian-sources</code> que construa um kernel "universal" e o initramfs para nós, para levar Funtoo Linux a funcionamento na inicialização. Para fazer isso, vamos configurar a variável <code>binary</code> USE para <code>debian-sources</code>, como a seguir:
* GPT partition 1, <tt>/dev/sda1</tt> is the <tt>/boot</tt> filesystem (typically ext2)
* GPT partition 2 type 0xEF02, <tt>/dev/sda2</tt> is the ''boot loader partition'' (this contains a fake MBR).
* GPT partition 3, <tt>/dev/sda3</tt> is ''swap''.
* GPT partition 4, <tt>/dev/sda4</tt> is the <tt>/</tt> (root) filesystem.


Here's how this hybrid scheme works:
<console>
(chroot) # ##i##echo "sys-kernel/debian-sources binary" >> /etc/portage/package.use
</console>


# The system BIOS loads the fake MBR from your boot disk(/dev/sda2) (containing stage1 of the GRUB boot loader) and runs it.
Se as varáveis USE forem novas para você, você estará se familiarizando com elas um pouco mais enquanto utiliza o Funtoo Linux. Em sua essência, elas são "switches" que você pode definir para configurar opções que podem ser construídas em vários pacotes. Elas são utilizadas para assim personalizar seu Funtoo Linux system para que conheça as suas exatas necessidades. Nós adicionamos suporte para uma flag <code>binary</code> USE flag aos ebuilds <code>debian-sources</code>, assim como poucos outros de nossos kernel ebuilds, para tornar mais fácil para que novos usuários de consigam obter o Funtoo Linux funcionando e operando.
# Extra boot-related code is loaded by the GRUB stage1 from a small (a few MB) GPT partition on the disk.


Now, the boot loader is able to run and load the Linux kernel and initramfs, and start Funtoo Linux.
Agora, quando queremos somente atualizar os pacotes do nosso sistema, digitaremos <code>emerge -auDN @world</code>, e isso atualizará nossa configuração world, deixando de fora o kernel. Do mesmo modo, quando queremos atualizar somente o nosso kernel, digitaremos <code>emerge -au @kernel</code>, e isso atualizará nosso kernel, deixando de fora a configuração world.


=== UEFI + GRUB ===
==== Building the Kernel ====


{{Note|This method is documented in our [[Install|Install Guide]] as the "new school" UEFI boot method.}}
{{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.}}


UEFI is a new-style firmware that is used for booting. It is generally available on all new PCs (2012 and newer) and may be available on older systems as well. Here's the disk layout:
{{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.}}


* ''no MBR is installed or required''
Let's emerge our kernel:
* GPT partition 1, <tt>/dev/sda1</tt> is the <tt>/boot</tt> filesystem (<tt>vfat</tt> aka "FAT32").
* GPT partition 2, <tt>/dev/sda2</tt> is ''swap''.
* GPT partition 3, <tt>/dev/sda3</tt> is the <tt>/</tt> (root) filesystem.


Here's how this boot scheme works:
<console>
(chroot) # ##i##emerge -1 @kernel
</console>


# UEFI (contained in your motherboard's firmware) loads the Bootmanager entry from the RW NVRAM inside your motherboard.
{{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.}}
# If there's a valid entry that contains Grub, then the GRUB boot loader code from your <tt>/boot</tt> filesystem will be loaded.
# UEFI can read from <tt>vfat</tt> partitions directly, which is why we use <tt>vfat</tt> instead of the normal <tt>ext2</tt> for <tt>/boot</tt>.


Now, the boot loader is able to run and load the Linux kernel and initramfs from the <tt>vfat</tt> <tt>/boot</tt> filesystem, and start Funtoo Linux.
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.


=== Pure UEFI ===
{{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>.}}


A Pure UEFI boot is also possible. The partitioning scheme is the same as the UEFI + GRUB scheme, above. This boot method is documented in detail in our [[Pure UEFI Boot Guide]].
{{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.}}


Here's how this boot scheme works:
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.
 
# UEFI (contained in your motherboard's firmware) loads the Bootmanager entry from the RW NVRAM inside your motherboard.
#  UEFI loads the Linux kernel STUB and initramfs directly, and runs the Linux kernel to start Funtoo Linux.

Revision as of 14:58, February 26, 2015

Configurando e instalando o kernel Linux

Agora é hora de construir e instalar um kernel Linux, o qual é o coração de qualquer sistema Funtoo Linux. O kernel é carregado pelo boot loader, e interfaces diretamente com o hardware do seu sistema, e permite programas regulares (userspace) serem executador.

Um kernel deve ser configurado propriamente para o hardware do seu sistema, desse modo ele suporta seus hard drives, file systems, placas de rede, e assim por diante. Usuários de Linux mais experientes podem escolher instalar o kernel sources e configurar e instalar seu próprio kernel. Se você não sabe como fazer isso, nós fornecemos ebuilds que construirão automaticamente um kernel "universal", módulos e initramfs para a inicialização do seu sistema que suporte todo o hardware. Esse é um jeito extremamente simples de construção de um kernel que colocará seu sistema para inicializar.

Qual é o nosso objetivo? Construir um kernel que reconhecerá todo o hardware em seu sistema necessário para inicialização, você será cumprimentado por um prompt de login amigável depois que a instalação estiver completa. Estas instruções lhe guiarão através do processo de instalação de um kernel no modo "fácil" -- sem exigir configuração do usuário, ao utilizar um kernel "universal".

Package Sets

Antes que instalemos um kernel, vamos cobrir um recurso do Portage chamado package sets. Portage, o sistema gerenciador/ports de pacotes para o Funtoo Linux, manterá rastro de pacotes do sistema assim como pacotes que você tem instalado ao invocar emerge diretamente. Esses pacotes que são parte do sistema base são considerados parte do conjunto de pacote do "sistema" (system packages sets), enquanto pacotes que você tem instalado ao digitá-los na linha de comando (tal qual "gnome" em emerge gnome) serão adicionados ao conjunto de pacote "world". Isso proporciona um jeito fácil de atualizar o sistema inteiro.

No entanto, as vezes é bom ser capaz de atualizar o kernel todo por sim só, ou deixar uma atualização do kernel fora da sua regular atualização completa do sistema. Para fazer isso, criaremo uma nova configuração de pacote chamada "kernel".

Configuração de Pacote do Kernel

Para criar a configuração de pacote do kernel, realize os seguintes passos:

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

Agora, vamos querer definir uma variável USE para dizer ao debian-sources que construa um kernel "universal" e o initramfs para nós, para levar Funtoo Linux a funcionamento na inicialização. Para fazer isso, vamos configurar a variável binary USE para debian-sources, como a seguir:

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

Se as varáveis USE forem novas para você, você estará se familiarizando com elas um pouco mais enquanto utiliza o Funtoo Linux. Em sua essência, elas são "switches" que você pode definir para configurar opções que podem ser construídas em vários pacotes. Elas são utilizadas para assim personalizar seu Funtoo Linux system para que conheça as suas exatas necessidades. Nós adicionamos suporte para uma flag binary USE flag aos ebuilds debian-sources, assim como poucos outros de nossos kernel ebuilds, para tornar mais fácil para que novos usuários de consigam obter o Funtoo Linux funcionando e operando.

Agora, quando queremos somente atualizar os pacotes do nosso sistema, digitaremos emerge -auDN @world, e isso atualizará nossa configuração world, deixando de fora o kernel. Do mesmo modo, quando queremos atualizar somente o nosso kernel, digitaremos emerge -au @kernel, e isso atualizará nosso kernel, deixando de fora a configuração world.

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.