Skip to content

Commit

Permalink
x86: Add "make tinyconfig" to configure the tiniest possible kernel
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
joshtriplett committed Aug 8, 2014
1 parent 3aaefce commit 0da1d4a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/x86/configs/tiny.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_NOHIGHMEM=y
4 changes: 4 additions & 0 deletions kernel/configs/tiny.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_KERNEL_XZ=y
CONFIG_OPTIMIZE_INLINING=y
CONFIG_SLOB=y
5 changes: 5 additions & 0 deletions scripts/kconfig/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ PHONY += kvmconfig
kvmconfig:
$(call mergeconfig,kvm_guest)

PHONY += tinyconfig
tinyconfig: allnoconfig
$(call mergeconfig,tiny)

# Help text used by make help
help:
@echo ' config - Update current config utilising a line-oriented program'
Expand All @@ -138,6 +142,7 @@ help:
@echo ' listnewconfig - List new options'
@echo ' olddefconfig - Same as silentoldconfig but sets new symbols to their default value'
@echo ' kvmconfig - Enable additional options for guest kernel support'
@echo ' tinyconfig - Configure the tiniest possible kernel'

# lxdialog stuff
check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh
Expand Down

0 comments on commit 0da1d4a

Please sign in to comment.