-# Only care about the rest if it is a -ckt kernel, making sure we do not
-# clash with older Debian kernels (e.g. Debian 3.2.65-1+deb7u2).
-if [ -z "${KERNEL_CKT_UPDATE}" ]; then
- echo 0
- exit 0
-fi
+# ckt (Canonical Kernel Team) kernels were used for a while during the jessie
+# cycle, their versionning is a bit different. They track the upstream vanilla
+# stable updates but they don't update the minor version number and instead add
+# an additionnal -cktX. They were all 3.16.7-cktX and after a while the version
+# switched back to upstream style at 3.16.36.
+
+# 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