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

Bug#783259: marked as done (linux-image-3.16.0-4-amd64: Indicating ABI changes from upstream)



Your message dated Fri, 24 Apr 2015 23:41:22 +0100
with message-id <1429915282.4063.42.camel@decadent.org.uk>
and subject line Re: Bug#783259: Debian kernel API for 3.16.7
has caused the Debian Bug report #783259,
regarding linux-image-3.16.0-4-amd64: Indicating ABI changes from upstream
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
783259: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=783259
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: src:linux
Version: 3.16.7-ckt9-2
Severity: normal

In looking into the cause of a recent build failure in the
lttng-modules-dkms package, I noticed that an incompatible ABI change
was made at some point.  The kmem.h header differs from the upstream
3.16.7 version. Specifically, the signature for 'trace_mm_page_alloc_extfrag'.

This is fine, if we could have a way to distinguish between upstream
3.16.7 and our version.  It appears that Ubuntu kernels introduce
a UTS_UBUNTU_RELEASE_ABI into their kernels, which can be used to follow
their own kernel versions.  Could we perhaps do the same?

Without the ability to do conditionals comparing numeric values both in
Makefiles and within C, I am not sure how tell the two different kernels
apart, and therefore am rather stuck.

-- 
Jon

--- End Message ---
--- Begin Message ---
On Fri, 2015-04-24 at 20:50 +0000, Mathieu Desnoyers wrote:
> Hi Ben,
> 
> Ben Hutchings <ben@decadent.org.uk> wrote:
> > On Fri, 2015-04-24 at 15:28 -0400, Jon Bernard wrote:
> [...]
> > > This is fine, if we could have a way to distinguish between upstream
> > > 3.16.7 and our version.  It appears that Ubuntu kernels introduce
> > > a UTS_UBUNTU_RELEASE_ABI into their kernels, which can be used to follow
> > > their own kernel versions.  Could we perhaps do the same?
> > 
> > I used to maintain OOT modules myself, trying to support basically every
> > distribution as well as mainline and stable kernels.  Version tests just
> > don't scale to this.  Instead, you need to use some kind of a configure
> > script to check the API of your target kernel.
> 
> Using version tests, we have scaled LTTng modules to support every kernels
> released over the past 5 years, from 2.6.36 to 4.0, including mainline and
> stable releases, as well as distribution kernels for every major distribution
> out there.
> 
> I understand that this approach has not scaled well for your use case, but
> it appears to work pretty well for us.
> 
> > 
> > > Without the ability to do conditionals comparing numeric values both in
> > > Makefiles and within C, I am not sure how tell the two different kernels
> > > apart, and therefore am rather stuck.
> > 
> > ABI changes are indicated by bumping the number after the dash in the
> > kernel version string (3.16.0-3 to 3.16.0-4).  But you actually need to
> > know about the API, not the ABI.  Not all changes to the API change the
> > ABI, and vice versa.
> 
> Good point, the ABI is not exactly what we need to track. This should
> perhaps be referred to as a publicly exposed API then. Still, it would
> greatly help us to have this version number available as a numeric value.

Here's a shell script fragment that should do the trick:

# Assuming KPATH is the target kernel headers directory
DEB_PACKAGE_VERSION=$(sed -rn 's/^#define LINUX_PACKAGE_ID " Debian (.*)"/\1/p' $KPATH/include/generated/package.h)
# Ignore backports part
DEB_PACKAGE_VERSION=$(echo $DEB_PACKAGE_VERSION | sed -r 's/~(bpo|deb).*//')
# Get -ckt update number, if present
KERNEL_CKT_UPDATE=$(echo $DEB_PACKAGE_VERSION | sed -rn 's/^[0-9]+\.[0-9]+\.[0-9]+-ckt([0-9]+).*/\1/p')
test -n "$KERNEL_CKT_UPDATE" || KERNEL_CKT_UPDATE=0
# Get package revision
DEB_PACKAGE_REVISION=$(echo $DEB_PACKAGE_VERSION | sed -r 's/.*-([^-]+)$/\1/')
# Get non-sec update number
DEB_PACKAGE_REVISION_BASE=$(echo $DEB_PACKAGE_REVISION | sed -r 's/^([0-9]+).*/\1/')
# Get security update number, if present
DEB_PACKAGE_REVISION_SECURITY=$(echo $DEB_PACKAGE_REVISION | sed -rn 's/.*\+(squeeze|deb[0-9])+u([0-9]+)$/\1/p')
test -n "$DEB_PACKAGE_REVISION_SECURITY" || DEB_PACKAGE_REVISION_SECURITY=0
# Combine all update numbers into one
DEB_API_VERSION=$((KERNEL_CKT_UPDATE * 10000 + DEB_PACKAGE_REVISION_BASE * 100 + DEB_PACKAGE_REVISION_SECURITY))

Ben.

-- 
Ben Hutchings
Man invented language to satisfy his deep need to complain. - Lily Tomlin

Attachment: signature.asc
Description: This is a digitally signed message part


--- End Message ---

Reply to: