User:Egberts/Drafts/Gentoo Kernel Configuration Guide
Editor: this section gets inserted into Kernel/Gentoo Kernel Configuration Guide or into Kernel/Configuration
Advanced Kernel Configurations
Linux kernel also has provided two scripts to assist with updating kernel configuration settings (without having to tediously navigate through make menuconfig:
- change a single setting; linux/scripts/config command (introduced 3.33rc1+)
- change many kernel configuration settings; linux/scripts/kconfig/merge_config.sh command (introduced 2.6.29-rc1+)
Single Option approach
One way to change the .config at the command line is to change one-line per command evocation.
An example of changing four(4) settings is shown below:
./scripts/config --set-val CONFIG_OPTION y
./scripts/config --enable CONFIG_BRIDGE
./scripts/config --enable CONFIG_MODULES
./scripts/config --disable CONFIG_X25
./scripts/config --module CONFIG_NFT make oldconfig
(updates dependencies; may prompt with new dependencies, but old deps silently goes away)
Multiple-File Merge approach
When building and customizing Linux kernel repeatedly, it becomes a time-saver to incorporate all the settings into a single (but smaller) kernel configuration file. Each kernel configuration file would represent a certain feature, device, or functionality.
This makes grouping of many settings of kernel configurations less forgetful and easily referenced by a (descriptive) filename that can be easily inserted into a Linux kernel configuration.
Given the two example files:
CONFIG_HIBERNATION=n CONFIG_AUTOSLEEP=n CONFIG_ACPI_SLEEP=n CONFIG_PM_SLEEP=n
# Terminus Font is a clean, fixed width bitmap font, # designed for long (8 and more hours per day) work with # computers. This is the high resolution, large version # for use with HiDPI screens. CONFIG_FONTS=y CONFIG_FONT_SUPPORT=y CONFIG_FONT_TER16x32=y
# Auto-add/auto-remove CONFIG_ dependencies
The command to update the default /usr/src/linux/.config file is:
Now the kernel will incorporate both readable terminals and ensure that it would never hibernate nor sleep.