The kernel build depends on a kernel configuration file. In most cases, you will most likely keep
as close as possible to that proposed by Kali, which, like all Linux distributions, is installed in the
/boot
directory. In this case, rather than reconfiguring everything from scratch, it is sufficient to
make a copy of the
/boot/config-
version
file. The version should be the same as that version of
the kernel currently used, which can be found with the
uname -r
command. Place the copy into
a
.config
file in the directory containing the kernel sources.
$
cp /boot/config-4.9.0-kali1-amd64 ~/kernel/linux-source-4.9/.config
Alternatively, since the kernel provides default configurations in
arch/
arch
/configs/*_
defconfig
, you can put your selected configuration in place with a command like
make
x86_64_defconfig
(in the case of a 64-bit PC) or
make i386_defconfig
(in the case of a 32-bit
PC).
Unless you need to change the configuration, you can stop here and skip to section
9.2.4
, “
Com-
piling and Building the Package
” [page 241]. If you need to make changes or if you decide to
reconfigure everything from scratch, you must take the time to configure your kernel. There are
various dedicated interfaces in the kernel source directory that can be used by calling the
make
target
command, where
target is one of the values described below.
make menuconfig
compiles and launches a text-mode kernel configuration interface (this is
where the
libncurses5-dev package is required), which allows navigating the many available ker-
nel options in a hierarchical structure. Pressing the Space key changes the value of the selected
option, and Enter validates the button selected at the bottom of the screen; Select returns to the
selected sub-menu; Exit closes the current screen and moves back up in the hierarchy; Help will
display more detailed information on the role of the selected option. The arrow keys allow mov-
ing within the list of options and buttons. To exit the configuration program, choose Exit from
the main menu. The program then offers to save the changes that you have made; accept if you
are satisfied with your choices.
Other interfaces have similar features but they work within more modern graphical interfaces,
such as
make xconfig
, which uses a Qt graphical interface, and
make gconfig
, which uses GTK+.
The former requires
libqt4-dev, while the latter depends on
libglade2-dev and
libgtk2.0-dev.