nvme-cli/nvme-cli.spec
Daniel Wagner cfcdd735dd Accepting request 1171771 from home:wagi:branches:Base:System
- Update to version 2.9.1:
  * plugins/spdk: drop the plugin
- Update to version 2.9:
  * nvme-print: expand the maximum field length to prevent misalignment
  * plugins/spdk: plugin to list SPDK subsystems
  * nvme-print: check if controller belong to SPDK
  * plugins/spdk: plugin to list SPDK controllers
  * nvme-print-stdout: fix ASQB, ACQB and BMBBA prints
  * build: bump libnvme wrap
  * nvmf-autoconnect: fix string encoding
  * nvme: identify primary ctrl do not accept nsid
  * nvme-wrap: remove unused nvme_cli_get_log_ana_groups()
  * nvme-print-json: use admin queue attributes definitions
  * nvme-print-json: use CSTS definitions
  * nvme-print-stdout: use POWER_OF_TWO macro
  * nvme-print-json: use controller configuration definitions
  * nvme-print-json, nvme-print-stdout: add tertiary version number
  * nvme-print-json: use NVME_MAJOR and NVME_MINOR definitions
  * nvme-print-json: use NVME_BOOT_PARTITION_INFO field definitions
  * nvme-print-json: add support telemetry log create event in PEL
  * nvme-print-json: add support set feature event in PEL
  * nvme-print-json: add obj_d() function
  * nvme-print-json: add obj_add_uint_0nx() function
  * meson.build: Fix spelling of sed-opal.h filename
  * sed_opal: Only build when we really have sed_opal headers
  * nvme: fix error path if write() fails in get_telemetry_log()
  * plugins/solidigm: Additional LID for temperature statistics.
  * plugins/solidigm: Improved Solidigm UUID index detection.
  * nvme-print-stdout: Add CSTS.ST register stdout print
  * nvme-print-stdout: Use NVME_CMIC definitions
  * nvme-print: Use NVME_UNIT definitions
  * nvme-print-stdout: Use NVME_CMBMSC/STS/EBS/SWTP definitions
  * plugins/ssstc: add a new plugin for SSSTC driver
  * nvmf-connect: systemd hardening effort
  * plugins/ocp: Adjusted variable type size carrying UUID index to 8 bit.
  * nvme: fix security buffer allocation size
  * nvme: Change fw-download xfer initialization to set 0
  * nvme: Add fw-download warning message for FWUG alignment error
  * plugins/ocp: Split ocp_get_uuid_index() into find and get functions.
  * nvme: fix mem leak in multiple key related functions (bsc#1223331)
  * fabrics: fix mem leak in nvmf_check_hostid_and_hostnqn() (bsc#1223331)
  * nvme-print-stdout: Use NVME_BPRSEL definitions
  * nvme-print-stdout: Use NVME_BPINFO definitions
  * nvme-print-stdout: Use NVME_CMBSZ definitions
  * nvme-print-stdout: Use NVME_CMBLOC definitions
  * Revert "logging: fix error handling for ioctl passthru wrappers"
  * fabrics: align identify command payload
  * ocp: Unify line start spacing as tabs
  * ocp: support OCP DSSD Async Event Config feature
  * nvme: Add support for get-reg and set-reg commands
  * nvme-print-json: Add register print functions
  * nvme-print-stdout: Add register print functions
  * nvme-print: Add register print functions
  * nvme: Refactor mmap_registers to add writable parameter
  * nvme-print: Change PMRSZU string function as unit string
  * nvme-print: Refactor CMBLOC and PMRSTS registers function
  * logging: fix error handling for ioctl passthru wrappers
  * nbft: Fix scandir() error check
  * nbft: Refactor connection attempt out
  * nvme-print: Use EOM optional data present macros changed
  * nvme-print: Print cntlid number for controller
  * nvme: check-tls-key fails despite having hostnqn file (bsc#1223331)
  * nvme: print retained key for gen-tls-key's -i option too (bsc#1223331)
  * fabrics : allow host to create duplicate connections to target
  * fabrics: Fix fast_io_fail_tmo option
  * nvme-print-stdout: use admin queue attributes definitions
  * nvme-print-stdout: use CSTS definitions
  * nvme-print-stdout: use controller configuration definitions
  * nvme-print-stdout: use NVME_MAJOR and NVME_MINOR definitions
  * nvme-print-stdout: use FDP configuration attributes definitions
  * nvme: add new function 'tls_key'
  * nvme: use library functions for importing and exporting TLS keys (bsc#1216982)
  * nvme: extend error message for ns scan failures
  * nvme-print-json: Bugfix status json key of sanitize-log
  * sed: update SED password when initalizing (bsc#1222168)
  * plugins/memblaze: add performance stats
  * plugins/memblaze: fix code mis-type error
  * plugins/memblaze: code refactor on applying __packed on more structs
  * plugins/memblaze: code refactor on using cleanup_nvme_dev
  * nvme: Fix to cleanup free raw_secret memory allocated
  * plugins/memblaze: code-format on leading indent and align
  * plugins/wdc: Fix narrow index variable type in for loop to __u32
  * plugins/wdc: Whitespace changes
  * nvme: Delete unused nvme root scanned
  * ocp: support OCP 2.5 Set Telemetry Profile feature
  * nvme: Don't seg fault if given device is not char/block device
  * nbft: Include SSNS index in error messages (bsc#1222026)
  * nbft: Pause logging for expected connection failures (bsc#1222026)
  * nbft: Silence connection failures for unavailable SSNS (bsc#1222026)
  * nbft: Fix 'verbose' argument type (bsc#1222026)
  * plugins/nbft: Implement verbose logging
  * plugins/nbft: Print the new SSNS flags
  * nbft: Fix uninitialized variable
  * plugins/nbft: Fix uninitialized variables
  * plugins/sed: Fix uninitialized variable
  * nvme-print-stdout: Fix uninitialized variable
  * nvme-print-json: Fix uninitialized variable
  * build: Switch default meson buildtype to 'debugoptimized'
  * nvme: do not scan topology when mmaping registers
  * nvme-print-stdout: Use NVME_BOOT_PARTITION_INFO field definitions
  * nvme-print-stdout: Use NVME_GET for MI commands supported and effects CSP
  * nvme-print-stdout: Use NVME_GET for FID supported and effects FSP
  * nvme-print-stdout: Use NVME_SET_FEAT_EVENT register definitions
  * nvme-print: Add PEL EHAI port identifier type printf function
  * build: bump libnvme wrap
  * ocp: fix for power-state argument checking
  * nvme: do not issue warning when nvme_core module is not loaded
  * wdc: Review changes and build fixes
  * wdc:  Fix timestamp displayed by vs-firmware-activate-history command
  * logging: Split to output ioctl latency by log info level
  * nvme-print-stdout: Change hexadecimal value 0x prefix to use %#x
  * nvme-print-stdout: Fix LBA status DSLBA output as hexadecimal
  * nvme-print-stdout: Split line length exceeded 100 columns
  * nvme-print-stdout: Use NVME_PMRMSC register definitions to print
  * nvme-print-stdout: Use NVME_PMRSWTP register definitions to print
  * nvme-print-stdout: Use NVME_PMREBS register definitions to print
  * nvme-print-stdout: Use NVME_PMRSTS register definitions to print
  * nvme-print-stdout: Use NVME_PMRCTL_EN register definition to print
  * nvme-print-stdout: Use NVME_PMRCAP register definition to print
  * doc: Fix admin and io passthru cdw parameters description
  * doc: Add get-feature cdw11 and set-feature cdw12 parameters
  * micron-nvme: Unuse stat() to check if strMainDirName exists
  * doc: Fix get-property and set-property offset and value descriptions
  * doc: Fix documentation file mode 100755 to 100644
  * nvme-print-stdout: Fix channel configuration descriptors pointer
  * nvme-print-stdout: Check sscanf return value
  * nvme-print-stdout: Fix linux kernel check patch errors
  * nvme: Delete unusual fallthrough for cases have no body
  * nvme: Delete duplicated semicolon
  * nvme-print, common: Fix for whitespace change
  * logging: output ioctl debugging info
  * nvme: track verbose level
  * logging: track log level globally
  * logging: move logging code to a new file
  * nvme: update include for libnvme
  * nvme: remove unused declaration
  * build: bump libnvme wrap
  * nvme-netapp: add nspath tlv handling (bsc#1220971)
  * rpm: Add missing rule and service files
  * nvme-print-json, nvme-print-stdout: Use CHAR_BIT definition
  * nvme-print-stdout: Delete duplicated if condition checking line
  * ocp: Fix timestamp displayed by fw-activate-history command
  * wdc: Add support for the get-drive-status command to SN861
  * nvme-print: Fix nvme_host_metadata_type_to_string() indentation errors
  * nvme-print: Add PEL RCI port identifier type printf function
  * nvme-print-stdout: Use persistent event log RCI definitions
  * build: bump libnvme wrap
  * nvme: Add show-regs and get-property commands NSSD print outputs
  * nvme-print: print more details in ns-descs verbose output (bsc#1223331)
  * Revert "nvme-print-json: remove obj_print helper"
  * sed: Confirm entered password before initialization.
- drop systemd service harden file, upstream ships this patch.
  * remove 0100-harden_nvmf-connect@.service.patch

OBS-URL: https://build.opensuse.org/request/show/1171771
OBS-URL: https://build.opensuse.org/package/show/Base:System/nvme-cli?expand=0&rev=157
2024-05-03 14:21:24 +00:00

189 lines
5.5 KiB
RPMSpec

#
# spec file for package nvme-cli
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%bcond_without check
Name: nvme-cli
Version: 2.9.1
Release: 0
Summary: NVM Express user space tools
License: GPL-2.0-only
Group: Hardware/Other
URL: https://github.com/linux-nvme/nvme-cli/
Source0: nvme-cli-%{version}.tar.gz
Source1: nvme-cli-rpmlintrc
BuildRequires: asciidoc
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: libjson-c-devel
BuildRequires: libnvme-devel
BuildRequires: meson
BuildRequires: pkgconfig
BuildRequires: systemd-rpm-macros
BuildRequires: xmlto
BuildRequires: zlib-devel
BuildRequires: pkgconfig(bash-completion)
BuildRequires: pkgconfig(libudev)
# nvme-cli API for NBFT support.
Provides: nvmeof-boot-support = 0.1
%systemd_ordering
%description
NVM Express (NVMe) is a direct attached storage interface. The
nvme-cli package contains core management tools with minimal
dependencies.
%package -n nvme-cli-regress-script
Summary: A small script to test the nvme binary for regressions
Group: Hardware/Other
Requires: nvme-cli
BuildArch: noarch
%description -n nvme-cli-regress-script
A small shell script to test the nvme binary for regressions. It requires an
NVMe device for testing purposes. Do NOT use in a production environment.
%package bash-completion
Summary: NVM Express user space tools bash completion
Group: System/Shells
Requires: %{name} = %{version}
Requires: bash-completion
Supplements: (nvme-cli and bash-completion)
BuildArch: noarch
%description bash-completion
Optional dependency offering bash completion for NVM Express user space tools
%package zsh-completion
Summary: NVM Express user space tools zsh completion
Group: System/Shells
Requires: %{name} = %{version}
Requires: zsh
Supplements: (nvme-cli and zsh)
BuildArch: noarch
%description zsh-completion
Optional dependency offering zsh completion for NVM Express user space tools
%prep
%autosetup -p1
%build
export KBUILD_BUILD_TIMESTAMP=@${SOURCE_DATE_EPOCH:-$(date +%s)}
%meson \
-Dudevrulesdir=%{_udevrulesdir} \
-Ddracutrulesdir=%{_sysconfdir}/dracut/dracut.conf.d \
-Dsystemddir=%{_unitdir} \
-Ddocs=man \
%{?_with_docs_build:-Ddocs-build=true} \
-Dsystemctl=%{_bindir}/systemctl \
-Dversion-tag=%{version}
%meson_build
%if %{with check}
%check
%meson_test
%endif
%install
%meson_install
install -m 644 -D /dev/null %{buildroot}%{_sysconfdir}/nvme/hostnqn
install -m 644 -D /dev/null %{buildroot}%{_sysconfdir}/nvme/hostid
install -m 644 -D /dev/null %{buildroot}%{_sysconfdir}/nvme/discovery.conf
rm %{buildroot}%{_sysconfdir}/dracut/dracut.conf.d/70-nvmf-autoconnect.conf
# for subpackage nvme-cli-regress-script:
install -m 744 -D scripts/regress %{buildroot}%{_sbindir}/nvme-regress
mkdir -p %{buildroot}%{_sbindir}
pushd %{buildroot}%{_sbindir}
ln -s service rcnvmefc-boot-connections
ln -s service rcnvmf-autoconnect
ln -s service rcnvmf-connect
ln -s service rcnvmf-connect-nbft
popd
%define services nvmefc-boot-connections.service nvmf-autoconnect.service nvmf-connect.target nvmf-connect-nbft.service
%pre
%service_add_pre %{services} nvmf-connect@.service
%post
if [ ! -s %{_sysconfdir}/nvme/hostnqn ]; then
%{_bindir}/echo "Generating host NQN."
%{_sbindir}/nvme gen-hostnqn > %{_sysconfdir}/nvme/hostnqn
fi
if [ ! -s %{_sysconfdir}/nvme/hostid ]; then
sed -nr 's/.*:uuid:(.*?)$/\1/p' %{_sysconfdir}/nvme/hostnqn > %{_sysconfdir}/nvme/hostid
fi
%service_add_post %{services} nvmf-connect@.service
%preun
%service_del_preun %{services}
%postun
%service_del_postun %{services}
%posttrans
if [ -f /sys/class/fc/fc_udev_device/nvme_discovery ]; then
%{_bindir}/echo add > /sys/class/fc/fc_udev_device/nvme_discovery
fi
%pre -n nvme-cli-bash-completion
if [ -d %{_datadir}/bash-completion/completions/nvme ]; then
rm -r %{_datadir}/bash-completion/completions/nvme;
fi
%files
%license LICENSE
%doc README.md
%{_sbindir}/nvme
%{_sbindir}/rcnvmefc-boot-connections
%{_sbindir}/rcnvmf-autoconnect
%{_sbindir}/rcnvmf-connect
%{_sbindir}/rcnvmf-connect-nbft
%{_mandir}/man1/nvme*.1*%{?ext_man}
%{_udevrulesdir}/65-persistent-net-nbft.rules
%{_udevrulesdir}/70-nvmf-autoconnect.rules
%{_udevrulesdir}/71-nvmf-netapp.rules
%{_unitdir}/nvmefc-boot-connections.service
%{_unitdir}/nvmf-autoconnect.service
%{_unitdir}/nvmf-connect-nbft.service
%{_unitdir}/nvmf-connect.target
%{_unitdir}/nvmf-connect@.service
%dir %{_sysconfdir}/nvme/
%ghost %{_sysconfdir}/nvme/hostnqn
%ghost %{_sysconfdir}/nvme/hostid
%ghost %{_sysconfdir}/nvme/discovery.conf
%files -n nvme-cli-regress-script
%{_sbindir}/nvme-regress
%files bash-completion
%dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/nvme
%files zsh-completion
%dir %{_datadir}/zsh
%dir %{_datadir}/zsh/site-functions
%{_datadir}/zsh/site-functions/_nvme
%changelog