diff -Naur dkms-2.0.17.5/dkms dkms-2.0.17.5-min-max-kernel/dkms --- dkms-2.0.17.5/dkms 2008-01-22 21:32:48.000000000 +0000 +++ dkms-2.0.17.5-min-max-kernel/dkms 2008-01-22 21:33:38.000000000 +0000 @@ -324,6 +324,8 @@ PRE_INSTALL="" BUILD_EXCLUSIVE_KERNEL="" BUILD_EXCLUSIVE_ARCH="" + BUILD_MIN_KERNEL="" + BUILD_MAX_KERNEL="" build_exclude="" # Clear arrays @@ -522,10 +524,16 @@ # Set build_exclude if [ -n "$BUILD_EXCLUSIVE_KERNEL" ]; then - echo $1 | egrep -q "$BUILD_EXCLUSIVE_KERNEL" || build_exclude="yes" + echo $1 | egrep -q "$BUILD_EXCLUSIVE_KERNEL" || build_exclude="kernel does not match BUILD_EXCLUSIVE_KERNEL directive" fi if [ -n "$BUILD_EXCLUSIVE_ARCH" ]; then - echo $2 | egrep -q "$BUILD_EXCLUSIVE_ARCH" || build_exclude="yes" + echo $2 | egrep -q "$BUILD_EXCLUSIVE_ARCH" || build_exclude="arch does not match BUILD_EXCLUSIVE_ARCH directive" + fi + if [ -n "$BUILD_MIN_KERNEL" ]; then + [[ $(VER $1) > $(VER $BUILD_MIN_KERNEL) ]] || build_exclude="kernel version is inferior to BUILD_MIN_KERNEL directive" + fi + if [ -n "$BUILD_MAX_KERNEL" ]; then + [[ $(VER $1) < $(VER $BUILD_MAX_KERNEL) ]] || build_exclude="kernel version is superior to BUILD_MAX_KERNEL directive" fi # Fail if absolutely no DEST_MODULE_LOCATION @@ -1288,8 +1296,8 @@ # Error out if build_exclude is set if [ -n "$build_exclude" ]; then echo "" >&2 - echo "Error! The dkms.conf for this module includes a BUILD_EXCLUSIVE directive which" >&2 - echo "does not match this kernel/arch. This indicates that it should not be built." >&2 + echo "Error! $build_exclude" >&2 + echo "This indicates that this module should not be built." >&2 exit 9 fi