Skip to contentSkip to conversation

ndctl, rpmbuild: Add a dummy readme file to ndctl_keysdir

PATCH New Vishal Verma 1 participant 1 message Feb 2, 2019 libnvdimm: non-volatile memory device

lore
Share & tools
lore

Vishal Verma

author maintainer
#0 lore raw

PATCH 1/1 ndctl, rpmbuild: Add a dummy readme file to ndctl_keysdir

At build time, ndctl_keysdir (/etc/nddctl/keys/) was empty, and thus it never gets created. Since the directory is listed in the %files section of the RPM spec, RPM checks for it and fails since it is not present.

Fix this by adding a simple 'keys.readme' file to the keys dorectory that points the user to the setup-passphrase man page, and installing it during the build.

---
 configure.ac      | 2 ++
 ndctl.spec.in     | 1 +
 ndctl/Makefile.am | 2 ++
 ndctl/keys.readme | 1 +
 4 files changed, 6 insertions(+)
 create mode 100644 ndctl/keys.readme
configure.ac +2 -0
index b08ddaf..d27a2b1 100644
@@ -179,7 +179,9 @@ AS_IF([test "x$with_keyutils" = "xyes"],
 AM_CONDITIONAL([ENABLE_KEYUTILS], [test "x$with_keyutils" = "xyes"])
 
 ndctl_keysdir=${sysconfdir}/ndctl/keys
+ndctl_keysreadme=keys.readme
 AC_SUBST([ndctl_keysdir])
+AC_SUBST([ndctl_keysreadme])
 
 my_CFLAGS="\
 -Wall \
ndctl.spec.in +1 -0
index 5ceb27a..8abccbf 100644
@@ -110,6 +110,7 @@ make check
 %{bashcompdir}/
 %{_unitdir}/ndctl-monitor.service
 %dir %{_sysconfdir}/ndctl/keys/
+%{_sysconfdir}/ndctl/keys/keys.readme
 %{_sysconfdir}/modprobe.d/nvdimm-security.conf
 
 %config(noreplace) %{_sysconfdir}/ndctl/monitor.conf
ndctl/Makefile.am +2 -0
index cd3312b..3287dbb 100644
@@ -29,6 +29,8 @@ ndctl_SOURCES = ndctl.c \
 if ENABLE_KEYUTILS
 ndctl_SOURCES += util/keys.c \
 		load-keys.c
+keys_configdir = $(ndctl_keysdir)
+keys_config_DATA = $(ndctl_keysreadme)
 endif
 
 if ENABLE_DESTRUCTIVE
ndctl/keys.readme new file +1 -0
new file mode 100644
index 0000000..506678a
@@ -0,0 +1 @@
+See 'ndctl setup-passphrase --help'
Signature · 6 lines
2.20.1

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm