HomeFreeBSD

Fix Linux kernel directories detection

Description

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

Details

Provenance
Damian Szuberski <szuberskidamian@gmail.com>Authored on Feb 16 2022, 11:17 PM
Tony Hutter <hutter2@llnl.gov>Committed on Feb 24 2022, 12:47 AM
Parents
rGbcddb18bae26: Enable encrypted raw sending to pools with greater ashift
Branches
Unknown
Tags
Unknown

Event Timeline

Tony Hutter <hutter2@llnl.gov> committed rGb55ed8df92a8: Fix Linux kernel directories detection (authored by Damian Szuberski <szuberskidamian@gmail.com>).Feb 24 2022, 12:47 AM