1 AUTHOR: Bruce Dubbs <bdubbs@linuxfromscratch.org>
5 LICENSE: The MIT License
7 SYNOPSIS: Considerations when configuring the Linux kernel
13 When building an LFS system, the last package built is the kernel itself. This is
14 the most complicated package to configure in LFS and is the most variable among users.
15 This hint is provided to help users decide how to configure their kernel.
17 REFERENCES: In the kernel tarball:
19 Documentation/kbuild/kconfig.txt
21 Documentation/devices.txt
22 Documentation/filesystems/
23 Documentation/laptops/
26 Documentation/networking/
29 There are many other files in the documentation tree that can give
30 detailed information about kernel options.
35 The process of building the kernel is described in Chapter 8 of the LFS
36 book. However, detailed instruction on the configuration of the kernel
37 depend on many factors. This hint is an attempt to help the new user
38 through the complicated process of selecting configuration parameters.
40 The primary output of the configuration process is the .config file,
41 however even if a .config file is placed into the linux package tree, one
42 of the configuration processes must be run to set up other internal files
43 necessary for the build process to complete properly.
45 One rule of thumb to use in selecting configuration items is when in doubt,
46 use the default for that option.
48 1. Starting the configuration process
50 The configuration file is in the root of the linux directory with the name
51 .config. It is an ascii file with entries such as:
56 CONFIG_LOCALVERSION=""
57 CONFIG_LOCALVERSION_AUTO=y
58 # CONFIG_IPC_NS is not set
62 This is the primary user interface to kernel configuration. It is a
63 ncurses based application that generates a menu tree for a user to select
64 configuration items. Using the enter key and the arrow keys, you can
65 examine each item, including a help page.
67 The "Enter" key selects an option from the bottom of the page. Which item
68 that is selected is controlled by the left and right arrow keys.
69 <Select> goes down to a submenu if the selected line has a trailing ---> symbol.
70 <Exit> goes up a menu. If at the top menu, the program is exited.
71 <Help> brings up a page explaining the current option.
73 The current item is selected with the up and down arrow key. The space bar
74 toggles the selection between 'build into the kernel' annotated with a [*],
75 'build as a loadable module' annotated as [M], or don't build at all
80 This is a Qt based GUI interface to the menu items. It utilizes a mouse to
81 make selections and scroll windows. Clicking on an item performs the same
82 functions as the spacebar in menuconfig.
86 A command line interface is available to take an old configuration file and
87 port it to the new kernel. To use it, run:
89 cp user/some/old.config .config
92 The program will prompt you for missing or changed options. The prompt will
93 end with something like:
95 Group CPU scheduler (GROUP_SCHED) [N/y/?] (NEW)
97 Responding with <return> takes the first (capitalized) option. In some
98 cases, the choice will look like:
100 PCI slot detection driver (ACPI_PCI_SLOT) [N/m/y/?] (NEW)
102 if building as a module is available. To override the default, just type
103 the appropriate letter.
105 New kernel releases often introduce new config symbols. Often more
106 important, new kernel releases may rename config symbols. When this
107 happens, using a previously working .config file and running "make
108 oldconfig" won't necessarily produce a working new kernel for you, so you
109 may find that you need to see what NEW kernel symbols have been introduced.
111 To see a list of new config symbols when using "make oldconfig", use
113 cp user/some/old.config .config
114 yes "" | make oldconfig > conf.new
115 grep "(NEW)" conf.new
119 Use the default symbol values from either arch/$ARCH/defconfig
120 or arch/$ARCH/configs/${PLATFORM}_defconfig, depending on the architecture.
122 For most LFS systems, $ARCH will be x86 and ${PLATFORM} will be i386 or
123 x86_64. These values are derived from the uname utility.
127 A list of configuration targets and other utilities.
132 Most commercial distributions build as many options as possible as modules. This
133 allows the kernel to only load what it needs when it needs it. It also takes
134 a lot of space and increases boot time by trying virtually every driver it has
135 available. For instance an Ubuntu system has 97 MB of modules.
137 Allowing modules is not required. They can be turned off with a kernel configuration
138 option. However, if this is done, it precludes using some proprietary modules
139 like Nvidia or VMware drivers.
141 Since LFS does not use an initrd, some drivers like disk and filesystem drivers
142 for the root partition are required to be built into the kernel. Most often these
143 are just SATA (CONFIG_ATA) or PATA (CONFIG_IDE) drivers and the ext3
144 (CONFIG_EXT3_FS) drivers,
146 On an LFS system, you presumably know (or can find out with tools such as lspci)
147 what hardware you have on your system. I recommend that you minimize the modules
148 that you build. After all, you can always go back and recompile with different
151 Loading modules can be controlled with /etc/modprobe.conf. For more details see
152 man 5 modprobe.conf. Additionally, modules can be loaded automatically by the
153 LFS modules boot script when directed by its configuration file,
154 /etc/sysconfig/modules.
156 3. Configuration sections
158 The main menu if the configuration programs is split out into the
163 Provides overall Linux options.
165 b. Enable loadable module support
167 Provides the ability to load kernel modules. Sub-options
168 provide additional capabilities related to modules.
170 c. Enable the block layer
172 This needs to be enabled to be able to mound any disk drive.
174 d. Processor type and features
176 The defaults will set most of these properly for
177 your hardware, but you may want to disable options that
178 may not apply such as Multi-core scheduler support. You
179 can also set the number of CPUs that the kernel supports.
181 You can also set support for some specific laptop brands.
183 e. Power management and ACPI options
185 Controls ACPI (Advanced Configuration and Power Interface) or
186 APM (Advanced Power Management) BIOS support. These options are most
189 f. Bus options (PCI etc)
191 Generally only PCI suport is needed here on newer systems. Go
194 g. Executable file formats / Emulations
196 Generally only ELF support is needed.
198 h. Networking support
200 This is where networking (including wireless) is enabled.
201 Netfilter (firewall) capabilities are also defined here.
202 The defaults are generally satisfactory.
206 This is one of the most important configuration areas. If you want
207 the hardware to work, it has to be enabled with a driver. Check
208 your devices on a currently running system with `lspci -v` to
209 confirm what hardware you have. Enable any network or usb devices
210 that you may have. Video drivers and sound cards are also enabled
213 Take your time in this section and make sure you add drivers for
214 all the hardware you want to use.
218 The default is generally OK here.
222 If you want reiser, ext4, jfs, xfs, kernel automounter support, or nfs,
223 you need to select those capabilities here.
227 If you make changes here, you better know why.
231 The defaults are generally OK here too.
235 Specialized crytographic capabilites. The defaults are OK here.
237 o. Virtualization (NEW)
239 Allows using your Linux host to run other operating systems inside
240 virtual machines (guests).
244 Various CRC routines. The defaults are generally appropriate here
245 unless you have special requirements.
251 Fix Typos. Add pointer to /etc/sysconfig/modules. Thanks to Trent Shea.
253 Add discusssion of some additional make options.