]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Do not attempt a DKMS build if the headers aren't available
authorRuss Allbery <rra@debian.org>
Mon, 30 Nov 2009 23:15:59 +0000 (15:15 -0800)
committerRuss Allbery <rra@debian.org>
Mon, 30 Nov 2009 23:15:59 +0000 (15:15 -0800)
* Do not attempt to build the kernel module with DKMS if the appropriate
  Linux headers aren't installed.  Based on code from the common DKMS
  postinst script (which we'll just use once it's reliably available).
  Thanks, Anders Kaseorg.  (LP: #487535)

debian/changelog
debian/openafs-modules-dkms.postinst

index 15457ff62f4cd4a8f647bf5d4057c7e35fe80af0..4c672caddc45d9c0332484d4cb89771a6ea60c84 100644 (file)
@@ -11,6 +11,10 @@ openafs (1.4.11+dfsg-6) UNRELEASED; urgency=low
     - [2d6c0390] Add array bounds checking in h_Enumerate
     - [70f6a328] Check for (hostFlags & HOSTDELETED) after h_Lock_r
     - [c7a59397] Avoid IHandle leak when failing to attach volume
+  * Do not attempt to build the kernel module with DKMS if the appropriate
+    Linux headers aren't installed.  Based on code from the common DKMS
+    postinst script (which we'll just use once it's reliably available).
+    Thanks, Anders Kaseorg.  (LP: #487535)
   * Change section of openafs-modules-dkms to kernel to match override.
 
  -- Russ Allbery <rra@debian.org>  Tue, 03 Nov 2009 23:27:49 -0800
index 556dbf710f3dabfba97a3664a55d8b0901d1838f..5a6d5f44789e82e156e9c927c7c23f603be2affd 100644 (file)
@@ -6,6 +6,7 @@ set -e
 package=openafs-modules-dkms
 version=`dpkg-query -W -f='${Version}' "$package" \
     | sed -e 's/[+-].*//' -e 's/\.dfsg.*//' -e 's/~//g'`
+kernel=`uname -r`
 
 # If someone installed this package without the necessary kernel headers, the
 # postinst will fail.  If they then fix this problem, the postinst will keep
@@ -16,8 +17,19 @@ if [ -e "/var/lib/dkms/openafs/$version" ] ; then
 fi
 dkms add -m openafs -v "$version"
 if [ "$1" = 'configure' ] ; then
-    dkms build -m openafs -v "$version"
-    dkms install -m openafs -v "$version" --force
+    if [ -e "/lib/modules/$kernel/build/include" ] ; then
+        dkms build -m openafs -v "$version"
+        dkms install -m openafs -v "$version" --force
+    else
+        cat >&2 <<"EOF"
+
+The OpenAFS module build for the currently running kernel was skipped since
+the kernel headers for this kernel do not seem to be installed.  To build
+the kernel module, install the appropriate kernel headers package for your
+kernel (usually linux-headers-$kernel).
+
+EOF
+    fi
 fi
 
 #DEBHELPER#