Contributing to the Linux Kernel—The Linux Configuration

Learn the correct procedures for submitting a patch to the kernel.
Setting up the Default Configs

At this point, you have your patch surrounded by defines which correspond to configuration options. You can now toggle the use of your patch in the configurator. The hardest part is done, now we just need to fill in some loose ends.

As you have probably noticed if you have used Linux on more than one architecture, there are different options for each of the different platforms. Thus far, you have not concerned yourself with making much of that distinction, but now it is time. In order to modify the defconfig file the right way, you'll need to take a couple of steps. First, you should back up your .config file with your personal configuration settings. Replace that file with a copy of arch/<whatever>/defconfig and rerun the configurator. Select whatever option you would like to be the default for your config option, and save that file. Replace defconfig with the new .config and replace the old one. You now have a new default configuration file built for your architecture.

If your patch works for multiple architectures (for example, it's a generic network protocol type or something that is generally applicable), you'll want to make default config files for all the architectures it supports. This can be done most easily be repeating the steps above, except first changing the ARCH line in the source Makefile to reflect the architecture you are building the config file for.

The Help File

The final and often overlooked portion of a patch is the help file that must accompany the configuration option. The file in question is Documentation/Configure.help. The format of that file is something like this (or see the attached example):

<description>
<variable name>
<help file>
In addition, it should be noted that there must be an extra blank line between config files, and newer kernels support having blank lines in the help text itself, provided that the blank line actually contains a space or other white space.

It is highly advised that you attempt to locate a portion of this file that roughly corresponds to what your option is for. Often, but not always, options in similar places in the configuration menus will have similar places in the help file, and that can serve as a helpful indication as to the best place to put your particular piece. If you still do not know where to put everything, I advise sending e-mail to the current help maintainer with a question and a brief description of what your patch does (maybe even include the help text you would like to have added).

Conclusion

You should be done at this point. Before you can send off your patch for submission, it is wise to compile it both enabled and disabled and make sure both kernels work properly. If there are dependencies, make sure they are working correctly and that all the options you would expect to have, you have, and vice versa. And finally, you should send your patch to the kernel list and request bug reports before you announce it as being done to Linus and the gang, or be prepared for a heavy dose of reality, especially if you made changes that impact architectures you don't actually have.

CML2: A New, Easier Kernel Configuration System by Eric S. Raymond

email: jpranevich@lycos.com

Joseph Pranevich (jpranevich@lycos.com) is an avid Linux geek, and while not working for Lycos, enjoys writing (all kinds) and working with a number of open-source projects.

______________________

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState