What is make oldconfig?

When you’re building the Linux kernel, one of the most important steps is configuring it. The kernel has thousands of options that can be enabled or disabled, and manually going through all of them would be incredibly time-consuming. This is where make oldconfig comes in.

The make oldconfig command is one of several configuration tools that come with the kernel source. Its main purpose is to update an existing configuration file (.config) with respect to new options available in a newer kernel version.

How does it work?

Let’s say you have a working .config file from an older kernel version and you’ve downloaded the source for a newer version. When you run make oldconfig, the script will parse your current .config file and compare it to the options available in the new kernel.

For each new option that doesn’t exist in your old file, make oldconfig will ask you if you want to enable it. You typically have the choice of:

  • Y (Yes): Enables the option and compiles it directly into the kernel image.
  • M (Module): Enables the option as a module that can be loaded and unloaded while the system is running.
  • N (No): Disables the option.
  • ? (Help): Displays a short description of the option.

This process ensures that you only have to make a decision on the new options, which saves a lot of time compared to make menuconfig or make xconfig, where you would have to go through all the options again.

Example usage

Here’s a typical scenario:

  1. You are in the main directory of the Linux kernel source.

  2. You have a .config file copied from an older, working kernel version.

  3. You run the command:

    make oldconfig
    
  4. Questions about new options will start to appear on the screen:

    Btrfs POSIX Access Control Lists (BTRFS_FS_POSIX_ACL) [Y/n/?] (NEW)
    
  5. You answer each question, and at the end, your .config file will be updated and ready to be used in the compilation process of the new kernel.

Summary

make oldconfig is a powerful tool for anyone who regularly compiles and updates the Linux kernel. It automates the configuration update process, allowing you to focus only on what’s new and changed, which makes the whole process much more efficient.