]> git.proxmox.com Git - mirror_zfs.git/commit
Fix Linux kernel directories detection
authorDamian Szuberski <szuberskidamian@gmail.com>
Wed, 16 Feb 2022 23:17:16 +0000 (00:17 +0100)
committerGitHub <noreply@github.com>
Wed, 16 Feb 2022 23:17:16 +0000 (15:17 -0800)
commit72f3c8b13019b8882f4536411e42734fd3b4a4d7
tree2739e00cb1597b31e2f140d3992401406459043b
parent52a36bd41a3baac19bcb9efc7f3ae4088758bf7f
Fix Linux kernel directories detection

Most modern Linux distributions have separate locations for bare
source and prebuilt ("build") files. Additionally, there are `source`
and `build` symlinks in `/lib/modules/$(KERNEL_VERSION)` pointing to
them. The order of directory search is now:
- `configure` command line values if both `--with-linux` and
  `--with-linux-obj` were defined
- If only `--with-linux` was defined, `--with-linux-obj` is assumed
  to have the same value as `--with-linux`
- If neither `--with-linux` nor `--with-linux-obj` were defined
  autodetection is used:
  - `/lib/modules/$(uname -r)/{source,build}` respectively, if exist
  - The first directory in `/lib/modules` with the highest version
    number according to `sort -V` which contains `source` and `build`
    symlinks/directories
  - The first directory matching `/usr/src/kernels/*` and
    `/usr/src/linux-*` with the highest version number according to
    `sort -V`. Here the source and prebuilt directories are assumed
    to be the same.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: szubersk <szuberskidamian@gmail.com>
Closes #9935
Closes #13096
config/kernel.m4