All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: Add "make tinyconfig" to configure the tiniest possible kernel
@ 2014-08-06 17:14 Josh Triplett
  2014-08-06 22:06 ` David Rientjes
  0 siblings, 1 reply; 21+ messages in thread
From: Josh Triplett @ 2014-08-06 17:14 UTC (permalink / raw)
  To: akpm, torvalds, H. Peter Anvin, Ingo Molnar, Thomas Gleixner,
	x86, linux-kernel

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" target, 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/Makefile            | 6 ++++++
 arch/x86/configs/tiny.config | 5 +++++
 2 files changed, 11 insertions(+)
 create mode 100644 arch/x86/configs/tiny.config

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index c65fd96..f20abcd 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -253,6 +253,11 @@ kvmconfig:
 	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(srctree)/arch/x86/configs/kvm_guest.config
 	$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
 
+PHONY += tinyconfig
+tinyconfig: allnoconfig
+	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(srctree)/arch/x86/configs/tiny.config
+	$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
+
 define archhelp
   echo  '* bzImage      - Compressed kernel image (arch/x86/boot/bzImage)'
   echo  '  install      - Install kernel using'
@@ -267,4 +272,5 @@ define archhelp
   echo  '                  FDARGS="..."  arguments for the booted kernel'
   echo  '                  FDINITRD=file initrd for the booted kernel'
   echo  '  kvmconfig	- Enable additional options for guest kernel support'
+  echo  '  tinyconfig   - Configure the tiniest possible kernel'
 endef
diff --git a/arch/x86/configs/tiny.config b/arch/x86/configs/tiny.config
new file mode 100644
index 0000000..8f0e54c
--- /dev/null
+++ b/arch/x86/configs/tiny.config
@@ -0,0 +1,5 @@
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_KERNEL_XZ=y
+CONFIG_NOHIGHMEM=y
+CONFIG_OPTIMIZE_INLINING=y
+CONFIG_SLOB=y
-- 
2.0.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2014-08-15  0:55 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-06 17:14 [PATCH] x86: Add "make tinyconfig" to configure the tiniest possible kernel Josh Triplett
2014-08-06 22:06 ` David Rientjes
2014-08-06 22:24   ` Josh Triplett
2014-08-06 22:30     ` [PATCH 1/2] x86, platform, kconfig: move kvmconfig functionality to a helper Josh Triplett
2014-08-06 22:33       ` David Rientjes
2014-08-06 22:39         ` Josh Triplett
2014-08-06 22:42           ` David Rientjes
2014-08-06 22:31     ` [PATCH 2/2] x86: Add "make tinyconfig" to configure the tiniest possible kernel Josh Triplett
2014-08-06 22:38       ` David Rientjes
2014-08-06 22:49         ` Josh Triplett
2014-08-06 23:37           ` David Rientjes
2014-08-07  0:04             ` Josh Triplett
2014-08-07 16:03       ` Sam Ravnborg
2014-08-07 19:02         ` Josh Triplett
2014-08-07 19:38           ` Sam Ravnborg
2014-08-09  0:07           ` [PATCH v3 1/2] x86, platform, kconfig: move kvmconfig functionality to a helper Josh Triplett
2014-08-09  0:10           ` [PATCH v3 2/2] x86: Add "make tinyconfig" to configure the tiniest possible kernel Josh Triplett
2014-08-09  1:22             ` Linus Torvalds
2014-08-11 18:15               ` josh
2014-08-11 19:36                 ` Sam Ravnborg
2014-08-15  0:55                   ` Luis R. Rodriguez

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.