aboutsummaryrefslogtreecommitdiffstats
path: root/debian/prep-modules
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2017-06-12 15:52:53 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2017-06-12 18:00:59 +0100
commit7e67194fcc89ecaeea59fbc0b33807e24854a673 (patch)
tree0e190f100c00ec270d7e0e904fd78f9870f6ead5 /debian/prep-modules
parent8e085c53da268eb35edf1a521aade6348a9562aa (diff)
Set strict dependency on kernel version
The in-kernel API/ABI is (intentionally) not stable, so the binary kernel modules package must strictly depend on the same kernel that it was built against. Change-Id: I85cd6d465678e7693fb33659e3b4525730992cb0 Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'debian/prep-modules')
-rwxr-xr-xdebian/prep-modules17
1 files changed, 11 insertions, 6 deletions
diff --git a/debian/prep-modules b/debian/prep-modules
index 3e1f9f88..0caf81ed 100755
--- a/debian/prep-modules
+++ b/debian/prep-modules
@@ -31,10 +31,10 @@
# in the Debian kernel package names (in other words, the ABI version, not
# the package version).
#
-# * Make the package recommend linux-image-$(KVERS) as appropriate for the
-# kernel version that we're building against. Use recommend rather than
-# depends since the user may have built their own kernel outside of the
-# Debian package infrastructure.
+# * Make the package depend on linux-image-$(KVERS) (= version) as appropriate
+# for the kernel version that we're building against. Use depend as the
+# kernel ABI is not stable and it's not guaranteed that a module built
+# against a version of the headers will work under a different kernel.
#
# * Save the version number of the binary package in debian/VERSION for later
# use by dh_gencontrol. This will be the version number of the source
@@ -79,7 +79,12 @@ elif [ ! -f "$changelog" ] ; then
dpdk_kvers=`perl debian/kernel-version "$1"`
fi
if [ -z "$KDREV" ] ; then
- dpdk_kdrev="${dpdk_kvers}-1"
+ set +e
+ dpdk_kdrev=`dpkg-query -W -f='${Version}\n' linux-headers-${dpdk_kvers} 2> /dev/null`
+ if [ $? -ne 0 ] ; then
+ dpdk_kdrev="${dpdk_kvers}-1"
+ fi
+ set -e
else
dpdk_kvers="${dpdk_kvers}${INT_SUBARCH}"
dpdk_kdrev="${KDREV}"
@@ -101,7 +106,7 @@ dpdk_kdrev="$(echo "$dpdk_kdrev" | tr _ -)"
# Generate the control file from the template.
-sed "s/#KVERS#/${dpdk_kvers}/g" debian/control.modules.in > debian/control.modules
+sed -e "s/#KVERS#/${dpdk_kvers}/g" -e "s/#KDREV#/(= ${dpdk_kdrev})/g" debian/control.modules.in > debian/control.modules
# Now, calcuate the binary package version. Extract the epoch from the kernel
# package revision and add it to the beginning of the binary package version