Difference between revisions of "Genkernel Quick Start Tutorial/pt-br"

From Funtoo
Jump to navigation Jump to search
Line 28: Line 28:
</console>
</console>


== Second step: Grabbing and tweaking a configuration file ==
== Segundo passo: Obter e alterar um arquivo de configuração ==


How to start your kernel configuration? Simply by using the same configuration template the running System Rescue CD kernel had been built with! Before chrooting in your Funtoo instance, you did something like:
Como iniciar sua configuração de kernel? Simplesmente ao utilizar o mesmo template de configuração com que o kernel o System Rescue CD tinha sido construído! Antes de executar sua instancia do chroot em seu Funtoo, você fez algo como:


<console>
<console>
###i## mount -o bind /proc /mnt/gentoo/proc
###i## mount -o bind /proc /mnt/gentoo/proc
</console>
</console>
Or:
Ou:
<console>
<console>
###i## mount -t proc none /mnt/gentoo/proc
###i## mount -t proc none /mnt/gentoo/proc
</console>
</console>


In your chroot environment (or from a System Rescue CD virtual terminal) if you look what ''<code>/proc</code>'' contains you will notice a file named ''<code>config.gz</code>'':
Em seu ambiente chroot (ou a partir de um terminal virtual do System Rescue CD) se você ver o que o ''<code>/proc</code>'' contem você notará  um arquivo com nome ''<code>config.gz</code>'':


<console>
<console>
Line 72: Line 72:
make[1]: *** [usr/initramfs_data.cpio.lzma] Error 1
make[1]: *** [usr/initramfs_data.cpio.lzma] Error 1
</console>
</console>
== Third step: Building and installing the kernel ==
== Third step: Building and installing the kernel ==



Revision as of 00:16, April 6, 2015

Conceitos

TBC

Recompilando os códigos fonte do kernel Gentoo a partir do SystemRescue CD chroot

Um segundo caso que muitos usuários de Funtoo users encararão é recompilar seu próprio kernel quando instalar um um Funtoo novinho a partir de um stage 3 archive (o cenário mais comum é inicializar a maquina com o SystemRescue CD).

   Note
Se quiser utilizar o System rescue CD sources fornecido pelo Funtoo No results, a filosofia permanece exatamente a mesma.

Primeiro passo, emergir os pacotes necessários

O primeiro passo é emergir:

  1. Os fontes do kernel do Gentoo: No results
  2. Genkernel em si: No results

Isso é conseguido ao executar o seguinte:

root # emerge sys-kernel/gentoo-sources sys-kernel/genkernel

Uma vez que ps fontes do kernel do Gentoo são implantados, Você deve encontrar um diretório nomeado linux-version-gentoo (ex. linux-2.6.39-gentoo) sob /usr/src. Atualize o link simbólico linux para apontar para esse diretório:

root # cd /usr/src
root # rm linux
root # ln -s linux-2.6.39-gentoo linux

Segundo passo: Obter e alterar um arquivo de configuração

Como iniciar sua configuração de kernel? Simplesmente ao utilizar o mesmo template de configuração com que o kernel o System Rescue CD tinha sido construído! Antes de executar sua instancia do chroot em seu Funtoo, você fez algo como:

root # mount -o bind /proc /mnt/gentoo/proc

Ou:

root # mount -t proc none /mnt/gentoo/proc

Em seu ambiente chroot (ou a partir de um terminal virtual do System Rescue CD) se você ver o que o /proc contem você notará um arquivo com nome config.gz:

root # ls /proc

...
dr-xr-xr-x  7 root       root                     0 May 23 03:13 952
dr-xr-xr-x  7 root       root                     0 May 23 03:13 953
dr-xr-xr-x  7 root       root                     0 May 23 18:42 9834
...
-r--r--r--  1 root       root                 16024 May 23 22:27 config.gz
-r--r--r--  1 root       root                     0 May 23 22:27 consoles
-r--r--r--  1 root       root                     0 May 23 22:27 cpuinfo
...

config.gz holds the running kernel (System Rescue CD) configuration, just copy the unziped content into the Gentoo sources directory:

root # cd /usr/src/linux
root # zcat /proc/config.gz > .config

Next, run make oldconfig to set all newly added options:

root # make oldconfig

Next, tweak the kernel configuration in the way you prefer (manually edition of the .config file, make nconfig, make menuconfig....) if you wish. You are not ready yet! A final step is required: you must either set CONFIG_INITRAMFS_SOURCE to a blank value (CONFIG_INITRAMFS_SOURCE="") either delete the statement in the .config file. Forgotting to do that will make Genkernel abort the compilation process with a message like:

/usr/src/linux-2.6.39-gentoo/scripts/gen_initramfs_list.sh: Cannot open '/var/tmp/genkernel/initramfs-2.6.32.14-std155-i386.cpio.gz'
make[1]: *** [usr/initramfs_data.cpio.lzma] Error 1

Third step: Building and installing the kernel

This is simply achieved by:

root # genkernel --no-mrproper all

The same remarks written in the third paragraph of the first use case are still valid here.