Build linux kernel

Get a copy of source code

Take a copy of the linux kernel source repository via git software

git clone --depth=1 https://github.com/torvalds/linux

or download a zip file from this link - https://github.com/torvalds/linux/archive/refs/heads/master.zip

Generate .config file

make menuconfig

Here are the images of the some menuconfig options chosen.

menuconfig
Options
kernel .config support
Module unloading
Kernel Function Tracer

Run make help to get the hints and options for building.

build a image

After that do, make bzImage.

Note Kernel: arch/x86/boot/bzImage is ready (#1).

Errors

fatal error: libelf.h: No such file or directory

Install libelf-dev package

aa

Video

Last updated

Was this helpful?