Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/linux-nvme/nvme-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
sbates130272 committed Jun 2, 2015
2 parents 3fdbf12 + 988a198 commit 62bbb67
Show file tree
Hide file tree
Showing 39 changed files with 25,980 additions and 21 deletions.
31 changes: 28 additions & 3 deletions Documentation/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ MAN1_TXT += $(filter-out \
MAN1_TXT += nvme.txt
MAN_TXT = $(MAN1_TXT)
MAN_XML = $(patsubst %.txt,%.xml,$(MAN_TXT))
MAN_HTML = $(patsubst %.txt,%.html,$(MAN_TXT))

DOC_HTML = $(MAN_HTML) $(OBSOLETE_HTML)

API_DOCS =
SP_ARTICLES += $(API_DOCS)
SP_ARTICLES += $(TECH_DOCS)


DOC_MAN1 = $(patsubst %.txt,%.1,$(MAN1_TXT))

ASCIIDOC = asciidoc
Expand All @@ -29,6 +33,11 @@ INSTALL ?= install
RM ?= rm -f
MAN_REPO = ../../nvme-manpages

ASCIIDOC_HTML = xhtml11
ASCIIDOC_CONF = -f asciidoc.conf
ASCIIDOC_COMMON = $(ASCIIDOC) $(ASCIIDOC_EXTRA) $(ASCIIDOC_CONF)
TXT_TO_HTML = $(ASCIIDOC_COMMON) -b $(ASCIIDOC_HTML)

MAKEINFO = makeinfo
INSTALL_INFO = install-info
DOCBOOK2X_TEXI = docbook2x-texi
Expand Down Expand Up @@ -81,12 +90,17 @@ else # "make -w"
NO_SUBDIR = :
endif

all: man
all: man html

html: $(DOC_HTML)

man: man1
man1: $(DOC_MAN1)

install: install-man
install: install-man install-html

install-html: html
'$(SHELL_PATH_SQ)' ./install-webdoc.sh $(DESTDIR)$(htmldir)

install-man: man
$(INSTALL) -d -m 755 /usr/local/man/man1
Expand Down Expand Up @@ -120,7 +134,7 @@ cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)
date >$@

