From 728eec13c72520675b316e26e0f5684a79f3367e Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 05 2019 21:27:25 +0000 Subject: import ndctl-65-1.el8 --- diff --git a/.gitignore b/.gitignore index 9b63ddb..95acd8f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/ndctl-62.tar.gz +SOURCES/ndctl-65.tar.gz diff --git a/.ndctl.metadata b/.ndctl.metadata index b4b822d..d4c53b7 100644 --- a/.ndctl.metadata +++ b/.ndctl.metadata @@ -1 +1 @@ -0f906e39f1af10fe60748b8862e761fe36abd985 SOURCES/ndctl-62.tar.gz +65bfc783a624628e5eb60e936f46e6b543025670 SOURCES/ndctl-65.tar.gz diff --git a/SOURCES/5c67ce4-ndctl-Revert-ndctl-Create-ndctl-udev-rules-for-dirty-shutdown.patch b/SOURCES/5c67ce4-ndctl-Revert-ndctl-Create-ndctl-udev-rules-for-dirty-shutdown.patch deleted file mode 100644 index 1bd9230..0000000 --- a/SOURCES/5c67ce4-ndctl-Revert-ndctl-Create-ndctl-udev-rules-for-dirty-shutdown.patch +++ /dev/null @@ -1,499 +0,0 @@ -ndctl: Revert "ndctl: Create ndctl udev rules for dirty shutdown" - -BZ: 1637624 - -commit 5c67ce4d0b6a678c52f35a6a1e2dd14983076a19 -Author: Dan Williams -Date: Thu Sep 27 17:41:53 2018 -0700 - - ndctl: Revert "ndctl: Create ndctl udev rules for dirty shutdown" - - Environments that choose to implement dirty-shutdown mitigation can use - 'list --dimm --health nmemX' to retrieve the dirty-shutdown count, or - the new 'nmemX/nfit/dirty_shutdown' attribute in sysfs. The kernel - otherwise takes no default action on that counter rolling. If the - platform advertises support for "Memory Controller Flush to NVDIMM - Durability on Power Loss Capable" then the default Linux policy is to - trust that designation. - - Otherwise this usage of libndctl enumeration apis in the udev path - causes the entire udev queue to backup behind libnvdimm sub-system - initialization: - - INFO: task systemd-udevd:1554 blocked for more than 120 seconds. - "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. - systemd-udevd D 0 1554 1544 0x80000004 - Call Trace: - ? __schedule+0x25d/0x870 - schedule+0x28/0x80 - async_synchronize_cookie_domain+0x96/0x140 - ? finish_wait+0x80/0x80 - nvdimm_bus_check_dimm_count+0x31/0xa0 [libnvdimm] - acpi_nfit_register_dimms+0x4b5/0x800 [nfit] - acpi_nfit_init+0xca6/0x1300 [nfit] - ? acpi_nfit_add+0x197/0x210 [nfit] - acpi_nfit_add+0x197/0x210 [nfit] - acpi_device_probe+0x48/0x110 - - Cc: Keith Busch - Cc: Vishal Verma - Signed-off-by: Dan Williams - Signed-off-by: Vishal Verma - -diff -uprN ndctl-62/.gitignore ndctl-62.new/.gitignore ---- ndctl-62/.gitignore 2018-08-13 20:06:33.000000000 -0400 -+++ ndctl-62.new/.gitignore 2018-10-09 11:55:10.410374923 -0400 -@@ -25,7 +25,6 @@ daxctl/lib/libdaxctl.pc - *.a - ndctl/lib/libndctl.pc - ndctl/ndctl --ndctl/ndctl-udev - rhel/ - sles/ndctl.spec - util/log.lo -diff -uprN ndctl-62/Makefile.am ndctl-62.new/Makefile.am ---- ndctl-62/Makefile.am 2018-08-13 20:06:33.000000000 -0400 -+++ ndctl-62.new/Makefile.am 2018-10-09 11:55:10.410374923 -0400 -@@ -42,9 +42,6 @@ bashcompletiondir = $(BASH_COMPLETION_DI - dist_bashcompletion_DATA = contrib/ndctl - endif - --udevrulesdir = $(UDEVDIR)/rules.d --dist_udevrules_DATA = contrib/80-ndctl.rules -- - noinst_LIBRARIES = libccan.a - libccan_a_SOURCES = \ - ccan/str/str.h \ -diff -uprN ndctl-62/configure.ac ndctl-62.new/configure.ac ---- ndctl-62/configure.ac 2018-08-13 20:06:33.000000000 -0400 -+++ ndctl-62.new/configure.ac 2018-10-09 11:58:18.412932195 -0400 -@@ -169,9 +169,6 @@ AC_ARG_WITH([tmpfilesdir], - [tmpfilesdir=$withval], - [tmpfilesdir="/run"]) - --UDEVDIR="$(pkg-config udev --variable=udevdir)" --AC_SUBST([UDEVDIR]) -- - my_CFLAGS="\ - -D DEF_CONF_FILE='\"${sysconfdir}/ndctl/monitor.conf\"' \ - -D DEF_TMPFS_DIR='\"${tmpfilesdir}/ndctl\"' \ -diff -uprN ndctl-62/configure.ac.orig ndctl-62.new/configure.ac.orig ---- ndctl-62/configure.ac.orig 1969-12-31 19:00:00.000000000 -0500 -+++ ndctl-62.new/configure.ac.orig 2018-10-09 11:54:00.000000000 -0400 -@@ -0,0 +1,223 @@ -+AC_PREREQ(2.60) -+m4_include([version.m4]) -+AC_INIT([ndctl], -+ GIT_VERSION, -+ [linux-nvdimm@lists.01.org], -+ [ndctl], -+ [https://github.com/pmem/ndctl]) -+AC_CONFIG_SRCDIR([ndctl/lib/libndctl.c]) -+AC_CONFIG_AUX_DIR([build-aux]) -+AM_INIT_AUTOMAKE([ -+ check-news -+ foreign -+ 1.11 -+ -Wall -+ -Wno-portability -+ silent-rules -+ tar-pax -+ no-dist-gzip -+ dist-xz -+ subdir-objects -+]) -+AC_PROG_CC_STDC -+AC_USE_SYSTEM_EXTENSIONS -+AC_SYS_LARGEFILE -+AC_CONFIG_MACRO_DIR([m4]) -+AM_SILENT_RULES([yes]) -+LT_INIT([ -+ disable-static -+ pic-only -+]) -+AC_PREFIX_DEFAULT([/usr]) -+ -+AC_PROG_SED -+AC_PROG_MKDIR_P -+ -+AC_ARG_ENABLE([docs], -+ AS_HELP_STRING([--disable-docs], -+ [disable documentation build @<:@default=enabled@:>@]), -+ [], enable_docs=yes) -+AS_IF([test "x$enable_docs" = "xyes"], [ -+ AC_DEFINE(ENABLE_DOCS, [1], [Documentation / man pages.]) -+]) -+AM_CONDITIONAL([ENABLE_DOCS], [test "x$enable_docs" = "xyes"]) -+ -+AC_ARG_ENABLE([asciidoctor], -+ AS_HELP_STRING([--enable-asciidoctor], -+ [use asciidoctor for documentation build]), -+ [], enable_asciidoctor=no) -+AM_CONDITIONAL([USE_ASCIIDOCTOR], [test "x$enable_asciidoctor" = "xyes"]) -+if test "x$enable_asciidoctor" = "xyes"; then -+ asciidoc="asciidoctor" -+else -+ asciidoc="asciidoc" -+fi -+AC_CHECK_PROG(ASCIIDOC, [$asciidoc], [$(which $asciidoc)], [missing]) -+if test "x$ASCIIDOC" = xmissing -a "x$enable_docs" = "xyes"; then -+ AC_MSG_ERROR([$asciidoc needed to build documentation]) -+fi -+AC_SUBST([ASCIIDOC]) -+ -+if test x"$asciidoc" = x"asciidoc"; then -+AC_CHECK_PROG(XMLTO, [xmlto], [$(which xmlto)], [missing]) -+if test "x$XMLTO" = xmissing -a "x$enable_docs" = "xyes"; then -+ AC_MSG_ERROR([xmlto needed to build documentation]) -+fi -+AC_SUBST([XMLTO]) -+fi -+ -+AC_C_TYPEOF -+AC_DEFINE([HAVE_STATEMENT_EXPR], 1, [Define to 1 if you have statement expressions.]) -+ -+AC_C_BIGENDIAN( -+ AC_DEFINE(HAVE_BIG_ENDIAN, 1, [Define to 1 if big-endian-arch]), -+ AC_DEFINE(HAVE_LITTLE_ENDIAN, 1, [Define to 1 if little-endian-arch]), -+ [], []) -+ -+AC_ARG_ENABLE([logging], -+ AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]), -+ [], enable_logging=yes) -+AS_IF([test "x$enable_logging" = "xyes"], [ -+ AC_DEFINE(ENABLE_LOGGING, [1], [System logging.]) -+]) -+ -+AC_ARG_ENABLE([debug], -+ AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]), -+ [], [enable_debug=no]) -+AS_IF([test "x$enable_debug" = "xyes"], [ -+ AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.]) -+]) -+ -+AC_ARG_ENABLE([destructive], -+ AS_HELP_STRING([--enable-destructive], [enable destructive functional tests @<:@default=disabled@:>@]), -+ [], [enable_destructive=no]) -+AS_IF([test "x$enable_destructive" = "xyes"], -+ [AC_DEFINE([ENABLE_DESTRUCTIVE], [1], [destructive functional tests support])]) -+AM_CONDITIONAL([ENABLE_DESTRUCTIVE], [test "x$enable_destructive" = "xyes"]) -+ -+AC_ARG_ENABLE([test], -+ AS_HELP_STRING([--enable-test], [enable ndctl test command @<:@default=disabled@:>@]), -+ [], [enable_test=$enable_destructive]) -+AS_IF([test "x$enable_test" = "xyes"], -+ [AC_DEFINE([ENABLE_TEST], [1], [ndctl test support])]) -+AM_CONDITIONAL([ENABLE_TEST], [test "x$enable_test" = "xyes"]) -+ -+AC_CHECK_DECLS([BUS_MCEERR_AR], [enable_bus_mc_err=yes], [], [[#include ]]) -+AC_CHECK_DECLS([MAP_SYNC], [enable_map_sync=yes], [], [[#include ]]) -+ -+AS_IF([test "x$enable_bus_mc_err" = "xyes" -a "x$enable_map_sync" = "xyes"], -+ [AC_DEFINE([ENABLE_POISON], [1], [ndctl test poison support])]) -+AM_CONDITIONAL([ENABLE_POISON], -+ [test "x$enable_bus_mc_err" = "xyes" -a "x$enable_map_sync" = "xyes"]) -+ -+PKG_CHECK_MODULES([KMOD], [libkmod]) -+PKG_CHECK_MODULES([UUID], [uuid]) -+PKG_CHECK_MODULES([JSON], [json-c]) -+ -+AC_ARG_WITH([bash-completion-dir], -+ AS_HELP_STRING([--with-bash-completion-dir[=PATH]], -+ [Install the bash auto-completion script in this directory. @<:@default=yes@:>@]), -+ [], -+ [with_bash_completion_dir=yes]) -+ -+if test "x$with_bash_completion_dir" = "xyes"; then -+ PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0], -+ [BASH_COMPLETION_DIR="`pkg-config --variable=completionsdir bash-completion`"], -+ [BASH_COMPLETION_DIR="$datadir/bash-completion/completions"]) -+else -+ BASH_COMPLETION_DIR="$with_bash_completion_dir" -+fi -+ -+AC_SUBST([BASH_COMPLETION_DIR]) -+AM_CONDITIONAL([ENABLE_BASH_COMPLETION],[test "x$with_bash_completion_dir" != "xno"]) -+ -+AC_ARG_ENABLE([local], -+ AS_HELP_STRING([--disable-local], [build against kernel ndctl.h @<:@default=system@:>@]), -+ [], [enable_local=yes]) -+ -+AC_CHECK_HEADERS_ONCE([linux/version.h]) -+ -+AC_CHECK_FUNCS([ \ -+ __secure_getenv \ -+ secure_getenv\ -+]) -+ -+PKG_PROG_PKG_CONFIG -+AC_ARG_WITH([systemd-unit-dir], -+ AS_HELP_STRING([--with-systemd-unit-dir[=DIR]], -+ [Directory for systemd service files]), -+ [], -+ [with_systemd_unit_dir=yes]) -+ -+if test "x$with_systemd_unit_dir" = "xyes"; then -+ def_systemd_unit_dir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd) -+ if test "x$def_systemd_unit_dir" = "x"; then -+ AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package]) -+ with_systemd_unit_dir=no -+ else -+ with_systemd_unit_dir="$def_systemd_unit_dir" -+ fi -+fi -+ -+AS_IF([test "x$with_systemd_unit_dir" != "xno"], -+ [AC_SUBST([systemd_unitdir], [$with_systemd_unit_dir])]) -+AM_CONDITIONAL([ENABLE_SYSTEMD_UNIT_DIR], [test "x$with_systemd_unit_dir" != "xno"]) -+ -+AC_ARG_WITH([tmpfilesdir], -+ [AS_HELP_STRING([--with-tmpfilesdir=DIR], [Directory for temporary runtime files])], -+ [tmpfilesdir=$withval], -+ [tmpfilesdir="/run"]) -+ -+my_CFLAGS="\ -+-D DEF_CONF_FILE='\"${sysconfdir}/ndctl/monitor.conf\"' \ -+-D DEF_TMPFS_DIR='\"${tmpfilesdir}/ndctl\"' \ -+-Wall \ -+-Wchar-subscripts \ -+-Wformat-security \ -+-Wmissing-declarations \ -+-Wmissing-prototypes \ -+-Wnested-externs \ -+-Wpointer-arith \ -+-Wshadow \ -+-Wsign-compare \ -+-Wstrict-prototypes \ -+-Wtype-limits \ -+-Wmaybe-uninitialized \ -+-Wdeclaration-after-statement \ -+-Wunused-result \ -+-D_FORTIFY_SOURCE=2 \ -+-O2 -+" -+AC_SUBST([my_CFLAGS]) -+ -+AC_CONFIG_HEADERS(config.h) -+AC_CONFIG_FILES([ -+ Makefile -+ daxctl/lib/Makefile -+ ndctl/lib/Makefile -+ ndctl/Makefile -+ daxctl/Makefile -+ test/Makefile -+ Documentation/ndctl/Makefile -+ Documentation/daxctl/Makefile -+]) -+ -+AC_OUTPUT -+AC_MSG_RESULT([ -+ $PACKAGE $VERSION -+ ===== -+ -+ prefix: ${prefix} -+ sysconfdir: ${sysconfdir} -+ libdir: ${libdir} -+ includedir: ${includedir} -+ systemd-unit-dir: ${systemd_unitdir} -+ tmpfilesdir: ${tmpfilesdir} -+ -+ compiler: ${CC} -+ cflags: ${CFLAGS} -+ ldflags: ${LDFLAGS} -+ -+ logging: ${enable_logging} -+ debug: ${enable_debug} -+]) -diff -uprN ndctl-62/contrib/80-ndctl.rules ndctl-62.new/contrib/80-ndctl.rules ---- ndctl-62/contrib/80-ndctl.rules 2018-08-13 20:06:33.000000000 -0400 -+++ ndctl-62.new/contrib/80-ndctl.rules 1969-12-31 19:00:00.000000000 -0500 -@@ -1,3 +0,0 @@ --# do not edit this file, it will be overwritten on update -- --ACTION=="add", KERNEL=="nmem*", RUN+="ndctl-udev $kernel" -diff -uprN ndctl-62/ndctl/Makefile.am ndctl-62.new/ndctl/Makefile.am ---- ndctl-62/ndctl/Makefile.am 2018-08-13 20:06:33.000000000 -0400 -+++ ndctl-62.new/ndctl/Makefile.am 2018-10-09 11:55:10.411374926 -0400 -@@ -51,8 +51,3 @@ EXTRA_DIST += $(monitor_config_file) - if ENABLE_SYSTEMD_UNIT_DIR - systemd_unit_DATA = ndctl-monitor.service - endif -- --ndctl_udevdir = $(UDEVDIR) --ndctl_udev_PROGRAMS = ndctl-udev --ndctl_udev_SOURCES = ndctl-udev.c --ndctl_udev_LDADD = lib/libndctl.la -diff -uprN ndctl-62/ndctl/ndctl-udev.c ndctl-62.new/ndctl/ndctl-udev.c ---- ndctl-62/ndctl/ndctl-udev.c 2018-08-13 20:06:33.000000000 -0400 -+++ ndctl-62.new/ndctl/ndctl-udev.c 1969-12-31 19:00:00.000000000 -0500 -@@ -1,150 +0,0 @@ --/* SPDX-License-Identifier: GPL-2.0 */ --/* Copyright(c) 2018 Intel Corporation. All rights reserved. */ -- --#include --#include --#include --#include --#include --#include --#include --#include --#include --#include -- --/** -- * mkdir_p -- * -- * Copied from util-linux lib/fileutils.c -- */ --static int mkdir_p(const char *path, mode_t mode) --{ -- char *p, *dir; -- int rc = 0; -- -- if (!path || !*path) -- return -EINVAL; -- -- dir = p = strdup(path); -- if (!dir) -- return -ENOMEM; -- -- if (*p == '/') -- p++; -- -- while (p && *p) { -- char *e = strchr(p, '/'); -- if (e) -- *e = '\0'; -- if (*p) { -- rc = mkdir(dir, mode); -- if (rc && errno != EEXIST) -- break; -- rc = 0; -- } -- if (!e) -- break; -- *e = '/'; -- p = e + 1; -- } -- -- free(dir); -- return rc; --} -- --static struct ndctl_dimm *find_dimm(struct ndctl_ctx *ctx, const char *devname) --{ -- struct ndctl_bus *bus; -- struct ndctl_dimm *dimm; -- -- ndctl_bus_foreach(ctx, bus) { -- ndctl_dimm_foreach(bus, dimm) { -- if (strcmp(ndctl_dimm_get_devname(dimm), devname) == 0) -- return dimm; -- } -- } -- return NULL; --} -- --static void ack_shutdown(struct ndctl_dimm *dimm) --{ -- struct ndctl_cmd *cmd; -- -- cmd = ndctl_dimm_cmd_new_ack_shutdown_count(dimm); -- if (!cmd) -- return; -- ndctl_cmd_submit(cmd); -- ndctl_cmd_unref(cmd); --} -- --static void save_unsafe_shutdown_count(struct ndctl_dimm *dimm, -- const char *devname) --{ -- char *path, *usc, count[16]; -- unsigned int shutdown; -- struct ndctl_cmd *cmd; -- int fd; -- -- cmd = ndctl_dimm_cmd_new_smart(dimm); -- if (!cmd) -- return; -- -- if (ndctl_cmd_submit(cmd)) -- goto unref_cmd; -- -- shutdown = ndctl_cmd_smart_get_shutdown_count(cmd); -- if (shutdown == UINT_MAX) -- goto unref_cmd; -- -- if (asprintf(&path, DEF_TMPFS_DIR "/%s", devname) < 0) -- goto unref_cmd; -- -- if (mkdir_p(path, 0755)) -- goto free_path; -- -- if (asprintf(&usc, "%s/usc", path) < 0) -- goto free_path; -- -- fd = open(usc, O_WRONLY | O_CREAT, 0644); -- if (fd < 0) -- goto free_usc; -- -- if (snprintf(count, sizeof(count), "%u\n", shutdown) < 0) -- goto close_fd; -- -- if (write(fd, count, strlen(count)) < 0) -- goto close_fd; -- -- close_fd: -- close(fd); -- free_usc: -- free(usc); -- free_path: -- free(path); -- unref_cmd: -- ndctl_cmd_unref(cmd); --} -- --int main(int argc, char *argv[]) --{ -- struct ndctl_ctx *ctx; -- struct ndctl_dimm *dimm = NULL; -- const char *devname; -- -- if (argc < 2) -- return EINVAL; -- -- devname = argv[1]; -- if (ndctl_new(&ctx)) -- return ENOMEM; -- -- dimm = find_dimm(ctx, devname); -- if (!dimm) -- return ENODEV; -- -- ack_shutdown(dimm); -- save_unsafe_shutdown_count(dimm, devname); -- -- ndctl_unref(ctx); -- return 0; --} -diff -uprN ndctl-62/ndctl.spec.in ndctl-62.new/ndctl.spec.in ---- ndctl-62/ndctl.spec.in 2018-08-13 20:06:33.000000000 -0400 -+++ ndctl-62.new/ndctl.spec.in 2018-10-09 11:55:10.411374926 -0400 -@@ -110,7 +110,6 @@ make check - %postun -n DAX_LNAME -p /sbin/ldconfig - - %define bashcompdir %(pkg-config --variable=completionsdir bash-completion) --%define udevdir %(pkg-config --variable=udevdir udev) - - %files - %defattr(-,root,root) -@@ -120,8 +119,6 @@ make check - %{bashcompdir}/ - %{_sysconfdir}/ndctl/monitor.conf - %{_unitdir}/ndctl-monitor.service --%{_udevrulesdir}/80-ndctl.rules --%{udevdir}/ndctl-udev - - %files -n daxctl - %defattr(-,root,root) diff --git a/SPECS/ndctl.spec b/SPECS/ndctl.spec index 4b5aa4b..1a90639 100644 --- a/SPECS/ndctl.spec +++ b/SPECS/ndctl.spec @@ -1,12 +1,11 @@ Name: ndctl -Version: 62 -Release: 2%{?dist} +Version: 65 +Release: 1%{?dist} Summary: Manage "libnvdimm" subsystem devices (Non-volatile Memory) License: GPLv2 Group: System Environment/Base Url: https://github.com/pmem/ndctl Source0: https://github.com/pmem/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz -Patch0: 5c67ce4-ndctl-Revert-ndctl-Create-ndctl-udev-rules-for-dirty-shutdown.patch Requires: ndctl-libs%{?_isa} = %{version}-%{release} Requires: daxctl-libs%{?_isa} = %{version}-%{release} @@ -22,6 +21,7 @@ BuildRequires: pkgconfig(uuid) BuildRequires: pkgconfig(json-c) BuildRequires: pkgconfig(bash-completion) BuildRequires: systemd +BuildRequires: keyutils-libs-devel %description Utility library for managing the "libnvdimm" subsystem. The "libnvdimm" @@ -88,12 +88,11 @@ control API for these devices. %prep %setup -q ndctl-%{version} -%patch0 -p1 %build echo %{version} > version ./autogen.sh -%configure --disable-static --disable-silent-rules +%configure --disable-static --disable-silent-rules --disable-asciidoctor make %{?_smp_mflags} %install @@ -118,13 +117,17 @@ make check %{_bindir}/ndctl %{_mandir}/man1/ndctl* %{bashcompdir}/ -%{_sysconfdir}/ndctl/monitor.conf %{_unitdir}/ndctl-monitor.service +%{_sysconfdir}/ndctl/keys/keys.readme +%{_sysconfdir}/modprobe.d/nvdimm-security.conf + +%config(noreplace) %{_sysconfdir}/ndctl/monitor.conf %files -n daxctl %license util/COPYING licenses/BSD-MIT licenses/CC0 %{_bindir}/daxctl %{_mandir}/man1/daxctl* +%{_datadir}/daxctl/daxctl.conf %files -n ndctl-libs %doc README.md @@ -150,6 +153,10 @@ make check %changelog +* Mon Jun 3 2019 Jeff Moyer - 65-1.el8 +- Rebase to v65. +- Resolves: bz#1665407 bz#1634349 + * Tue Oct 09 2018 Jeff Moyer