ndctl: fix definition of conditional functionality

Resolve HAVE_NDCTL_ARS and HAVE_NDCTL_CLEAR_ERROR in libndctl.h from the
results of configure.  Otherwise, these will always be undefined for
external programs which do not have access to config.h.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2 files changed
tree: 25b991d1fbb84890f2a98abafae9a51e9af52ccd
  1. ccan/
  2. Documentation/
  3. lib/
  4. licenses/
  5. m4/
  6. sles/
  7. test/
  8. util/
  9. .gitignore
  10. autogen.sh
  11. builtin-bat.c
  12. builtin-create-nfit.c
  13. builtin-help.c
  14. builtin-list.c
  15. builtin-test.c
  16. builtin-xable-region.c
  17. builtin-xaction-namespace.c
  18. builtin-zero-labels.c
  19. builtin.h
  20. configure.ac
  21. COPYING
  22. git-version
  23. git-version-gen
  24. make-git-snapshot.sh
  25. Makefile.am
  26. ndctl.c
  27. ndctl.h
  28. ndctl.spec.in
  29. nfit.h
  30. README.md
  31. rpmbuild.sh
  32. test.h
README.md

ndctl

Utility library for managing the libnvdimm (non-volatile memory device) sub-system in the Linux kernel

Build

./autogen.sh
./configure --enable-local
make
make check
sudo make install

Documentation

See the latest documentation for the NVDIMM kernel sub-system here:

https://git.kernel.org/cgit/linux/kernel/git/nvdimm/nvdimm.git/tree/Documentation/nvdimm/nvdimm.txt?h=libnvdimm-for-next

Unit Tests

The unit tests run by make check require the nfit_test.ko module to be loaded. To build and install nfit_test.ko:

  1. Obtain the kernel source. For example,
    git clone -b libnvdimm-for-next git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git

  2. Configure the kernel to make some memory available to CMA (contiguous memory allocator). This will be used to emulate DAX.
    CONFIG_DMA_CMA=y
    CONFIG_CMA_SIZE_MBYTES=200
    or
    cma=200M on the kernel command line.

  3. Compile all components of the libnvdimm sub-system as modules:
    CONFIG_LIBNVDIMM=m
    CONFIG_BLK_DEV_PMEM=m
    CONFIG_ND_BLK=m
    CONFIG_ND_BTT=m

  4. Build and install the unit test enabled libnvdimm modules in the following order. The unit test modules need to be in place prior to the depmod that runs during the final modules_install
    make M=tools/testing/nvdimm/
    sudo make M=tools/testing/nvdimm/ modules_install
    sudo make modules_install

  5. Now run make check in the ndctl source directory, or ndctl test, if ndctl was built with --enable-test.