clean:
$(RM) *.xml *.xml+ *.html *.html+
$(RM) *.xml *.xml+ *.html+
$(RM) *.texi *.texi+ *.texi++ nvme.info nvmeman.info
$(RM) *.pdf
$(RM) howto-index.txt howto/*.html doc.dep
Expand Down Expand Up @@ -188,8 +202,19 @@ howto-index.txt: howto-index.sh $(wildcard howto/*.txt)

WEBDOC_DEST = /pub/software/scm/nvme/docs

$(MAN_HTML): %.html : %.txt
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
$(TXT_TO_HTML) -d manpage -o $@+ $< && \
mv $@+ $@

quick-install: quick-install-man

$(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
$(QUIET_ASCIIDOC)$(TXT_TO_HTML) $*.txt

install-webdoc : html
'$(SHELL_PATH_SQ)' ./install-webdoc.sh $(WEBDOC_DEST)

require-manrepo::
@if test ! -d $(MAN_REPO); \
then echo "nvme-manpages repository must exist at $(MAN_REPO)"; exit 1; fi
Expand Down
97 changes: 97 additions & 0 deletions Documentation/asciidoc.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
## linknvme: macro
#
# Usage: linknvme:command[manpage-section]
#
# Note, {0} is the manpage section, while {target} is the command.
#
# Show Git link as: <command>(<section>); if section is defined, else just show
# the command.

[macros]
(?su)[\\]?(?P<name>linknvme):(?P<target>\S*?)\[(?P<attrlist>.*?)\]=

[attributes]
asterisk=&#42;
plus=&#43;
caret=&#94;
startsb=&#91;
endsb=&#93;
backslash=&#92;
tilde=&#126;
apostrophe=&#39;
backtick=&#96;
litdd=&#45;&#45;

ifdef::backend-docbook[]
[linknvme-inlinemacro]
{0%{target}}
{0#<citerefentry>}
{0#<refentrytitle>{target}</refentrytitle><manvolnum>{0}</manvolnum>}
{0#</citerefentry>}
endif::backend-docbook[]

ifdef::backend-docbook[]
ifndef::git-asciidoc-no-roff[]
# "unbreak" docbook-xsl v1.68 for manpages. v1.69 works with or without this.
# v1.72 breaks with this because it replaces dots not in roff requests.
[listingblock]
<example><title>{title}</title>
<literallayout class="monospaced">
ifdef::doctype-manpage[]
&#10;.ft C&#10;
endif::doctype-manpage[]
|
ifdef::doctype-manpage[]
&#10;.ft&#10;
endif::doctype-manpage[]
</literallayout>
{title#}</example>
endif::git-asciidoc-no-roff[]

ifdef::git-asciidoc-no-roff[]
ifdef::doctype-manpage[]
# The following two small workarounds insert a simple paragraph after screen
[listingblock]
<example><title>{title}</title>
<literallayout class="monospaced">
|
</literallayout><simpara></simpara>
{title#}</example>

[verseblock]
<formalpara{id? id="{id}"}><title>{title}</title><para>
{title%}<literallayout{id? id="{id}"}>
{title#}<literallayout>
|
</literallayout>
{title#}</para></formalpara>
{title%}<simpara></simpara>
endif::doctype-manpage[]
endif::git-asciidoc-no-roff[]
endif::backend-docbook[]

ifdef::doctype-manpage[]
ifdef::backend-docbook[]
[header]
template::[header-declarations]
<refentry>
<refmeta>
<refentrytitle>{mantitle}</refentrytitle>
<manvolnum>{manvolnum}</manvolnum>
<refmiscinfo class="source">Git</refmiscinfo>
<refmiscinfo class="version">{git_version}</refmiscinfo>
<refmiscinfo class="manual">Git Manual</refmiscinfo>
</refmeta>
<refnamediv>
<refname>{manname}</refname>
<refpurpose>{manpurpose}</refpurpose>
</refnamediv>
endif::backend-docbook[]
endif::doctype-manpage[]

ifdef::backend-xhtml11[]
[attributes]
git-relative-html-prefix=
[linknvme-inlinemacro]
<a href="{git-relative-html-prefix}{target}.html">{target}{0?({0})}</a>
endif::backend-xhtml11[]
84 changes: 84 additions & 0 deletions Documentation/cmds-main.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
linknvme:nvme-admin-passthru[1]::
Admin Passthrough Comand

linknvme:nvme-compare[1]::
IO Compare

linknvme:nvme-error-log[1]::
Retrieve error logs

linknvme:nvme-flush[1]::
Submit flush

linknvme:nvme-format[1]::
Format namespace(s)

linknvme:nvme-fw-activate[1]::
F/W Activate

linknvme:nvme-fw-download[1]::
F/W Download

linknvme:nvme-fw-log[1]::
Retrieve f/w log

linknvme:nvme-get-feature[1]::
Get Features

linknvme:nvme-get-log[1]::
Generic Get Log

linknvme:nvme-smart-log[1]::
Retrieve Smart Log

linknvme:nvme-get-ns-id[1]::
Retrieve namespace identifier

linknvme:nvme-help[1]::
NVMe CLI Help

linknvme:nvme-id-ctrl[1]::
Identify Controller

linknvme:nvme-id-ns[1]::
Identify Namespace

linknvme:nvme-io-passthru[1]::
IO Passthrough Command

linknvme:nvme-list-ns[1]::
List all nvme namespaces

linknvme:nvme-list[1]::
List all nvme controllers

linknvme:nvme-read[1]::
Issue IO Read Command

linknvme:nvme-write[1]::
Issue IO Write Command

linknvme:nvme-resv-acquire[1]::
Acquire Namespace Reservation

linknvme:nvme-resv-register[1]::
Register Namespace Reservation

linknvme:nvme-resv-release[1]::
Release Namespace Reservation

linknvme:nvme-resv-report[1]::
Report Reservation Capabilities

linknvme:nvme-security-recv[1]::
Security Receive

linknvme:nvme-security-send[1]::
Security Send

linknvme:nvme-set-feature[1]::
Set Feature

linknvme:nvme-show-regs[1]::
Show NVMe Controller Registers

39 changes: 39 additions & 0 deletions Documentation/install-webdoc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/sh

T="$1"

for h in \
*.txt *.html \
howto/*.txt howto/*.html \
technical/*.txt technical/*.html \
RelNotes/*.txt *.css
do
if test ! -f "$h"
then
: did not match
elif test -f "$T/$h" &&
$DIFF -u -I'^Last updated ' "$T/$h" "$h"
then
:; # up to date
else
echo >&2 "# install $h $T/$h"
rm -f "$T/$h"
mkdir -p $(dirname "$T/$h")
cp "$h" "$T/$h"
fi
done
strip_leading=$(echo "$T/" | sed -e 's|.|.|g')
for th in \
"$T"/*.html "$T"/*.txt \
"$T"/howto/*.txt "$T"/howto/*.html \
"$T"/technical/*.txt "$T"/technical/*.html
do
h=$(expr "$th" : "$strip_leading"'\(.*\)')
case "$h" in
RelNotes-*.txt | index.html) continue ;;
esac
test -f "$h" && continue
echo >&2 "# rm -f $th"
rm -f "$th"
done
ln -sf git.html "$T/index.html"
50 changes: 46 additions & 4 deletions Documentation/nvme-admin-passthru.1
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
.\" Title: nvme-admin-passthru
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
.\" Date: 02/02/2015
.\" Manual: \ \&
.\" Source: \ \&
.\" Date: 05/29/2015
.\" Manual: Git Manual
.\" Source: Git
.\" Language: English
.\"
.TH "NVME\-ADMIN\-PASSTHR" "1" "02/02/2015" "\ \&" "\ \&"
.TH "NVME\-ADMIN\-PASSTHR" "1" "05/29/2015" "Git" "Git Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
Expand Down Expand Up @@ -110,13 +110,55 @@ Print the raw returned buffer to stdout if the command returns a structure\&.
.RE
.SH "EXAMPLES"
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
The following will run the admin command with opcode=6 and cdw10=1, which cooresponds to an identify controller command\&. This example requires the data\-len param be 4096, which is the size of the returned structure\&. The \-r option is used because it is a data\-in command
.sp
.if n \{\
.RS 4
.\}
.nf

\&.ft C
# nvme admin\-passthru /dev/nvme0 \-\-opcode=06 \-\-data\-len=4096 \-\-cdw10=1 \-r
\&.ft

.fi
.if n \{\
.RE
.\}
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Or if you want to save that structure to a file:
.sp
.if n \{\
.RS 4
.\}
.nf

\&.ft C
# nvme admin\-passthru /dev/nvme0 \-\-opcode=06 \-\-data\-len=4096 \-\-cdw10=1 \-r \-b > id_ns\&.raw
\&.ft

.fi
.if n \{\
.RE
.\}
.RE
.SH "NVME"
.sp
Part of the nvme\-user suite
Loading

0 comments on commit 62bbb67

Please sign in to comment.