From: Ian Abbott Date: Tue, 26 Jun 2012 17:46:33 +0000 (+0100) Subject: dkms.conf: Try harder when looking for ds.h X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0bf35c07a1cf1ed3a69770f7f20c53e26e4c24d0;p=comedi.git dkms.conf: Try harder when looking for ds.h 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 --- diff --git a/dkms.conf b/dkms.conf index c755ad64..32d7d09f 100644 --- 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"