[elbe-devel] [PATCH] debianize: Let the kernel headers overwrite files in linux-libc-dev.

Richard Cochran richardcochran at gmail.com
Sun Feb 12 09:57:15 CET 2017


When using pbuilder or when building a sysroot, elbe encounters a fatal
error similar to this:

    dpkg: error processing archive
    /var/cache/apt/archives/linux-headers-myboard-4.1.15_1_armhf.deb
    (--unpack): trying to overwrite '/usr/include/rdma/rdma_netlink.h',
    which is also in package linux-libc-dev:armhf 3.16.39-1

However, there is no harm in using the updated headers in the sysroot,
as the Linux kernel carefully preserves backward compatibility.

Moreover, we definitely prefer to have our custom headers in the
sysroot, since custom user space programs expect that the headers are
available in order to use the most current kernel interfaces.

This patch fixes the error by including the "Replaces" field in the
linux-headers package.  When used alone (that is, not in combination
with Breaks or Provides and Conflicts) this field allows files from
one package to overwrite individual files from another package.  To
quote the Debian Policy Manual, Section 7.6:

    Packages can declare in their control file that they should
    overwrite files in certain other packages, or completely replace
    other packages. The Replaces control field has these two distinct
    purposes.

    ...

    It is usually an error for a package to contain files which are on
    the system in another package. However, if the overwriting package
    declares that it Replaces the one containing the file being
    overwritten, then dpkg will replace the file from the old package
    with that from the new. The file will no longer be listed as
    "owned" by the old package and will be taken over by the new
    package.

Signed-off-by: Richard Cochran <richardcochran at gmail.com>
---
 elbepack/makofiles/debianize/kernel/control.mako | 1 +
 1 file changed, 1 insertion(+)

diff --git a/elbepack/makofiles/debianize/kernel/control.mako b/elbepack/makofiles/debianize/kernel/control.mako
index d72ba87..0c8d53c 100644
--- a/elbepack/makofiles/debianize/kernel/control.mako
+++ b/elbepack/makofiles/debianize/kernel/control.mako
@@ -17,6 +17,7 @@ Description: Linux kernel, version ${p_name} ${k_version}
 
 Package: linux-headers-${p_name}-${k_version}
 Provides: linux-headers, linux-headers-2.6
+Replaces: linux-libc-dev
 Architecture: ${p_arch}
 Description: Linux kernel headers
  This package provides kernel header files
-- 
2.1.4





More information about the elbe-devel mailing list