2 dnl # Determine an available miscellaneous minor number which can be used
3 dnl # for the /dev/zfs device. This is needed because kernel module
4 dnl # auto-loading depends on registering a reserved non-conflicting minor
5 dnl # number. Start with a large known available unreserved minor and work
6 dnl # our way down to lower value if a collision is detected.
8 AC_DEFUN([ZFS_AC_KERNEL_MISC_MINOR], [
9 AC_MSG_CHECKING([whether /dev/zfs minor is available])
11 for i in $(seq 249 -1 200); do
12 if ! grep -q "^#define\s\+.*_MINOR\s\+.*$i" \
13 ${LINUX}/include/linux/miscdevice.h; then
15 AC_MSG_RESULT($ZFS_DEVICE_MINOR)
16 AC_DEFINE_UNQUOTED([ZFS_DEVICE_MINOR],
17 [$ZFS_DEVICE_MINOR], [/dev/zfs minor])
22 AS_IF([ test -z "$ZFS_DEVICE_MINOR"], [
24 *** No available misc minor numbers available for use.])