From: Benjamin Kaduk Date: Thu, 23 Oct 2014 20:25:30 +0000 (-0400) Subject: Succeed when the kmod is missing X-Git-Tag: debian/1.6.10-1~5 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=60172a0ea8d86817ed5837fb7fa63498860f0907;p=packages%2Fo%2Fopenafs.git Succeed when the kmod is missing Otherwise we get an angry message from dpkg and a disabled state. --- diff --git a/debian/openafs-client-precheck b/debian/openafs-client-precheck index 0dfd6486a..e2927118a 100755 --- a/debian/openafs-client-precheck +++ b/debian/openafs-client-precheck @@ -7,6 +7,7 @@ if [ -f /etc/openafs/afs.conf ]; then fi CACHEINFO=${CACHEINFO:-/etc/openafs/cacheinfo} +MODULEROOT=${MODULEROOT:-/lib/modules/`uname -r`} # Exit if the package is not installed. [ -x /sbin/afsd ] || exit 1 @@ -32,7 +33,19 @@ if [ -z $(/sbin/lsmod | fgrep openafs) ]; then if [ $status -ne 0 ] ; then echo "Failed to load openafs.ko. Does it need to be built?" >&2 - exit $status + # We cannot fail hard on a missing module, though, as that will + # cause our unit to be put in a disabled state. + if $(grep -q openafs "$MODULEROOT/modules.dep"); then + exit $status + else + cat > /var/cache/openafs-client/openafs-client.env < /var/cache/openafs-client/openafs-client.env <