User:Zulu Foxtrott/GentooOnARM/EasyInstall/KernelSources

From Gentoo Wiki
Jump to:navigation Jump to:search

Installing the sources

The core around which all Linux distributions are built is the Linux kernel. It is the layer between the user programs and the system hardware. Gentoo provides its users several possible kernel sources. A full listing with description is available at the Kernel overview page.

Downloading the sources

The recommended way to get the kernel sources is downloading them directly from upstream (the kernel developers themselves). Like with downloading the stage tarball, the only tool necessary is a web browser.

When installing kernel sources provided by Portage on a running Gentoo system, the package manager places them in the /usr/src directory. Go to the directory that once the installation is finished and running on the target system will be found at /usr/src:

root #cd /mnt/gentoo/usr/src

Graphical browsers

In environments with fully graphical web browsers copy the kernel sources URL from [1]. Right click on the big yellow button labeled "Latest Release" and featuring the current stable release's version number, then Copy link address (Firefox) or Copy link location (Chromium) to copy the link to the clipboard, then paste the link to the wget utility on the command-line to download the sources:


Command-line browsers

To download the kernel sources directly from a command line environment, use for example links, the non-graphical, menu-driven browser.

root #links

To use an HTTP proxy with links, pass on the URL with the -http-proxy option:

root #links -http-proxy

Alternatively, use the (also non-graphical but not menu-driven) lynx browser.

root #lynx

If a proxy needs to be defined, and it has not been done already, export the http_proxy and/or ftp_proxy variables:

root #export http_proxy=""
root #export ftp_proxy=""

Select the version number (or "Download" next to it) displayed below the line "Latest Release" and press d to start the download.

Unpacking the sources

Create a directory on the storage device for the unpacked kernel sources:

root #mkdir /mnt/gentoo/usr/src/upstream-sources

Now unpack the downloaded kernel sources with tar into the newly created directory specified with the command line argument -C:

root #tar xpvf linux-*.tar.xz -C /mnt/gentoo/usr/src/upstream-sources

This will install the Linux kernel sources under the path /mnt/gentoo/usr/src/upstream-sources in a directory named "linux" followed by a version number. Change into that folder now:

root #cd /mnt/gentoo/usr/src/upstream-sources/linux-*

TODO: reevaluate commented out parts

Now it is time to configure and compile the kernel sources.


Configuring the Kernel