diff --git a/.gitignore b/.gitignore index c0a99be..1580e5b 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,14 @@ /nvme-cli-2.4.tar.gz /nvme-cli-2.5.tar.gz /nvme-cli-2.6.tar.gz +/nvme-cli-2.7.1.tar.gz +/nvme-cli-2.8.tar.gz +/nvme-cli-2.9.1.tar.gz +/nvme-cli-2.10.tar.gz +/nvme-cli-2.10.2.tar.gz +/nvme-cli-2.11.tar.gz +/nvme-cli-2.12.tar.gz +/nvme-cli-2.13.tar.gz +/nvme-cli-2.14.tar.gz +/nvme-cli-2.15.tar.gz +/nvme-cli-2.16.tar.gz diff --git a/99-nvme-nbft-connect.sh b/99-nvme-nbft-connect.sh new file mode 100644 index 0000000..1dc0324 --- /dev/null +++ b/99-nvme-nbft-connect.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +if [[ "$1" == nbft* ]] && [[ "$2" == "up" ]]; then + systemctl start nvmf-connect-nbft.service +fi diff --git a/99-nvme-nbft-no-ignore-carrier.conf b/99-nvme-nbft-no-ignore-carrier.conf new file mode 100644 index 0000000..4f19515 --- /dev/null +++ b/99-nvme-nbft-no-ignore-carrier.conf @@ -0,0 +1,15 @@ +# Boot from NVMe over TCP (NBFT) +# +# For NVMe/TCP connections that provide namespaces containing rootfs +# it is crucial to react on carrier events and reconnect any missing +# NVMe/TCP connections as defined in the ACPI NBFT table. A custom +# /usr/lib/NetworkManager/dispatcher.d/99-nvme-nbft-connect.sh hook +# will respawn nvmf-connect-nbft.service on such occasion. + +[device-nbft-no-ignore-carrier] + +# only affects nbft0, nbft1, ... interfaces +match-device=interface-name:nbft* + +# react on link up/down events +ignore-carrier=no diff --git a/nvme-cli.spec b/nvme-cli.spec index d94873e..5fa7a3a 100644 --- a/nvme-cli.spec +++ b/nvme-cli.spec @@ -1,30 +1,38 @@ # RHEL 8 compatibility %{!?version_no_tilde: %define version_no_tilde %{shrink:%(echo '%{version}' | tr '~' '-')}} +%global nmlibdir %{_prefix}/lib/NetworkManager + Name: nvme-cli -Version: 2.6 +Version: 2.16 Release: 1%{?dist} Summary: NVMe management command line interface License: GPL-2.0-only URL: https://github.com/linux-nvme/nvme-cli Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz +Source1: 99-nvme-nbft-connect.sh +Source2: 99-nvme-nbft-no-ignore-carrier.conf -BuildRequires: meson >= 0.50.0 +BuildRequires: meson >= 0.53 BuildRequires: gcc gcc-c++ BuildRequires: systemd-devel BuildRequires: systemd-rpm-macros BuildRequires: zlib-devel BuildRequires: openssl-devel +%if (0%{?rhel} == 0) || (0%{?rhel} > 9) +BuildRequires: kernel-headers +%endif -BuildRequires: libnvme-devel >= 1.6 -BuildRequires: json-c-devel >= 0.13 +BuildRequires: libnvme-devel >= 1.16.1 +BuildRequires: json-c-devel >= 0.14 BuildRequires: asciidoc BuildRequires: xmlto Requires: util-linux + %description nvme-cli provides NVM-Express user space tooling for Linux. @@ -33,13 +41,17 @@ nvme-cli provides NVM-Express user space tooling for Linux. %build -%meson -Dudevrulesdir=%{_udevrulesdir} -Dsystemddir=%{_unitdir} -Dpdc-enabled=true -Ddocs=all -Ddocs-build=true -Dhtmldir=%{_pkgdocdir} +%meson -Dudevrulesdir=%{_udevrulesdir} -Dsystemddir=%{_unitdir} -Dpdc-enabled=false -Ddocs=all -Ddocs-build=true -Dhtmldir=%{_pkgdocdir} %meson_build %install %meson_install %{__install} -pm 644 README.md %{buildroot}%{_pkgdocdir} +mkdir -p $RPM_BUILD_ROOT%{nmlibdir}/dispatcher.d +mkdir -p $RPM_BUILD_ROOT%{nmlibdir}/conf.d +%{__install} -pm 755 %{SOURCE1} $RPM_BUILD_ROOT%{nmlibdir}/dispatcher.d/ +%{__install} -pm 644 %{SOURCE2} $RPM_BUILD_ROOT%{nmlibdir}/conf.d/ # hostid and hostnqn are supposed to be unique per machine. We obviously # can't package them. @@ -56,6 +68,30 @@ mv %{buildroot}%{_pkgdocdir}/nvme %{buildroot}%{_pkgdocdir}/html rm -rf %{buildroot}%{_pkgdocdir}/nvme +%post +# https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_systemd +%systemd_post nvmefc-boot-connections.service +%systemd_post nvmf-autoconnect.service +%systemd_post nvmf-connect@.service +%systemd_post nvmf-connect-nbft.service +if [ -S /run/udev/control ]; then + udevadm control --reload + udevadm trigger +fi + +%preun +%systemd_preun nvmefc-boot-connections.service +%systemd_preun nvmf-autoconnect.service +%systemd_preun nvmf-connect@.service +%systemd_preun nvmf-connect-nbft.service + +%postun +%systemd_postun nvmefc-boot-connections.service +%systemd_postun nvmf-autoconnect.service +%systemd_postun nvmf-connect@.service +%systemd_postun nvmf-connect-nbft.service + + %files %license LICENSE %doc %{_pkgdocdir} @@ -69,13 +105,90 @@ rm -rf %{buildroot}%{_pkgdocdir}/nvme %{_unitdir}/nvmf-autoconnect.service %{_unitdir}/nvmf-connect.target %{_unitdir}/nvmf-connect@.service +%{_unitdir}/nvmf-connect-nbft.service +%{_udevrulesdir}/65-persistent-net-nbft.rules %{_udevrulesdir}/70-nvmf-autoconnect.rules -%{_udevrulesdir}/71-nvmf-iopolicy-netapp.rules +%{_udevrulesdir}/70-nvmf-keys.rules +%{_udevrulesdir}/71-nvmf-netapp.rules +%{_udevrulesdir}/71-nvmf-vastdata.rules +%{_udevrulesdir}/71-nvmf-hpe.rules # Do not install the dracut rule yet. See rhbz 1742764 # /usr/lib/dracut/dracut.conf.d/70-nvmf-autoconnect.conf +%{nmlibdir}/dispatcher.d/99-nvme-nbft-connect.sh +%{nmlibdir}/conf.d/99-nvme-nbft-no-ignore-carrier.conf %changelog +* Thu Dec 04 2025 Tomas Bzatek - 2.16-1 +- Update to 2.16 + +* Fri Aug 15 2025 Tomas Bzatek - 2.15-2 +- Fix nvme-list JSON output compatibility +- Rename 71-nvme-hpe.rules to 71-nvmf-hpe.rules + +* Fri Jul 25 2025 Tomas Bzatek - 2.15-1 +- Update to 2.15 + +* Thu Jul 24 2025 Fedora Release Engineering - 2.14-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Wed Jul 09 2025 Tomas Bzatek - 2.14-1 +- Update to 2.14 +- Disable Persistent Discovery Controllers by default + +* Fri Apr 11 2025 Tomas Bzatek - 2.13-1 +- Update to 2.13 + +* Mon Mar 17 2025 Tomas Bzatek - 2.12-1 +- Update to 2.12 + +* Tue Feb 04 2025 Tomas Bzatek - 2.11-3 +- Add systemd units scriptlets +- Reload udevd after installing udev rules + +* Fri Jan 17 2025 Fedora Release Engineering - 2.11-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Thu Oct 31 2024 Tomas Bzatek - 2.11-1 +- Update to 2.11 + +* Mon Aug 26 2024 Tomas Bzatek - 2.10.2-2 +- Install NetworkManager override for nbft interfaces +- Rename reconnect NetworkManager hook to 99-nvme-nbft-connect.sh + +* Mon Aug 05 2024 Tomas Bzatek - 2.10.2-1 +- Update to 2.10.2 + +* Mon Aug 05 2024 Tomas Bzatek - 2.10-1 +- Update to 2.10 + +* Thu Jul 18 2024 Fedora Release Engineering - 2.9.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Mon Jun 03 2024 Tomas Bzatek - 2.9.1-2 +- Install custom nvmf-connect-nbft.sh NetworkManager hook + +* Fri May 03 2024 Tomas Bzatek - 2.9.1-1 +- Update to 2.9.1 + +* Tue Apr 23 2024 Tomas Bzatek - 2.8-2 +- Harden the systemd units + +* Wed Feb 14 2024 Tomas Bzatek - 2.8-1 +- Update to 2.8 + +* Fri Feb 09 2024 Tomas Bzatek - 2.7.1-4 +- Lower the verbosity of TP4126 hostnqn-hostid consistency checks + +* Thu Jan 25 2024 Fedora Release Engineering - 2.7.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sun Jan 21 2024 Fedora Release Engineering - 2.7.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Thu Dec 28 2023 Tomas Bzatek - 2.7.1-1 +- Update to 2.7.1 + * Fri Sep 29 2023 Tomas Bzatek - 2.6-1 - Update to 2.6 diff --git a/sources b/sources index 844ac50..e58ea56 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nvme-cli-2.6.tar.gz) = da4daef2d7c554455e0c195c03f92188e0e946409a3bd8a5b421d9a106746e82fb1309901d2893639b1a3447bda094c80a9f49f59bf43cf2b00402f82beea3fc +SHA512 (nvme-cli-2.16.tar.gz) = 507018ff41832574bef5b88ea6a17336b9792c54f8e5c619d041bce23124e1d6d5e5e824407f46d4f1b4d6899125885eb14289f3399e61c7e7a59a603f1635e2