Compiling and installing

  • make
    • in the main kernel source directory
    • Remember to run multiple jobs in parallel if you have multiple CPU cores. Example: make -j 4
    • No need to run as root!
  • Generates
  • vmlinux, the raw uncompressed kernel image, in the ELF format, useful for debugging purposes, but cannot be booted
  • arch//boot/*Image, the final, usually compressed, kernel image that can be booted
    • bzImage for x86, zImage for ARM, vmImage.gz for Blackfin, etc.
  • arch//boot/dts/*.dtb, compiled Device Tree files (on some architectures)
  • All kernel modules, spread over the kernel source tree, as .ko files

  • make install

    • Does the installation for the host system by default, so needs to be run as root. Generally not used when compiling for an embedded system, as it installs files on the development workstation.
  • Installs

    • /boot/vmlinuz-
      Compressed kernel image. Same as the one in arch//boot
    • /boot/System.map-
      Stores kernel symbol addresses
    • /boot/config- Kernel configuration for this version
  • Typically re-runs the bootloader configuration utility to take the new kernel into account.

Module installation

  • make modules_install
    • Does the installation for the host system by default, so needs to be run as root
  • Installs all modules in /lib/modules//
    • kernel/ Module .ko (Kernel Object) files, in the same directory structure as in the sources.
    • modules.alias
    • Module aliases for module loading utilities. Example line: alias sound-service-?-0 snd_mixer_oss
    • modules.dep, modules.dep.bin (binary hashed) Module dependencies
    • modules.symbols, modules.symbols.bin (binary hashed) Tells which module a given symbol belongs to.

Kernel cleanup targets

  • Clean-up generated files (to force re-compilation): make clean
  • Remove all generated files. Needed when switching from one architecture to another. Caution: it also removes your .config file! make mrproper
  • Also remove editor backup and patch reject files (mainly to generate patches): make distclean

results matching ""

    No results matching ""