As a trivial example, let's add our own Boolean dummy config option within the General Setup menu. We want the config name to be CONFIG_LLKD_OPTION1. As can be seen from the preceding table, the relevant Kconfig file to edit is the init/Kconfig one as this is the menu meta file that defines the General Setup menu.
Let's get to it:
- To be safe, always make a backup copy:
cp init/Kconfig init/Kconfig.orig
- Now, edit the init/Kconfig file:
vi init/Kconfig
Scroll down to an appropriate location within the file; here, we choose to insert our menu entry just after the CONFIG_LOCALVERSION_AUTO one. The following screenshot shows our new entry:
Figure 2.12 – Editing init/Kconfig and inserting our own menu entry
We have provided the preceding text as a patch to the original init/Kconfig file in our book's GitHub source tree. Find it under ch2/Kconfig.patch.
The new item starts with...