Linux Kernel tutorial for Outreachy

I’m so interested in contributing for the linux kernel, so I’m going to follow the instructions to submit a first patch.

Actually I’m running in my laptop Fedora 27, the tutorial was made for ubuntu but with a little changes we can do it for fedora.

1 – Install some packages

The first thing we are going to do is to run this command

sudo dnf install vim libncurses5-devel gcc make git ctags openssl-devel

let it download the packages.

2 – Setup your Linux kernel code repository

Create a directory and a subdirectory in our user’s home 1.png

enter to this subdirectory and we are going to clone there the tree Greg Kroah-Hartman’s staging tree repository3.png

then we enter to the directory staging.

4.png

3 – Setting up your kernel configuration

When we download the source tree, it doesn’t have a .config file. We have to generate a .config file which determines which drivers are built. In order to do that duplicate your current config.

That config file is stored somewhere in /boot/. And we need to copy that file in our current directory just running this command

9.png

And as we can see, the file was copied, now we have to change it name

10.png

6.png

4 – Building the kernel

I couln’t run the command make at first, because before that I had to install the packages bison and flex, also installed libelf-dev, libelf-devel or elfutils-libelf-devel, on my laptop worked with elfutils-libelf-devel

7-e1519103002434.png

Now, I can run make, takes a long time, but finally it works without errors

2

finally we can see that make add to our current directory 6 files (built-in.o, modules.order, modules.builtin, Moule.symvers, System.map, vmlinux.o) and 2 directories (net, vmlinux)

1

5- Installing the kernel

Once we have the .ko files, we have to install the kernel running this command

3

4

And that’s all, when you boot your computer in the grub will appear the kernel that you have installed.

Anuncios

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión /  Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión /  Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión /  Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión /  Cambiar )

w

Conectando a %s