[Kernel-handbook-general] [PATCH kernel-handbook v2] Add a reminder to disable DEBUG_INFO in 'make deb-pkg' examples

Jonathan Nieder jrnieder at gmail.com
Sun Jul 22 06:27:24 UTC 2012


As mentioned in the "Disk space requirements" section, the
stock configuration for i386, amd64, and s390x produces an
absurdly large build tree and resulting kernel unless
CONFIG_DEBUG_INFO is disabled.

Signed-off-by: Jonathan Nieder <jrnieder at gmail.com>
Improved-by: Ben Hutchings <ben at decadent.org.uk>
---
Ben Hutchings wrote:
> On Sat, 2012-07-21 at 18:06 -0500, Jonathan Nieder wrote:

>> --- a/chapter-bugs.sgml
>> +++ b/chapter-bugs.sgml
>> @@ -395,6 +395,7 @@
>>  # apt-get install git build-essential
>>  $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>>  $ cd linux
>> +$ scripts/config --disable DEBUG_INFO
>
> But we don't have any config at this point.

True.  Sorry for the sloppiness.

[...]
>> @@ -409,6 +410,7 @@ $ cd linux-3.4
>>            The existing configuration file may be used as a starting point
>>            <example>
>>  $ cp /boot/config-3.2.0-2-686-pae ./.config
>> +$ scripts/config --disable DEBUG_INFO
>
> There are good reasons why some people want debug info, and they might
> be surprised to lose it in a custom configuration.  It's a useful
> suggestion but I don't think it should be part of the example.

I agree with your first statement, but isn't the usual case that
someone is copying the configuration from the kernel-image-$(uname -r)
package which has debug info enabled but stripped?

My patch made the mistake of suggesting disabling debug info without
explaining what's happening, but based on reactions from people
building the kernel I think that not mentioning it would be worse.

Luckily we don't have to choose between those two options.  How about
this?

 chapter-bugs.sgml         |    7 ++++---
 chapter-common-tasks.sgml |   11 ++++++++++-
 debian/changelog          |    1 +
 3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/chapter-bugs.sgml b/chapter-bugs.sgml
index f7b551ef..2c4e1673 100644
--- a/chapter-bugs.sgml
+++ b/chapter-bugs.sgml
@@ -395,12 +395,13 @@
 # apt-get install git build-essential
 $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
 $ cd linux
-$ make localmodconfig; # minimal configuration
 	  </example>
-	  The above commands acquire and configure a vanilla kernel.
-	  Build and test a binary package as explained in
+	  The above commands acquire a vanilla kernel.
+	  Configure, build and test a binary package as explained in
 	  <ref id="common-building">:
 	  <example>
+$ make localmodconfig; # minimal configuration
+$ scripts/config --disable DEBUG_INFO; # to keep the build reasonably small
 $ make deb-pkg
 # dpkg -i ../linux-image-3.5.0_3.5.0-1_i386.deb; # substitute package name from the previous command
 # reboot
diff --git a/chapter-common-tasks.sgml b/chapter-common-tasks.sgml
index f629e17e..d22501d8 100644
--- a/chapter-common-tasks.sgml
+++ b/chapter-common-tasks.sgml
@@ -53,7 +53,7 @@ $ tar jxf /usr/src/linux-source-3.2.tar.bz2
 	      </item>
 	    </taglist>
 	  </p>
-	  <sect2>
+	  <sect2 id="common-size">
 	    <heading>Disk space requirements</heading>
 	    <p>
 	      Building binary packages for a single kernel flavour
@@ -331,6 +331,15 @@ $ make menuconfig
 	  package.
 	</p>
 	<p>
+	  The build will use less disk space if the CONFIG_DEBUG_INFO
+	  option is disabled (see <ref id="common-size">).
+	  Debuginfo is only needed if you plan to use binary object
+	  tools like crash, kgdb, and SystemTap on the kernel.
+	  <example>
+$ scripts/config --disable DEBUG_INFO
+	  </example>
+	</p>
+	<p>
 	  After the configuration process is finished, the new or
 	  updated kernel configuration will be stored in
 	  <tt>.config</tt> file in the top-level directory. The build
diff --git a/debian/changelog b/debian/changelog
index be976167..437ae2af 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ kernel-handbook (1.0.15) UNRELEASED; urgency=low
 
   * Fix capitalization in "Applying patches or configuration changes"
     section
+  * Add a reminder to disable CONFIG_DEBUG_INFO in 'make deb-pkg' examples
 
  -- Jonathan Nieder <jrnieder at gmail.com>  Sat, 21 Jul 2012 17:30:35 -0500
 
-- 
1.7.10.4




More information about the Kernel-handbook-general mailing list