Kernel/pt-br

From Funtoo
< Kernel
Revision as of 01:11, April 8, 2015 by Tocadotux (talk | contribs) (Created page with "== Minimum Requirements == * '''Understand the command line''' * '''Know where the kernel files are located''' == Assumptions == You start from an installed Funtoo system on t...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Minimum Requirements

  • Understand the command line
  • Know where the kernel files are located

Assumptions

You start from an installed Funtoo system on the disk, or at least, you are on stage3 in a chrooted environment from a live cd, following somehow the Funto Installation Tutorial.

Less advanced version

Emerging the kernel sources

To begin, we have to figure out which kernel sources we will use. If you are unsure about which sources are available and what their benefits and drawbacks are, check out the Kernels page.

After you have made a decsion as to which kernel you want to install, emerge it:

root # emerge sys-kernel/[kernel-name]

Portage will now go about installing the sources to /usr/src. However, it is preferable to also create a symlink with eselect as such:

root # eselect kernel set 1

You may use

root # eselect kernel list

to display a list of kernels currently installed.

Using the above command is useful, because it allows you to always be able to go to the directory "/usr/src/linux" and find your current working kernel and build files. The "/usr/src/linux" directory is simply a symlink to the kernel you selected with eselect, in the "/usr/src" directory.

Note that portage can also set this up for you automatically, by setting the "symlink" USE flag for your kernel.

Configuring the kernel

Now that the kernel sources are on your system, you should configure them. To do this, change your directory to /usr/src/linux

root # cd /usr/src/linux

We are now in the kernel sources directory, next sanitize the sources:

   Warning

this will delete your .config

root # make clean && make distclean && make mrproper

Copy configurations if you have previous configurations to copy:

root # cp /boot/config-3.13.7 .config

We can run a script that allows us to modify the configuration. Run:

root # make menuconfig

or

root # make nconfig


here is where you insert kernel configs, or press / to search for kernel modules by name

While you edit the sources, keep the following in mind:

  • To build something into your kernel, press y when you have it selected.
  • To exclude something from your kernel, press n when you have it selected.
  • To build something as a module, press m.


Things that you may need to include in your kernel:

as modules:

  • Wireless/LAN drivers
  • Support for your graphics card
  • Support for your audio card
  • Support for USB devices


as built in:

  • scsi sata & or ata controllers
  • file system used
   Note

Many pages on the wiki will tell you the kernel requirements for the application that they are about. Keep your eyes open for the blue background, white text sections of pages. Like on this one: uvesafb

Building and installing the kernel sources

After you finish configuring your kernel sources, you will need to build them. To build your sources, run the following:

root # make
   Tip

You can add -j<number of processing cores + 1> after make to build the kernel more quickly.

When the kernel and its modules finish building, install them:

root # make modules_install && make install

Now that you have installed your kernel and modules, it is a good idea to install an Initramfs.

  • If your system has a separate /usr partition, is encrypted, or uses some other non-standard configuration, it will probably not boot without an initramfs.
  • If your system is unencrypted, with file system, and hard drive controllers compiled in rather than as modules, it will not need an initramfs.