dkms.conf: Try harder when looking for ds.h
authorIan Abbott <abbotti@mev.co.uk>
Tue, 26 Jun 2012 17:46:33 +0000 (18:46 +0100)
committerIan Abbott <abbotti@mev.co.uk>
Tue, 26 Jun 2012 17:46:33 +0000 (18:46 +0100)
Some distros don't create /lib/modules/${kernelver}/source directory or
symlink, so the use of the
/lib/modules/${kernelver}/source/include/pcmcia/ds.h fails.  In this
case, use ${kernel_source_dir}/include/pcmcia/ds.h and hope for the
best.

This is useful for some versions of Ubuntu at least.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
dkms.conf

index c755ad6406045097e71fad897d970f348733da40..32d7d09ff2c154f91eb91c380ff72eefb459fb04 100644 (file)
--- a/dkms.conf
+++ b/dkms.conf
@@ -369,8 +369,14 @@ DEST_MODULE_LOCATION[$((nn++))]="/kernel/comedi/drivers/"
 fi
 # PCMCIA driver modules
 # (Try and mimic checks done by configure script.)
-if grep -q '^CONFIG_PCMCIA=[ym]' ${kernel_source_dir}/.config 2>/dev/null &&
-  tr '\n' ' ' < /lib/modules/${kernelver}/source/include/pcmcia/ds.h 2>/dev/null |
+if grep -q '^CONFIG_PCMCIA=[ym]' ${kernel_source_dir}/.config 2>/dev/null ; then
+if test -d /lib/modules/${kernelver}/source ; then
+       src=/lib/modules/${kernelver}/source
+else
+       src=${kernel_src_dir}
+fi
+if test -f ${src}/include/pcmcia/ds.h ; then
+if tr '\n' ' ' < ${src}/include/pcmcia/ds.h 2>/dev/null |
     grep -q 'struct[[:space:]]\+pcmcia_driver[[:space:]]*{[^}]*probe' ; then
 BUILT_MODULE_NAME[$nn]="cb_das16_cs"
 BUILT_MODULE_LOCATION[$nn]="comedi/drivers/"
@@ -394,6 +400,8 @@ BUILT_MODULE_NAME[$nn]="quatech_daqp_cs"
 BUILT_MODULE_LOCATION[$nn]="comedi/drivers/"
 DEST_MODULE_LOCATION[$((nn++))]="/kernel/comedi/drivers/"
 fi
+fi
+fi
 # real-time driver modules
 if grep -q '^CONFIG_\(RTHAL\|ADEOS\|IPIPE\)=y' ${kernel_source_dir}/.config 2>/dev/null ; then
 BUILT_MODULE_NAME[$nn]="comedi_rt_timer"