Zfs: Installing zfs from the repo will not build on the kernel

Created on 3 Feb 2020  路  6Comments  路  Source: openzfs/zfs

System information


Type | Version/Name
--- | ---
Distribution Name | Debian (Parrot OS)
Distribution Version | Testing
Linux Kernel | 5.4.0-1parrot1-amd64
Architecture | x86_64
ZFS Version | 0.8.3-1
SPL Version | 0.8.3-1

Describe the problem you're observing

NR_FILE_PAGES in either node_stat_item or zone_stat_item: NOT FOUND
configure: error:
* None of the expected "global page state" interfaces were detected.
This may be because your kernel version is newer than what is
supported, or you are using a patched custom kernel with
incompatible modifications.

ZFS Version: zfs-0.8.3-1
*
* Compatible Kernels: 2.6.32 - 5.4

Building module:
cleaning build area...(bad exit status: 2)
make -j4 KERNELRELEASE=5.4.0-3parrot1-amd64...(bad exit status: 2)
Error! Bad return status for module build on kernel: 5.4.0-3parrot1-amd64 (x86_64)
Consult /var/lib/dkms/zfs/0.8.3/build/make.log for more information.

Describe how to reproduce the problem

#apt install linux-image-5.4.0-3parrot1-amd64 linux-headers-5.4.0-3parrot1-amd64 zfs-dkms zfs-initramfs

when trying to using dkms to build the module:

#dkms install -m zfs -v 0.8.3 -k 5.4.0-3parrot1-amd64

Kernel preparation unnecessary for this kernel. Skipping...

