Re: building 2.6.26 kernel source fails on squeeze
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
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?
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
Thank you for your assistance with this. It has been most helpful.
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
@@ -90,7 +90,7 @@
- <heading>Applying patches</heading>
+ <heading>Applying patches or configuration changes</heading>
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.
+ To change the configuration before building, for example
+ for the 686-bigmem flavour on i386, run the commands:
+$ fakeroot make -f debian/rules.gen setup_i386_none_686-bigmem
+$ make -C debian/build/build_i386_none_686-bigmem menuconfig
+ Patches or configuration changes to the kernel may alter
+ the kernel Application Binary Interface (ABI).
+ 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.
+ Enabling or changing the configuration of a single driver
+ usually doesn't change the ABI, because most drivers don't
+ export anything.
+ 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
+ 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.
+ 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
+$ fakeroot debian/rules debian/control-real
+ to regenerate the package definitions for this ABI name.
<heading>Building many packages</heading>
@@ -125,17 +179,45 @@
<heading>Building packages for one flavour</heading>
- 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
$ fakeroot debian/rules source
$ fakeroot make -f debian/rules.gen binary-arch_i386_none_686
- 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
Replace the <tt><em>featureset</em></tt> with
<tt>none</tt> if you do not want any of the extra
+ featuresets. You will also need
+ the <tt>linux-headers-<em>version</em>-common</tt> binary
+ package, which can be built using the commands:
+$ fakeroot debian/rules source
+$ fakeroot make -f debian/rules.gen binary-arch_i386_none_real
+ The target in this command has the general form of
+ <heading>Modifying the kernel config</heading>
+ 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
+ $ fakeroot debian/rules debian/control-real
+ Then follow instructions as explained in previous sub-sections
+ of <ref id="common-official">.