Skip to content

Commit 0da1d4a

Browse files
committed
x86: Add "make tinyconfig" to configure the tiniest possible kernel
Since commit 5d2acfc ("kconfig: make allnoconfig disable options behind EMBEDDED and EXPERT") in 3.15-rc1, "make allnoconfig" disables every possible config option. However, a few configuration options (CC_OPTIMIZE_FOR_SIZE, OPTIMIZE_INLINING) produce a smaller kernel when turned on, and a few choices exist (compression, highmem, allocator) for which a non-default option produces a smaller kernel. Add a "tinyconfig" option, which starts from allnoconfig and then sets these options to configure the tiniest possible kernel. This provides a better baseline for embedded systems or efforts to reduce kernel size. Signed-off-by: Josh Triplett <josh@joshtriplett.org>
1 parent 3aaefce commit 0da1d4a

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

‎arch/x86/configs/tiny.config‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_NOHIGHMEM=y

‎kernel/configs/tiny.config‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
2+
CONFIG_KERNEL_XZ=y
3+
CONFIG_OPTIMIZE_INLINING=y
4+
CONFIG_SLOB=y

‎scripts/kconfig/Makefile‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ PHONY += kvmconfig
117117
kvmconfig:
118118
$(call mergeconfig,kvm_guest)
119119

120+
PHONY += tinyconfig
121+
tinyconfig: allnoconfig
122+
$(call mergeconfig,tiny)
123+
120124
# Help text used by make help
121125
help:
122126
@echo ' config - Update current config utilising a line-oriented program'
@@ -138,6 +142,7 @@ help:
138142
@echo ' listnewconfig - List new options'
139143
@echo ' olddefconfig - Same as silentoldconfig but sets new symbols to their default value'
140144
@echo ' kvmconfig - Enable additional options for guest kernel support'
145+
@echo ' tinyconfig - Configure the tiniest possible kernel'
141146

142147
# lxdialog stuff
143148
check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh

0 commit comments

Comments
 (0)