Running the pre_build script:
checking for gawk... gawk
checking metadata... META file
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... none
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking dependency style of gcc... none
checking whether to build with code coverage support... no
checking how to create a pax tar archive... gnutar
checking zfs author... OpenZFS on Linux
checking zfs license... CDDL
checking for ld... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking for shared library run path origin... done
checking 32-bit host C ABI... no
checking for the common suffixes of directories in the library search path... lib,lib
checking for iconv... yes
checking for working iconv... yes
checking for iconv declaration... extern size_t iconv (iconv_t cd, char * inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking whether NLS is requested... yes
checking for msgfmt... /usr/bin/msgfmt
checking for gmsgfmt... /usr/bin/msgfmt
checking for xgettext... /usr/bin/xgettext
checking for msgmerge... /usr/bin/msgmerge
checking zfs config... kernel
checking whether gcc supports -Wno-unused-but-set-variable... yes
checking whether gcc supports -Wno-bool-compare... yes
checking whether gcc supports -Wframe-larger-than=... yes
checking whether gcc supports -Wno-format-truncation... yes
checking whether gcc supports -fno-omit-frame-pointer... yes
checking whether to build with -fsanitize=address support... no
checking whether host toolchain supports SSE... yes
checking whether host toolchain supports SSE2... yes
checking whether host toolchain supports SSE3... yes
checking whether host toolchain supports SSSE3... yes
checking whether host toolchain supports SSE4.1... yes
checking whether host toolchain supports SSE4.2... yes
checking whether host toolchain supports AVX... yes
checking whether host toolchain supports AVX2... yes
checking whether host toolchain supports AVX512F... yes
checking whether host toolchain supports AVX512CD... yes
checking whether host toolchain supports AVX512DQ... yes
checking whether host toolchain supports AVX512BW... yes
checking whether host toolchain supports AVX512IFMA... yes
checking whether host toolchain supports AVX512VBMI... yes
checking whether host toolchain supports AVX512PF... yes
checking whether host toolchain supports AVX512ER... yes
checking whether host toolchain supports AVX512VL... yes
checking whether host toolchain supports AES... yes
checking whether host toolchain supports PCLMULQDQ... yes
checking for target asm dir... asm-x86_64
checking for python3... python3
checking for python version... 3.7
checking for python platform... linux
checking for python script directory... ${prefix}/lib/python3.7/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python3.7/site-packages
checking for python3.7... /usr/bin/python3.7
checking for a version of Python >= '2.1.0'... yes
checking for a version of Python >= '3.4.0'... yes
checking for the distutils Python package... yes
checking for Python include path... -I/usr/include/python3.7m
checking for Python library path... -L/usr/lib -lpython3.7m
checking for Python site-packages path... /usr/lib/python3/dist-packages
checking python extra libraries... -lcrypt -lpthread -ldl -lutil -lm
checking python extra linking flags... -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions
checking consistency of all components of python development environment... yes
checking for python3.7 module: setuptools... yes
checking for python3.7 module: cffi... yes
checking whether to enable pyzfs: ... yes
checking kernel source directory... /lib/modules/5.4.0-3parrot1-amd64/build
checking kernel build directory... /lib/modules/5.4.0-3parrot1-amd64/build
checking kernel source version... 5.4.0-3parrot1-amd64
checking kernel file name for module symbols... Module.symvers
checking whether modules can be built... yes
checking for kernel config option compatibility... done
checking whether kernel was built with 16K or larger stacks... yes
checking whether mutex_lock() is GPL-only... no
checking whether CONFIG_TRIM_UNUSED_KSYM is disabled... yes
checking whether CONFIG_ZLIB_INFLATE is defined... yes
checking whether CONFIG_ZLIB_DEFLATE is defined... yes
checking whether fpu headers are available... asm/fpu/api.h
checking whether wait_queue_entry_t exists... yes
checking whether /dev/zfs minor is available... grep: /lib/modules/5.4.0-3parrot1-amd64/build/include/linux/miscdevice.h: No such file or directory
249
checking whether DECLARE_EVENT_CLASS() is available... no
checking for available kernel interfaces... done
checking whether access_ok() has 'type' parameter... no
checking whether global_node_page_state() exists... yes
checking whether global_zone_page_state() exists... yes
checking whether enum node_stat_item contains NR_FILE_PAGES... no
checking whether enum node_stat_item contains NR_INACTIVE_ANON... no
checking whether enum node_stat_item contains NR_INACTIVE_FILE... no
checking whether enum node_stat_item contains NR_SLAB_RECLAIMABLE... no
checking whether enum zone_stat_item contains NR_FILE_PAGES... no
checking whether enum zone_stat_item contains NR_INACTIVE_ANON... no
checking whether enum zone_stat_item contains NR_INACTIVE_FILE... no
checking whether enum zone_stat_item contains NR_SLAB_RECLAIMABLE... no
checking whether global_page_state enums are sane... no
NR_FILE_PAGES in either node_stat_item or zone_stat_item: NOT FOUND
configure: error:
None of the expected "global page state" interfaces were detected.
This may be because your kernel version is newer than what is
supported, or you are using a patched custom kernel with
incompatible modifications.

ZFS Version: zfs-0.8.3-1
*
* Compatible Kernels: 2.6.32 - 5.4

Building module:
cleaning build area...(bad exit status: 2)
make -j4 KERNELRELEASE=5.4.0-3parrot1-amd64...(bad exit status: 2)
Error! Bad return status for module build on kernel: 5.4.0-3parrot1-amd64 (x86_64)
Consult /var/lib/dkms/zfs/0.8.3/build/make.log for more information.

Include any warning/errors/backtraces from the system logs

#cat /var/lib/dkms/zfs/0.8.3/build/make.log
DKMS make.log for zfs-0.8.3 for kernel 5.4.0-3parrot1-amd64 (x86_64)
Mon 3 Feb 18:51:46 GMT 2020
make: * No targets specified and no makefile found. Stop.

Packaging Building

All 6 comments

Same here on 5.5.1. Downgraded to linux 5.4.15 and was able to build zfs 0.8.3.

Also a problem on Debian 10 using backports (actually Linux Mint LDME 4).

The Debian bug tracker is full of similar reports. This issue is reproducible on recent kernels from buster-backports (10), bullseye (11), sid (unstable), but I didn't try experimental yet. I can confirm this on ZFS 0.8.3, 0.8.4 and current master.

It seems like Debian made some changes in how they split kernel headers. They always put some headers in arch-specific package, e.g. linux-headers-<version>-amd64. And some headers in arch-neutral package, e.g. linux-headers-<version>-common. But now they seem to be moved some headers required by ZFS to a common package and ZFS doesn't find them.

So as for current sid kernel there is following dirs:

/usr/src/linux-headers-5.6.0-1-amd64
/usr/src/linux-headers-5.6.0-1-common

A simple, but a dirty workaround is just to copy headers from common dir to arch specific one, e.g. amd64:

sudo rsync -a /usr/src/linux-headers-5.6.0-1-common/ /usr/src/linux-headers-5.6.0-1-amd64/

@yurikoles also what you can do isln -s /usr/src/linux-headers-5.5.0-kali2-common/include/linux/ /usr/src/linux-headers-5.5.0-kali2-amd64/include/linux however these are temparary fixes

@behlendorf @ahrens there is a zfs compilation issue on debian and debian based distros when installing zfs from the repo this is due to the headers files being installed by two different packages into two different locations show below:

header pacakges are that required:
apt list linux-headers-5.5.0-kali2-*
Listing... Done
linux-headers-5.5.0-kali2-amd64/now 5.5.17-1kali1 amd64 [installed,local]
linux-headers-5.5.0-kali2-common/now 5.5.17-1kali1 all [installed,local]

Package linux-headers-5.5.0-kali2-amd64 is installed in the location below:
dpkg -L linux-headers-5.5.0-kali2-amd64
/usr/src/linux-headers-5.5.0-kali2-amd64

Package linux-headers-5.5.0-kali2-common is installed in the location below:
dpkg -L linux-headers-5.5.0-kali2-common
/usr/src/linux-headers-5.5.0-kali2-common

The bug is also on debian bug tracker shown by @yurikoles the same issue can be viewed on https://bugs.debian.org/cgi-bin/bugreport.cgi?att=2;bug=958121;filename=dkms.log;msg=5 scroll to the botom of the page.

This helped me get ZFS 084 running on Linux Mint LMDE, so let me provide the full process:

Install updated kernel:

apt install linux-headers-4.19.0-10-amd64 linux-image-4.19.0-10-amd64-dbg \
linux-image-amd64 linux-image-4.19.0-10-amd64

' reboot ' into new kernel

Using midnight commander makes this easy:

mc /usr/src
( cd down into /usr/src/linux-headers-4.19.0-10-common/include/linux ) on the left pane

^O to shell prompt
thisd=$PWD

^O back to MC, then
Tab to 2nd pane

( cd into /usr/src/linux-headers-4.19.0-10-amd64/include )
^O again
ln -sfn $thisd .

Expected result:

/usr/src/linux-headers-4.19.0-10-amd64/include # ls -l
drwxr-xr-x   4 root root    50 Sep 24 00:43 .
drwxr-xr-x   4 root root   138 Sep 24 00:13 ..
drwxr-xr-x 735 root root 36864 Sep 24 00:13 config
drwxr-xr-x   3 root root   146 Sep 24 00:13 generated
lrwxrwxrwx   1 root root    53 Sep 24 00:43 linux -> /usr/src/linux-headers-4.19.0-10-common/include/linux

At this point you should be able to ' apt update; apt-get -t buster-backports install zfs-dkms '

If you then get an error:

dpkg: dependency problems prevent configuration of zfs-zed:
 zfs-zed depends on zfsutils-linux (>= 0.8.4-2~bpo10+1); however:
  Package zfsutils-linux is not configured yet.

FIX:
apt-get -f install

zpool version
zfs-0.8.4-2~bpo10+1 / zfs-kmod-0.8.4-2~bpo10+1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

torn5 picture torn5  路  57Comments

Lalufu picture Lalufu  路  70Comments

Tualua picture Tualua  路  54Comments

mabod picture mabod  路  53Comments

nivedita76 picture nivedita76  路  78Comments