]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme.spec.in: using specific directory for nvme command on %post
authorSteven Seungcheol Lee <sc108.lee@samsung.com>
Wed, 28 Oct 2020 08:20:00 +0000 (17:20 +0900)
committerKeith Busch <kbusch@kernel.org>
Thu, 5 Nov 2020 15:20:45 +0000 (08:20 -0700)
${_sbindir} could be placed in out of default bin directories
so just 'nvme gen-hostnqn' would not work with 'nvme command not found'

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
nvme.spec.in

index 215b397d95195e8c969f69531847fc26d913b88d..7154a870ae4060204cb3e6b1eccda69c3d5121fb 100644 (file)
@@ -49,7 +49,7 @@ rm -rf $RPM_BUILD_ROOT
 %post
 if [ $1 -eq 1 ]; then # 1 : This package is being installed for the first time
        if [ ! -s %{_sysconfdir}/nvme/hostnqn ]; then
-               echo $(nvme gen-hostnqn) > %{_sysconfdir}/nvme/hostnqn
+               echo $(%{_sbindir}/nvme gen-hostnqn) > %{_sysconfdir}/nvme/hostnqn
         fi
         if [ ! -s %{_sysconfdir}/nvme/hostid ]; then
                 uuidgen > %{_sysconfdir}/nvme/hostid