Ubuntu provides a full set of .config files in the subdirectory configs,
all named for the type of system they were compiled for. If you want to use
one of these default configurations as the basis for a custom kernel, just
copy the appropriate file to /usr/src /linux-4.15 and rename it
.config.
- Run the make mrproper directive to prepare the kernel source tree,
cleaning out any old files or binaries. - Restore the .config file that the command make mrproper deleted
and edit the makefile to change the EXTRAVERSION number.
NOTE
If you want to keep any current version of the kernel that was compiled
with the same code tree, manually edit the makefile with your favorite text
editor and add some unique string to the EXTRAVERSION variable.
You can use any description you prefer.
- Modify the kernel configuration file using make config, make
menuconfig, or make xconfig; we recommend the last one. - Run make dep to create the code dependencies used later in the
compilation process.
TIP
If you have a multiprocessor machine, you can use both processors to
speed the make process by inserting -jx after the make command, where,
as a rule of thumb, x is one more than the number of processors you have.
You might try a larger number and even try this on a single processor
machine (we have used -j8 successfully on an SMP machine); it will only
load up your CPU. Here is an example:
Click here to view code image
matthew@seymour:~$ sudo make –j3 bzImage
All the make processes except make dep work well with this method of
parallel compiling.
- Run make clean to prepare the sources for the compilation of the
kernel. - Run make bzImage to create a binary image of the kernel.
NOTE
Several choices of directives exist; the most common ones are the