All of lore.kernel.org
 help / color / mirror / Atom feed
From: james_p_freyensee@linux.intel.com (J Freyensee)
Subject: [PATCH RFC nvme-cli 2/2] nvme.spec: generate hostnqn file on install and remove on uninstall
Date: Mon, 07 Nov 2016 12:25:29 -0800	[thread overview]
Message-ID: <1478550329.5463.7.camel@linux.intel.com> (raw)
In-Reply-To: <1478459581-22654-3-git-send-email-sagi@grimberg.me>

On Sun, 2016-11-06@21:13 +0200, Sagi Grimberg wrote:
> Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
> ---
> ?nvme.spec.in | 14 ++++++++++++++
> ?1 file changed, 14 insertions(+)
> 
> diff --git a/nvme.spec.in b/nvme.spec.in
> index a4718773a962..e95810995395 100644
> --- a/nvme.spec.in
> +++ b/nvme.spec.in
> @@ -33,6 +33,20 @@ make install DESTDIR=%{buildroot} PREFIX=/usr
> ?%clean
> ?rm -rf $RPM_BUILD_ROOT
> ?
> +%post
> +if [ $1 = 1 ]; then # 1 : This package is being installed for the
> first time
> +	if [ ! -f /etc/nvme/hostnqn ]; then
> +		install -D /dev/null /etc/nvme/hostnqn
> +		year_month=$(date | awk '{print $6"-"$3}')

Hey Sagi,

7.9 of the base NVMe spec makes it clear on unique names that the "2nd
format", which is what is being assembled here, uses a fixed date
"2014-08" in it's name, which is exactly what the NVMe Host driver does
as its default:

fabrics.c: ?"nqn.2014-08.org.nvmexpress:NVMf:uuid:%pUb", &host->id);

I would just do what the NVMe host is doing already and make it easier
on yourself ;-).

  parent reply	other threads:[~2016-11-07 20:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-06 19:12 [PATCH RFC nvme-cli 0/2] auto generate hostnqn file on installation Sagi Grimberg
2016-11-06 19:13 ` [PATCH RFC nvme-cli 1/2] debain: generate hostnqn file on install and remove on uninstall Sagi Grimberg
2016-11-06 19:25   ` Christoph Hellwig
2016-11-06 21:41     ` Sagi Grimberg
2016-11-14 14:55       ` Gabriel Krisman Bertazi
2016-11-06 19:13 ` [PATCH RFC nvme-cli 2/2] nvme.spec: " Sagi Grimberg
2016-11-07  8:36   ` Johannes Thumshirn
2016-11-08 10:31     ` Sagi Grimberg
2016-11-08 10:42       ` Johannes Thumshirn
2016-11-07 20:25   ` J Freyensee [this message]
2016-11-08 10:29     ` Sagi Grimberg
2016-11-06 19:24 ` [PATCH RFC nvme-cli 0/2] auto generate hostnqn file on installation Christoph Hellwig
2016-11-06 21:36   ` Sagi Grimberg
2016-11-07 20:34     ` J Freyensee
2016-11-08 10:30       ` Sagi Grimberg
2016-11-08 17:11         ` J Freyensee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1478550329.5463.7.camel@linux.intel.com \
    --to=james_p_freyensee@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.