[PATCH] README.md: recommend to use INSTALL_MOD_DIR

From: Luis Chamberlain
Date: Tue Dec 13 2022 - 17:34:35 EST


By default depmod will only look at the updates directory for modules,
and so if one wants to replace production modules with alternatives
one can just use INSTALL_MOD_DIR=updates at modules_install time.

This will ensure that the correctly mocked modules are used, whether
that is for cxl or libnvdimm.

Signed-off-by: Luis Chamberlain <mcgrof@xxxxxxxxxx>
---
README.md | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index e5c4940..fd285af 100644
--- a/README.md
+++ b/README.md
@@ -74,16 +74,17 @@ loaded. To build and install nfit_test.ko:
CONFIG_ENCRYPTED_KEYS=y
```

-1. 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`
+1. Build and install the unit test enabled libnvdimm modules

```
- make M=tools/testing/nvdimm
- sudo make M=tools/testing/nvdimm modules_install
sudo make modules_install
+ make M=tools/testing/nvdimm
+ sudo make M=tools/testing/nvdimm modules_install INSTALL_MOD_DIR=updates
```

+To uninstall and use the production nvdimm modules just rm -rf the updates
+directory from the respective kernel /lib/modules/ directory and run depmod -a.
+
1. Now run `meson test -C build` in the ndctl source directory, or `ndctl test`,
if ndctl was built with `-Dtest=enabled` as a configuration option to meson.

--
2.35.1