[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: building 2.6.26 kernel source fails on squeeze




Hi Ben,

On Tue, 19 Apr 2011, Ben Hutchings wrote:

On Tue, 2011-04-19 at 05:00 +0100, Ben Hutchings wrote:
[...]
I've attempted to document this, since it currently does not appear to be.
See patch to kernel handbook below. I'm sure I'm made errors, so
corrections, please.
[...]

Thanks.  I'll apply something like that, but change 'is necessary' to
'may be necessary.

I ended up making some more changes and included the new text in the
'applying patches' section.  Do you think this covers it?

Ben.

I've made some more changes - mostly additions - to your patch. I've
included your ABI comments almost verbatim, because I think they are
interesting and it is useful for people to have an idea of what is
going on. If you disagree, of course please feel free to remove them,
or indeed make any suitable changes or clarifications you think are
necessary.

Thank you for your assistance with this. It has been most helpful.

                                                      Regards, Faheem

diff -r 657cba972ce9 -r 0959d26b78d1 chapter-common-tasks.sgml
--- a/chapter-common-tasks.sgml	Mon Apr 18 11:54:22 2011 +0530
+++ b/chapter-common-tasks.sgml	Sat Apr 23 22:08:17 2011 +0530
@@ -45,7 +45,7 @@

 	  The version <tt><em>version</em>-<em>N</em></tt> (like
2.6.18-8) of the <tt>linux-patch-debian-<em>version</em></tt> - package contains all the individual patches applied to the
+ 	  package contains all the individual patches applied to the
 	  source to achieve any patchlevel up to <tt><em>N</em></tt>.
 	  They are stored in the directory
 	  <tt>/usr/src/kernel-patches/all/<em>version</em>/debian/</tt>.
@@ -90,7 +90,7 @@
 	  </p>
 	</sect1>
 	<sect1>
-	  <heading>Applying patches</heading>
+	  <heading>Applying patches or configuration changes</heading>
 	  <p>
 	    It is possible to apply extra patches to the source before
 	    starting the build. First, you should apply the existing
@@ -104,6 +104,60 @@
 	    (featuresets added).  You should apply the extra patches in
 	    the appropriate subdirectory.
 	  </p>
+	  <p>
+	    To change the configuration before building, for example
+	    for the 686-bigmem flavour on i386, run the commands:
+	    <example>
+$ fakeroot make -f debian/rules.gen setup_i386_none_686-bigmem
+$ make -C debian/build/build_i386_none_686-bigmem menuconfig
+	    </example>
+	  </p>
+	  <p>
+	    Patches or configuration changes to the kernel may alter
+	    the kernel Application Binary Interface (ABI).
+	  </p>
+	  <p>
+            If an exported function is conditional on CONFIG_FOO, or
+            it uses a type whose definition depends on CONFIG_FOO,
+            then turning CONFIG_FOO on or off changes the ABI of that
+            function, and thus of the kernel as a whole.
+	  </p>
+	  <p>
+	    Enabling or changing the configuration of a single driver
+	    usually doesn't change the ABI, because most drivers don't
+	    export anything.
+	  </p>
+	  <p>
+	    The kernel build process generates a 'symbol version' for
+	    each exported function or variable.  This is a hash of the
+	    definitions that it depends on, and should change whenever
+	    the function's ABI changes.  The kernel module loader
+	    detects incompatible modules by comparing symbol versions.
+	    The whole set of symbol versions represents the kernel
+	    ABI.
+	  </p>
+	  <p>
+	    We collect the symbol versions for previously uploaded
+	    packages under the directory debian/abi and then compare
+	    the new kernel with those.  If the ABI name is unchanged
+	    but the ABI itself is changed - except for additions, or
+	    changes that we have marked as acceptable - then the build
+	    is aborted.
+	  </p>
+	  <p>
+	    If the kernel ABI has changed you must then change the ABI
+	    name.  This is the part after the upstream version in
+	    package names and in the output of
+	    <tt>uname -r</tt>. For example, in the package name
+	    <tt>linux-image-2.6.38-2-686-bigmem</tt> it is
+	    the <tt>2</tt>. It is defined by the <tt>abiname</tt>
+	    in <tt>debian/config/defines</tt>. For example,
+	    <tt>abiname: custom1.0</tt>. Then run the command
+	    <example>
+$ fakeroot debian/rules debian/control-real
+	    </example>
+	    to regenerate the package definitions for this ABI name.
+	  </p>
 	</sect1>
 	<sect1>
 	  <heading>Building many packages</heading>
@@ -125,17 +179,45 @@
 	<sect1>
 	  <heading>Building packages for one flavour</heading>
 	  <p>
-	    For example, to build only the binary packages for 686
-	    flavour on i386 architecture, use the following commands:
+	    For example, to build only the <tt>linux-image-<em>version</em></tt> and
+	    <tt>linux-headers-<em>version</em></tt> binary packages
+	    for 686 flavour on i386 architecture, use the following
+	    commands:
 	    <example>
 $ fakeroot debian/rules source
 $ fakeroot make -f debian/rules.gen binary-arch_i386_none_686
 	    </example>
-	    The target in this command has the general form of
+	    The <tt>debian/rules source</tt> copies and patches the
+	    upstream source.  The target in this command has the
+	    general form of
 	    <tt><em>target</em>_<em>arch</em>_<em>featureset</em>_<em>flavour</em></tt>.
 	    Replace the <tt><em>featureset</em></tt> with
 	    <tt>none</tt> if you do not want any of the extra
-	    featuresets.
+	    featuresets. You will also need
+	    the <tt>linux-headers-<em>version</em>-common</tt> binary
+	    package, which can be built using the commands:
+	    <example>
+$ fakeroot debian/rules source
+$ fakeroot make -f debian/rules.gen binary-arch_i386_none_real
+	    </example>
+	    The target in this command has the general form of
+	    <tt><em>target</em>_<em>arch</em>_<em>featureset</em>_<em>real</em></tt>.
+	  </p>
+	</sect1>
+	<sect1>
+	  <heading>Modifying the kernel config</heading>
+	  <p>
+	    When changing the kernel config, it is necessary to also
+	    change the ABI. This can be done by changing
+	    the <tt>abiname</tt> in
+	    <tt>debian/config/defines</tt>. For
+		example, <tt><em>abiname: custom1.0</em></tt>. Then
+		run the command
+	    <example>
+	      $ fakeroot debian/rules debian/control-real
+	    </example>
+	    Then follow instructions as explained in previous sub-sections
+	    of <ref id="common-official">.
 	  </p>
 	</sect1>
 	<sect1>


Reply to: