You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+38-36Lines changed: 38 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,18 +23,21 @@ libnvme:
23
23
nvme-cli uses meson as its build system. There is more than one way to configure and
24
24
build the project in order to mitigate meson dependency on the build environment.
25
25
26
-
If you build on a relative modern system, either use meson directly or the
26
+
If you build on a relatively modern system, either use meson directly or the
27
27
Makefile wrapper.
28
28
29
-
Older distros might ship a too old version of meson, in this case it's possible
29
+
Older distros might ship a too old version of meson. In this case, it's possible
30
30
to build the project using [samurai](https://github.com/michaelforney/samurai)
31
31
and [muon](https://github.com/annacrombie/muon). Both build tools have only a
32
-
minimal dependency on the build environment. Too easy this step there is a build
32
+
minimal dependency on the build environment. To ease this step, there is a build
33
33
script which helps to setup a build environment.
34
34
35
35
### nvme-cli dependencies (3.x and later):
36
36
37
-
Starting with nvme-cli 3.x, the libnvme library is fully integrated into the nvme-cli source tree. There is no longer any dependency on an external libnvme repository or package. All required libnvme and libnvme-mi code is included and built as part of nvme-cli.
37
+
Starting with nvme-cli 3.x, the libnvme library is fully integrated into the
38
+
nvme-cli source tree. There is no longer any dependency on an external libnvme
39
+
repository or package. All required libnvme and libnvme-mi code is included and
40
+
built as part of nvme-cli.
38
41
39
42
| Library | Dependency | Notes |
40
43
|---------|------------|-------|
@@ -46,8 +49,6 @@ Starting with nvme-cli 3.x, the libnvme library is fully integrated into the nvm
46
49
47
50
#### Configuring
48
51
49
-
#### Configuring
50
-
51
52
No special configuration is required for libnvme, as it is now part of the
52
53
nvme-cli source tree. Simply run:
53
54
@@ -78,16 +79,16 @@ default configuration (meson, gcc and defaults)
78
79
79
80
It's possible to change the compiler to clang
80
81
81
-
`scripts/builds.sh -c clang`
82
+
`scripts/build.sh -c clang`
82
83
83
-
or enabling all the fallbacks
84
+
or enable all the fallbacks
84
85
85
86
`scripts/build.sh fallback`
86
87
87
88
### Minimal static build with muon
88
89
89
90
`scripts/build.sh -m muon` will download and build `samurai` and `muon` instead
90
-
using `meson` to build the project. This reduces the dependency on the build
91
+
of using `meson` to build the project. This reduces the dependency on the build
91
92
environment to:
92
93
- gcc
93
94
- make
@@ -109,11 +110,11 @@ RPM build support via Makefile that uses meson
109
110
110
111
$ make rpm
111
112
112
-
Static binary(no dependency) build support via Makefile that uses meson
113
+
Static binary(no dependency) build support via Makefile that uses meson
113
114
114
115
$ make static
115
116
116
-
If not sure how to use, find the top-level documentation with:
117
+
If you are not sure how to use it, find the top-level documentation with:
117
118
118
119
$ man nvme
119
120
@@ -142,17 +143,18 @@ To build without any vendor plugins:
142
143
143
144
## Distro Support
144
145
145
-
Many popular distributions (Alpine, Arch, Debian, Fedora, FreeBSD, Gentoo,
146
-
Ubuntu, Nix(OS), openSUSE, ...) and the usual package name is nvme-cli.
146
+
It is available on many popular distributions (Alpine, Arch, Debian, Fedora,
147
+
FreeBSD, Gentoo, Ubuntu, Nix(OS), openSUSE, ...) and the usual package name is
148
+
nvme-cli.
147
149
148
150
#### OpenEmbedded/Yocto
149
151
150
152
An [nvme-cli recipe](https://layers.openembedded.org/layerindex/recipe/88631/)
151
-
is available as part of the `meta-openembeded` layer collection.
153
+
is available as part of the `meta-openembedded` layer collection.
152
154
153
155
#### Buildroot
154
156
155
-
`nvme-cli` is available as [buildroot](https://buildroot.org) package. The
157
+
`nvme-cli` is available as a [buildroot](https://buildroot.org) package. The
156
158
package is named `nvme`.
157
159
158
160
## Developers
@@ -168,11 +170,12 @@ events are created by Linux kernel's 'ftrace' component.
168
170
169
171
The first thing to do is define a new command entry in the command
170
172
list. This is declared in nvme-builtin.h. Simply append a new "ENTRY" into
171
-
the list. The ENTRY normally takes three arguments: the "name" of the
173
+
the list. The ENTRY normally takes three arguments: the "name" of the
172
174
subcommand (this is what the user will type at the command line to invoke
173
175
your command), a short help description of what your command does, and the
174
176
name of the function callback that you're going to write. Additionally,
175
-
You can declare an alias name of subcommand with fourth argument, if needed.
177
+
you can declare an alias name of the subcommand with a fourth argument, if
178
+
needed.
176
179
177
180
After the ENTRY is defined, you need to implement the callback. It takes
178
181
four arguments: argc, argv, the command structure associated with the
@@ -188,11 +191,11 @@ after the sub-command. So if the command line is "nvme foo --option=bar",
188
191
the argc is 1 and argv starts at "--option".
189
192
190
193
You can then define argument parsing for your sub-command's specific
191
-
options then do some commandspecific action in your callback.
194
+
options then do some command-specific action in your callback.
192
195
193
196
### Add a new plugin
194
197
195
-
The nvme-cli provides macros to make define a new plug-in simpler. You
198
+
The nvme-cli provides macros to make defining a new plug-in simpler. You
196
199
can certainly do all this by hand if you want, but it should be easier
197
200
to get going using the macros. To start, first create a header file
198
201
to define your plugin. This is where you will give your plugin a name,
0 commit comments