| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| kernel [03/01/2018 13:31] – admin | kernel [06/09/2026 12:03] (current) – [Compiling the kernel] admin |
|---|
| | https://docs.kernel.org/index.html |
| |
| Kernel headers should be copied into /usr/include to be used by libraries and compiled programs. These should be the headers glibc has been compiled against, and should be kept independent of the ones in the kernel source tree. New packages are compiled against these headers, otherwise, if packages are compiled against headers that do not match the headers glibc was compiled against, segfaults or other strange problems may appear. /usr/include headers should be what matches the library object files. By copying the headers instead of symlink them to /usr/src/<linux>/include, we make sure that they remain available if we upgrade our kernel. | Kernel headers should be copied into /usr/include to be used by libraries and compiled programs. These should be the headers glibc has been compiled against, and should be kept independent of the ones in the kernel source tree. New packages are compiled against these headers, otherwise, if packages are compiled against headers that do not match the headers glibc was compiled against, segfaults or other strange problems may appear. /usr/include headers should be what matches the library object files. By copying the headers instead of symlink them to /usr/src/<linux>/include, we make sure that they remain available if we upgrade our kernel. |
| |
| | ====== Compiling the kernel ====== |
| | |
| | Useful in embedded systems, as only the strongly recommended options are set to Y: |
| | |
| | make help # provides a lot of information about kernel config options |
| | |
| | make allnoconfig # useful in embedded systems, setting the strongly recommended options to Y |
| | make clean # remove most generated files but keep config |
| | make mrproper # remove all generated files |
| | make defconfig # gives us a new config |
| | make LSMOD=... localmodconfig # uses the list of modules to create a configuration |
| | make distclean # also remove the editor backup and patch reject files |
| | |
| | make oldcondif # uses a provided .config as base |
| | |
| | scripts/diffconfig .config.old .config # shows difference between both kernel configurations |
| | |
| | interesting option: CONFIG_WERROR |
| | |
| | make |
| | make LOADADDR=0x80008000 uImage |
| | make dtbs |
| | |
| | [[https://github.com/a13xp0p0v/kconfig-hardened-check|Useful tool to check config security]] |
| | |
| ====== Process State ====== | ====== Process State ====== |
| |