x86: Add "make tinyconfig" to configure the tiniest possible kernel
authorJosh Triplett <josh@joshtriplett.org>
Fri, 8 Aug 2014 23:25:47 +0000 (16:25 -0700)
committerJosh Triplett <josh@joshtriplett.org>
Fri, 8 Aug 2014 23:30:24 +0000 (16:30 -0700)
Since commit 5d2acfc7b974bbd3858b4dd3f2cdc6362dd8843a ("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>
arch/x86/configs/tiny.config [new file with mode: 0644]
kernel/configs/tiny.config [new file with mode: 0644]
scripts/kconfig/Makefile

diff --git a/arch/x86/configs/tiny.config b/arch/x86/configs/tiny.config
new file mode 100644 (file)
index 0000000..4e2ecfa
--- /dev/null
@@ -0,0 +1 @@
+CONFIG_NOHIGHMEM=y
diff --git a/kernel/configs/tiny.config b/kernel/configs/tiny.config
new file mode 100644 (file)
index 0000000..c2de56a
--- /dev/null
@@ -0,0 +1,4 @@
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_KERNEL_XZ=y
+CONFIG_OPTIMIZE_INLINING=y
+CONFIG_SLOB=y
index 8083b94b45eebc96f626de0827a80d50a912db55..ebf40f6edb4d4ee5f847a103cb082bcddec99dd6 100644 (file)
@@ -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'
@@ -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