From 107cfb5782cd2df03bf49089bba44980b24b2625 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 31 2020 09:37:52 +0000 Subject: import ndctl-65-5.el7 --- diff --git a/.gitignore b/.gitignore index ed2f4d6..95acd8f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/ndctl-64.1.tar.gz +SOURCES/ndctl-65.tar.gz diff --git a/.ndctl.metadata b/.ndctl.metadata index 4e2dac9..d4c53b7 100644 --- a/.ndctl.metadata +++ b/.ndctl.metadata @@ -1 +1 @@ -8841c30b4f0eba0860f8b89e57bd0ce998ee9d65 SOURCES/ndctl-64.1.tar.gz +65bfc783a624628e5eb60e936f46e6b543025670 SOURCES/ndctl-65.tar.gz diff --git a/SOURCES/daxctl-remove-migrate-device-model.patch b/SOURCES/daxctl-remove-migrate-device-model.patch new file mode 100644 index 0000000..e539756 --- /dev/null +++ b/SOURCES/daxctl-remove-migrate-device-model.patch @@ -0,0 +1,140 @@ +diff -uprN ndctl-65.orig/Documentation/daxctl/Makefile.am ndctl-65/Documentation/daxctl/Makefile.am +--- ndctl-65.orig/Documentation/daxctl/Makefile.am 2019-07-29 14:41:44.474017128 -0400 ++++ ndctl-65/Documentation/daxctl/Makefile.am 2019-07-29 14:53:17.934283220 -0400 +@@ -27,8 +27,7 @@ endif + + man1_MANS = \ + daxctl.1 \ +- daxctl-list.1 \ +- daxctl-migrate-device-model.1 ++ daxctl-list.1 + + CLEANFILES = $(man1_MANS) + +diff -uprN ndctl-65.orig/Documentation/daxctl/daxctl-migrate-device-model.txt ndctl-65/Documentation/daxctl/daxctl-migrate-device-model.txt +--- ndctl-65.orig/Documentation/daxctl/daxctl-migrate-device-model.txt 2019-07-29 14:41:44.473017124 -0400 ++++ ndctl-65/Documentation/daxctl/daxctl-migrate-device-model.txt 1969-12-31 19:00:00.000000000 -0500 +@@ -1,47 +0,0 @@ +-// SPDX-License-Identifier: GPL-2.0 +- +-daxctl-migrate-device-model(1) +-============================== +- +-NAME +----- +-daxctl-migrate-device-model - Opt-in to the /sys/bus/dax device-model, +-allow for alternative Device-DAX instance drivers. +- +-SYNOPSIS +--------- +-[verse] +-'daxctl migrate-device-model' +- +-Arrange for modprobe to disable the dax_pmem_compat, if present, and +-instead deploy the dax_pmem module to convert to the /sys/bus/dax model. +-Kernel versions prior to v5.1 may not support /sys/bus/dax in which case +-the result of this command is a nop until the kernel is updated. The +-motivation for changing from /sys/class/dax to /sys/bus/dax is to allow +-for alternative drivers for Device-DAX instances, in particular the +-dax_kmem driver. +- +-By default device-dax publishes a /dev/daxX.Y character device for +-userspace to directly map performance differentiated memory. This is +-fine if the memory is to be exclusively consumed / managed by userspace. +-Alternatively an administrator may want the kernel to manage the memory, +-make it available via malloc(), allow for over-provisioning, and / or +-apply kernel-based resource control schemes to the memory. In that case +-the memory fronted by a given Device-DAX instance can be assigned to the +-dax_kmem driver which arranges for the core-kernel memory-management +-sub-system to assume management of the memory range. +- +-This behavior is opt-in for consideration of existing applications / +-scripts that may be hard coded to use /sys/class/dax. Fixes have been +-submitted to applications known to have these direct dependencies +-http://git.kernel.dk/cgit/fio/commit/?id=b08e7d6b18b4[FIO] +-https://github.com/pmem/pmdk/commit/91bc8620884e[PMDK], however, there may +-be others and a system-owner should be aware of the potential for +-regression of Device-DAX consuming scripts, applications, or older +-daxctl binaries. +- +-The modprobe policy established by this utility becomes effective after +-the next reboot, or after all DAX related modules have been removed and +-re-loaded with "udevadm trigger" +- +-include::../copyright.txt[] +diff -uprN ndctl-65.orig/daxctl/Makefile.am ndctl-65/daxctl/Makefile.am +--- ndctl-65.orig/daxctl/Makefile.am 2019-07-29 14:41:44.486017168 -0400 ++++ ndctl-65/daxctl/Makefile.am 2019-07-29 14:53:10.288257995 -0400 +@@ -14,7 +14,6 @@ config.h: $(srcdir)/Makefile.am + daxctl_SOURCES =\ + daxctl.c \ + list.c \ +- migrate.c \ + ../util/json.c + + daxctl_LDADD =\ +diff -uprN ndctl-65.orig/daxctl/builtin.h ndctl-65/daxctl/builtin.h +--- ndctl-65.orig/daxctl/builtin.h 2019-07-29 14:41:44.486017168 -0400 ++++ ndctl-65/daxctl/builtin.h 2019-07-29 14:53:10.288257995 -0400 +@@ -5,5 +5,4 @@ + + struct daxctl_ctx; + int cmd_list(int argc, const char **argv, struct daxctl_ctx *ctx); +-int cmd_migrate(int argc, const char **argv, struct daxctl_ctx *ctx); + #endif /* _DAXCTL_BUILTIN_H_ */ +diff -uprN ndctl-65.orig/daxctl/daxctl.c ndctl-65/daxctl/daxctl.c +--- ndctl-65.orig/daxctl/daxctl.c 2019-07-29 14:41:44.486017168 -0400 ++++ ndctl-65/daxctl/daxctl.c 2019-07-29 14:53:10.288257995 -0400 +@@ -70,7 +70,6 @@ static struct cmd_struct commands[] = { + { "version", .d_fn = cmd_version }, + { "list", .d_fn = cmd_list }, + { "help", .d_fn = cmd_help }, +- { "migrate-device-model", .d_fn = cmd_migrate }, + }; + + int main(int argc, const char **argv) +diff -uprN ndctl-65.orig/daxctl/migrate.c ndctl-65/daxctl/migrate.c +--- ndctl-65.orig/daxctl/migrate.c 2019-07-29 14:41:44.487017171 -0400 ++++ ndctl-65/daxctl/migrate.c 1969-12-31 19:00:00.000000000 -0500 +@@ -1,41 +0,0 @@ +-/* SPDX-License-Identifier: GPL-2.0 */ +-/* Copyright(c) 2019 Intel Corporation. All rights reserved. */ +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-int cmd_migrate(int argc, const char **argv, struct daxctl_ctx *ctx) +-{ +- int i; +- static const struct option options[] = { +- OPT_END(), +- }; +- const char * const u[] = { +- "daxctl migrate-device-model", +- NULL +- }; +- +- argc = parse_options(argc, argv, options, u, 0); +- for (i = 0; i < argc; i++) +- error("unknown parameter \"%s\"\n", argv[i]); +- +- if (argc) +- usage_with_options(u, options); +- +- if (symlink(DAXCTL_MODPROBE_DATA, DAXCTL_MODPROBE_INSTALL) == 0) { +- fprintf(stderr, " success: installed %s\n", +- DAXCTL_MODPROBE_INSTALL); +- return EXIT_SUCCESS; +- } +- +- error("failed to install %s: %s\n", DAXCTL_MODPROBE_INSTALL, +- strerror(errno)); +- +- return EXIT_FAILURE; +-} diff --git a/SOURCES/dracut-nvdimm-security.conf b/SOURCES/dracut-nvdimm-security.conf index 6ae6314..fa83ad1 100644 --- a/SOURCES/dracut-nvdimm-security.conf +++ b/SOURCES/dracut-nvdimm-security.conf @@ -1,3 +1,3 @@ # Make sure libnvdimm is loaded and ndctl is available in the initramfs install_items+="/bin/ndctl" -add_drivers+="libnvdimm" +add_drivers+=" libnvdimm " diff --git a/SOURCES/kmod-remove-space-before-semicolon-in-nvdimm-security-conf.patch b/SOURCES/kmod-remove-space-before-semicolon-in-nvdimm-security-conf.patch new file mode 100644 index 0000000..f576cd1 --- /dev/null +++ b/SOURCES/kmod-remove-space-before-semicolon-in-nvdimm-security-conf.patch @@ -0,0 +1,6 @@ +diff -up ndctl-65/contrib/nvdimm-security.conf.orig ndctl-65/contrib/nvdimm-security.conf +--- ndctl-65/contrib/nvdimm-security.conf.orig 2019-08-06 16:00:24.264089607 -0400 ++++ ndctl-65/contrib/nvdimm-security.conf 2019-08-06 16:00:34.971125206 -0400 +@@ -1 +1 @@ +-install libnvdimm /usr/bin/ndctl load-keys ; /sbin/modprobe --ignore-install libnvdimm $CMDLINE_OPTS ++install libnvdimm /usr/bin/ndctl load-keys; /sbin/modprobe --ignore-install libnvdimm $CMDLINE_OPTS diff --git a/SOURCES/ndctl-rhel7-fix-make-check.patch b/SOURCES/ndctl-rhel7-fix-make-check.patch new file mode 100644 index 0000000..e7545b1 --- /dev/null +++ b/SOURCES/ndctl-rhel7-fix-make-check.patch @@ -0,0 +1,95 @@ +diff --git a/test/core.c b/test/core.c +index b9e3bbf..4b36b2d 100644 +--- a/test/core.c ++++ b/test/core.c +@@ -129,8 +129,6 @@ int nfit_test_init(struct kmod_ctx **ctx, struct kmod_module **mod, + "nfit", + "device_dax", + "dax_pmem", +- "dax_pmem_core", +- "dax_pmem_compat", + "libnvdimm", + "nd_blk", + "nd_btt", +diff --git a/test/device-dax.c b/test/device-dax.c +index b19c1ed..d85862b 100644 +--- a/test/device-dax.c ++++ b/test/device-dax.c +@@ -166,6 +166,7 @@ static int __test_device_dax(unsigned long align, int loglevel, + if (!ndctl_test_attempt(test, KERNEL_VERSION(4, 7, 0))) + return 77; + ++#if 0 + /* setup up fsdax mode pmem device and seed with verification data */ + rc = setup_pmem_fsdax_mode(ndns, align); + if (rc < 0 || !(pfn = ndctl_namespace_get_pfn(ndns))) { +@@ -199,7 +200,7 @@ static int __test_device_dax(unsigned long align, int loglevel, + } + fsync(fd); + close(fd); +- ++#endif + /* switch the namespace to device-dax mode and verify data via mmap */ + rc = setup_device_dax(ndns, align); + if (rc < 0) { +@@ -219,6 +220,7 @@ static int __test_device_dax(unsigned long align, int loglevel, + } + + sprintf(path, "/dev/%s", daxctl_dev_get_devname(dev)); ++#if 0 + fd = open(path, O_RDONLY); + if (fd < 0) { + fprintf(stderr, "%s: failed to open(O_RDONLY) device-dax instance\n", +@@ -246,7 +248,7 @@ static int __test_device_dax(unsigned long align, int loglevel, + + close(fd); + munmap(buf, VERIFY_SIZE(align)); +- ++#endif + /* + * Prior to 4.8-final these tests cause crashes, or are + * otherwise not supported. +@@ -262,6 +264,7 @@ static int __test_device_dax(unsigned long align, int loglevel, + rc = -ENXIO; + goto out; + } ++ + rc = test_dax_directio(fd, align, NULL, 0); + if (rc) { + fprintf(stderr, "%s: failed dax direct-i/o\n", +diff --git a/test/libndctl.c b/test/libndctl.c +index 02bb9cc..2a20941 100644 +--- a/test/libndctl.c ++++ b/test/libndctl.c +@@ -160,9 +160,9 @@ static struct btt { + int enabled; + uuid_t uuid; + int num_sector_sizes; +- unsigned int sector_sizes[7]; ++ unsigned int sector_sizes[2]; + } default_btt = { +- 0, { 0, }, 7, { 512, 520, 528, 4096, 4104, 4160, 4224, }, ++ 0, { 0, }, 2, { 512, 4096, }, + }; + + struct pfn { +@@ -214,8 +214,8 @@ static struct btt btt_settings = { + .uuid = { 0, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15 + }, +- .num_sector_sizes = 7, +- .sector_sizes = { 512, 520, 528, 4096, 4104, 4160, 4224, }, ++ .num_sector_sizes = 2, ++ .sector_sizes = { 512, 4096, }, + }; + + static struct pfn pfn_settings = { +@@ -250,7 +250,7 @@ struct namespace { + }; + + static uuid_t null_uuid; +-static unsigned long blk_sector_sizes[] = { 512, 520, 528, 4096, 4104, 4160, 4224, }; ++static unsigned long blk_sector_sizes[] = { 512, 4096, }; + static unsigned long pmem_sector_sizes[] = { 512, 4096 }; + static unsigned long io_sector_sizes[] = { 0 }; + diff --git a/SPECS/ndctl.spec b/SPECS/ndctl.spec index 84a9361..f69a74e 100644 --- a/SPECS/ndctl.spec +++ b/SPECS/ndctl.spec @@ -1,6 +1,6 @@ Name: ndctl -Version: 64.1 -Release: 2%{?dist} +Version: 65 +Release: 5%{?dist} Summary: Manage "libnvdimm" subsystem devices (Non-volatile Memory) License: GPLv2 Group: System Environment/Base @@ -9,6 +9,9 @@ Source0: https://github.com/pmem/%{name}/archive/v%{version}.tar.gz#/%{name}-%{v Source1: dracut-nvdimm-security.conf Patch0: ndctl-64-disable-asciidoctor.patch +Patch1: ndctl-rhel7-fix-make-check.patch +Patch2: daxctl-remove-migrate-device-model.patch +Patch3: kmod-remove-space-before-semicolon-in-nvdimm-security-conf.patch Requires: ndctl-libs%{?_isa} = %{version}-%{release} Requires: daxctl-libs%{?_isa} = %{version}-%{release} @@ -92,6 +95,9 @@ control API for these devices. %prep %setup -q ndctl-%{version} %patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 chmod +x test/monitor.sh %build @@ -164,6 +170,35 @@ make check %changelog +* Tue Sep 10 2019 Jeff Moyer - 65.5.el7 +- Once again attempt to fix nvdimm-security.conf +- Resolves: rhbz#1750199 + +* Mon Aug 12 2019 Jeff Moyer - 65.4.el7 +- Add spaces to the add_driver directive in the dracut module +- Resolves: rhbz#1740383 + +* Tue Aug 06 2019 Jeff Moyer - 65.3.el7 +- modify nvdimm-security.conf touse '&&' instead of ';' + Without this change, the module doesn't load +- Resolves: rhbz#1725405 + +* Mon Jul 29 2019 Jeff Moyer - 65.2.el7 +- Remove 'daxctl migrate-device-model' command. We won't + support hot-plugging device dax into the memory hierarchy + on RHEL 7. +- Resolves: rhbz#1734153 + +* Thu Jul 25 2019 Jeff Moyer - 65.1.el7 +- Rebase to v65 + - clear-errors: new command to clear errors on a namespace + - monitor: remove the requirement of a default config + - sanitize-dimm: allow a zero-key for secure-erase + - sanitize-dimm: preserve keys after an overwrite + - load-keys: fix for non-TPM keys +- Fix test harness to run against the rhel7 test kernel modules +- Related: rhbz#1722481 + * Wed Mar 27 2019 Jeff Moyer - 64.1-2 - Fix initramfs creating by forcing installation of libnvdimm.ko - Related: bz#1634348