From: Josh Triplett <josh@joshtriplett.org>
To: akpm@linux-foundation.org, torvalds@linux-foundation.org,
Sam Ravnborg <sam@ravnborg.org>,
David Rientjes <rientjes@google.com>,
"Luis R. Rodriguez" <mcgrof@suse.com>,
"H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v3 2/2] x86: Add "make tinyconfig" to configure the tiniest possible kernel
Date: Fri, 8 Aug 2014 17:10:12 -0700 [thread overview]
Message-ID: <20140809001010.GA9437@jtriplet-mobl1> (raw)
In-Reply-To: <20140807190243.GA5580@jtriplet-mobl1>
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>
---
Any architecture with architecture-specific tinification options just
needs to create arch/${arch}/configs/tiny.config, and "make tinyconfig"
will automatically pick up those options in addition to the
architecture-independent ones in kernel/configs/tiny.config.
arch/x86/configs/tiny.config | 1 +
kernel/configs/tiny.config | 4 ++++
scripts/kconfig/Makefile | 5 +++++
3 files changed, 10 insertions(+)
create mode 100644 arch/x86/configs/tiny.config
create mode 100644 kernel/configs/tiny.config
diff --git a/arch/x86/configs/tiny.config b/arch/x86/configs/tiny.config
new file mode 100644
index 0000000..4e2ecfa
--- /dev/null
+++ b/arch/x86/configs/tiny.config
@@ -0,0 +1 @@
+CONFIG_NOHIGHMEM=y
diff --git a/kernel/configs/tiny.config b/kernel/configs/tiny.config
new file mode 100644
index 0000000..c2de56a
--- /dev/null
+++ b/kernel/configs/tiny.config
@@ -0,0 +1,4 @@
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_KERNEL_XZ=y
+CONFIG_OPTIMIZE_INLINING=y
+CONFIG_SLOB=y
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 8083b94..ebf40f6 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -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
--
2.1.0.rc1
next prev parent reply other threads:[~2014-08-09 0:10 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Josh Triplett [this message]
2014-08-09 1:22 ` [PATCH v3 2/2] x86: Add "make tinyconfig" to configure the tiniest possible kernel Linus Torvalds
2014-08-11 18:15 ` josh
2014-08-11 19:36 ` Sam Ravnborg
2014-08-15 0:55 ` Luis R. Rodriguez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140809001010.GA9437@jtriplet-mobl1 \
--to=josh@joshtriplett.org \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@suse.com \
--cc=mingo@redhat.com \
--cc=rientjes@google.com \
--cc=sam@ravnborg.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).