Difference between pages "Usermap" and "Pt-br/Genkernel Quick Start Tutorial"

(Difference between pages)
 
(Recompiling the Gentoo kernel sources from a SystemRescue CD chroot)
 
Line 1: Line 1:
'''To add yourself to the UserMap''', first {{CreateAccount}}. Then log in and ''click on your username'' at the top of the screen. Then click ''Create with Form'' and enter your information.
+
== Conceitos ==
  
__NOCACHE__ 
+
TBC
{{#compound_query:[[Category:People]] [[Role type::Staff]];?Geoloc;icon=Purplemarker.png;limit=9999
+
 
    |[[Category:People]][[Role type::Contributor]];?Geoloc;icon=Orangemarker.png;limit=9999
+
== Recompilando os códigos fonte do kernel Gentoo a partir do SystemRescue CD chroot ==
    |[[Category:People]][[Role type::User]];?Geoloc;icon=Greenmarker.png;limit=9999
+
 
    |format=googlemaps3|height=500|type=hybrid|zoom=2|minzoom=2|markercluster=on}}
+
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).
<div class="donate">
+
 
{| cellpadding="2"
+
{{Fancynote| Se quiser utilizar o System rescue CD sources fornecido pelo Funtoo {{Package|sys-kernel/sysrescue-std-sources}}, a filosofia permanece exatamente a mesma.}}
|-  
+
 
! Description !! Marker !! Notes
+
== First step emerging the required packages ==
|-
+
 
| Staff Members || [[Image:Purplemarker.png|12px]] || Funtoo Staff (BDFL and Support Staff)
+
The first step is to emerge:
|-
+
 
| Contributors || [[Image:Orangemarker.png|12px]] || Funtoo Code Contributors
+
# The Gentoo kernel sources: {{Package|sys-kernel/gentoo-sources}}
|-
+
# Genkernel itself: {{Package|sys-kernel/genkernel}}
| Users || [[Image:Greenmarker.png|12px]] || Funtoo Linux users
+
 
|}
+
This is achieved by running the following:
</div>
+
<console>
+
###i## emerge sys-kernel/gentoo-sources sys-kernel/genkernel
__NOEDITSECTION__
+
</console>
__NOTOC__
+
 
__NOTITLE__
+
Once the Gentoo kernel sources are deployed, you should find a directory named '''linux-''version''-gentoo''' (e.g. linux-2.6.39-gentoo) under ''<code>/usr/src</code>''. Update the ''<code>linux</code>'' symlink to point to this directory:
 +
<console>
 +
###i## cd /usr/src
 +
###i## rm linux
 +
###i## ln -s linux-2.6.39-gentoo linux
 +
</console>
 +
== Second step: Grabbing and tweaking a configuration file ==
 +
 
 +
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:
 +
 
 +
<console>
 +
###i## mount -o bind /proc /mnt/gentoo/proc
 +
</console>
 +
Or:
 +
<console>
 +
###i## mount -t proc none /mnt/gentoo/proc
 +
</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>'':
 +
 
 +
<console>
 +
###i## 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
 +
...
 +
</console>
 +
 
 +
''<code>config.gz</code>'' holds the running kernel (System Rescue CD) configuration, just copy the unziped content into the Gentoo sources directory:
 +
<console>
 +
###i## cd /usr/src/linux
 +
###i## zcat /proc/config.gz > .config
 +
</console>
 +
 
 +
Next, run ''<code>make oldconfig</code>'' to set all newly added options:
 +
<console>
 +
###i## make oldconfig
 +
</console>
 +
 
 +
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:
 +
<console>
 +
/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
 +
</console>
 +
== Third step: Building and installing the kernel ==
 +
 
 +
This is simply achieved by:
 +
<console>
 +
###i## genkernel --no-mrproper all
 +
</console>
 +
 
 +
The same remarks written in the [[Genkernel_Quick_Start_Tutorial#Third_step:_Building_and_installing_the_kernel|third paragraph]] of the first use case are still valid here.
 +
 
 +
[[Category:Kernel]]

Revision as of 01:51, April 3, 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.

First step emerging the required packages

The first step is to emerge:

  1. The Gentoo kernel sources: No results
  2. Genkernel itself: No results

This is achieved by running the following:

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

Once the Gentoo kernel sources are deployed, you should find a directory named linux-version-gentoo (e.g. linux-2.6.39-gentoo) under /usr/src. Update the linux symlink to point to this directory:

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

Second step: Grabbing and tweaking a configuration file

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:

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

Or:

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

In your chroot environment (or from a System Rescue CD virtual terminal) if you look what /proc contains you will notice a file named config.gz:

# 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:

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

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

# 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:

# genkernel --no-mrproper all

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