Sync from SUSE:SLFO:Main nvmetcli revision f937aad0b1336e50dfa142de85884e31

This commit is contained in:
Adrian Schröter 2024-05-03 17:11:38 +02:00
commit e0a3fb0fff
8 changed files with 355 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

19
_service Normal file
View File

@ -0,0 +1,19 @@
<services>
<service name="tar_scm" mode="disabled">
<param name="scm">git</param>
<param name="url">git://git.infradead.org/users/hch/nvmetcli.git</param>
<param name="filename">nvmetcli</param>
<param name="version">v0.8</param>
<param name="revision">v0.8</param>
<param name="exclude">.git</param>
<param name="changesgenerate">enable</param>
</service>
<service name="recompress" mode="disabled">
<param name="file">*.tar</param>
<param name="compression">gz</param>
</service>
<service name="set_version" mode="disabled">
<param name="basename">nvmetcli</param>
</service>
</services>

4
_servicedata Normal file
View File

@ -0,0 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">git://git.infradead.org/users/hch/nvmetcli.git</param>
<param name="changesrevision">d323d5a3091af490502c5d025ec7361a3a2cfbd9</param></service></servicedata>

View File

@ -0,0 +1,23 @@
---
nvmet.service | 10 ++++++++++
1 file changed, 10 insertions(+)
--- a/nvmet.service
+++ b/nvmet.service
@@ -5,6 +5,16 @@ After=sys-kernel-config.mount network-on
Wants=network-online.target
[Service]
+# added automatically, for details please see
+# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
+ProtectSystem=full
+ProtectHome=true
+ProtectHostname=true
+ProtectKernelModules=true
+ProtectKernelLogs=true
+ProtectControlGroups=true
+RestrictRealtime=true
+# end of automatic additions
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/nvmetcli restore

View File

@ -0,0 +1,29 @@
From: Lee Duncan <lduncan@suse.com>
Date: Sun Apr 8 13:35:35 PDT 2018
Subject: [PATCH] use python3 instead of python
For ensuring this package uses python3 instead of
"python", it is better to patch the two places
where this is needed, rather than try to get
the SPEC file RPM macros to do the work, without
munging the package name.
---
diff -aurp nvmetcli-v0.6.orig/nvmetcli nvmetcli-v0.6/nvmetcli
--- nvmetcli-v0.6.orig/nvmetcli 2018-01-22 10:45:05.000000000 -0800
+++ nvmetcli-v0.6/nvmetcli 2018-03-30 12:20:36.875255323 -0700
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
'''
Frontend to access to the NVMe target configfs hierarchy
diff -aurp nvmetcli-v0.6.orig/setup.py nvmetcli-v0.6/setup.py
--- nvmetcli-v0.6.orig/setup.py 2018-01-22 10:45:05.000000000 -0800
+++ nvmetcli-v0.6/setup.py 2018-03-30 12:20:30.215047092 -0700
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
'''
This file is part of ConfigShell.
Copyright (c) 2011-2013 by Datera, Inc

BIN
nvmetcli-v0.8.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

163
nvmetcli.changes Normal file
View File

@ -0,0 +1,163 @@
-------------------------------------------------------------------
Mon Dec 11 07:24:26 UTC 2023 - Daniel Wagner <daniel.wagner@suse.com>
- update old changelog entry so it mention that a patch has been removed
-------------------------------------------------------------------
Fri Dec 8 15:17:30 UTC 2023 - Daniel Wagner <daniel.wagner@suse.com>
- add old changelog entry to changelog
-------------------------------------------------------------------
Tue Dec 5 13:45:44 UTC 2023 - Daniel Wagner <daniel.wagner@suse.com>
- fix build on SLE15 code streams
-------------------------------------------------------------------
Fri Nov 17 14:59:42 UTC 2023 - Dominique Leuenberger <dimstar@opensuse.org>
- Do not define pythons: direclt use the python3 - relevant macros.
-------------------------------------------------------------------
Thu Nov 09 08:31:02 UTC 2023 - Daniel Wagner <daniel.wagner@suse.com>
- Update to version v0.8: (jsc#PED-6252 jsc#PED-5728)
* nvmetcli: set up the target only after the network is configured
* nvmetcli: fixup ana groupid setting for namespaces
* nvmetcli: add a tcp example json
* nvmetcli: Correct xrange usage for py3
* nvmetcli: Allow different devices for make test
* nvmetcli: Report save name correctly
* nvme.py: Make modprobe work for kmod lib too
* nvme.py: Sync the containing directory
* nvme.py: Explicit close is redundant
* nvmetcli: Improve IOError handling on restore
* nvmetcli: don't remove ANA Group 1 on clear
* nvmetcli: ANA configuration support (bsc#1130981)
- remove 0001-nvmetcli-don-t-remove-ANA-Group-1-on-clear.patch
- remove nvmetcli-ANA-configuration-support.patch
- use autosetup instead listing all patches individual
- build package according PEP 517, 518. Thus don't call setup.py directly
- use fdupes to reduce package size
-------------------------------------------------------------------
Fri Nov 25 11:39:56 UTC 2022 - Johannes Segitz <jsegitz@suse.com>
- Added hardening to systemd service(s) (bsc#1181400). Added patch(es):
* harden_nvmet.service.patch
-------------------------------------------------------------------
Fri Mar 27 07:48:31 UTC 2020 - hare@suse.de
- Update to version v0.7:
* bump version to v0.7
* nvmetcli: ANA configuration support
* nvmetcli: simplify the enabled logic
* nvmetcli: pep8 fixes
* nvmetcli: support inline_data_size port parameter
* Revert "nvmetcli: expose nvmet port status and state"
* Support python3 dictionary access.
* nvmetcli: expose nvmet port status and state
- Remove patch merged with upstream
* nvmetcli-make-dict-access-python-version-independant.patch
- 'clear' command doesn't handle ANA groups correctly (bsc#1167644)
adding patch
- 0001-nvmetcli-don-t-remove-ANA-Group-1-on-clear.patch
-------------------------------------------------------------------
Fri Mar 29 12:45:17 CET 2019 - hare@suse.de
- Add ANA support (bsc#1130981)
* nvmetcli-ANA-configuration-support.patch
-------------------------------------------------------------------
Mon Apr 16 19:08:25 UTC 2018 - lduncan@suse.com
- Stop using singlespec, since we only need a
python3 version of this package, and we do not
want it named "python3-nvmetcli" (bsc#1082208).
Also, use the "python-six" module to make
dictionary iteration work for Python 2 and 3,
adding patch:
* nvmetcli-make-dict-access-python-version-independant.patch
-------------------------------------------------------------------
Fri Apr 13 17:47:21 UTC 2018 - lduncan@suse.com
- Support python3 by using the python-six module,
and convert dictionary access to use 'six' routines,
so we can work on python 2 or python 3 (bsc#1082208)
-------------------------------------------------------------------
Sun Apr 8 20:36:58 UTC 2018 - lduncan@suse.com
- Convert to Python3-only siglespec (bsc#1082208)
* Update the SPEC file, using singlespec format, but
telling the macros to ignore Python2
* Tell the scripts to use Python3 instead of python,
adding patch:
- nvmetcli-update-python-to-python3.patch
-------------------------------------------------------------------
Tue Jan 23 10:04:23 UTC 2018 - jthumshirn@suse.com
- Update to version v0.6: (FATE#322737)
- 0001-nvmetcli-remove-status-method-for-the-uiportnode.patch
* nvmetcli: remove status method for the UIPortNode
* nvmetcli: expose ls to dump UI configuration
* nvmetcli: decorate namespace, subsystem and port UI
* nvmetcli: port decoration coloring only if its enabled
* bump version to v0.6
-------------------------------------------------------------------
Fri Dec 1 09:34:11 UTC 2017 - jthumshirn@suse.com
- Don't display bogus 'disabled' status for ports (bsc#1070533)
+ 0001-nvmetcli-remove-status-method-for-the-uiportnode.patch
-------------------------------------------------------------------
Fri Aug 11 11:27:37 UTC 2017 - jthumshirn@suse.com
- Update to version v0.5: (FATE#322737)
- 0001-nvmetcli-add-support-for-NS-UUIDs.patch
* nvmetcli: add support for NS UUIDs
* nvmetcli: allow setting of serial number number
* nvmetcli: allow setting of the subsystem version
* add a make clean pass to bump-ver.sh
* bump version to v0.5
-------------------------------------------------------------------
Fri Jun 16 09:55:32 UTC 2017 - jthumshirn@suse.com
- Add possibiliy to configure Namespace UUIDs (bsc#1038235)
+ 0001-nvmetcli-add-support-for-NS-UUIDs.patch
-------------------------------------------------------------------
Tue May 23 12:57:57 UTC 2017 - jthumshirn@suse.com
- Change dependency from python-configshell to python-configshell-fb (bsc#1040212)
-------------------------------------------------------------------
Mon May 08 11:35:37 UTC 2017 - jthumshirn@suse.com
- Update to version v0.4: (bsc#1034105)
* add example configuration files
* update .gitignore for the auto-generated manpage formats
* add a bump-ver.sh script to automate cutting releases
* bump version to v0.3
* nvmetcli: fix Port and Host operations in shell
* nvmetcli: fix Referral operation in shell
* nvmetcli: Install nvmetcli in /usr/sbin with setup.py
* nvmetcli: create json file's dir first if it doesn't exist
* Add fc transport support to nvmetcli
* bump version to v0.4
-------------------------------------------------------------------
Sat Feb 11 21:08:31 UTC 2017 - jengelh@inai.de
- expand nvmet
-------------------------------------------------------------------
Wed Oct 12 08:11:25 UTC 2016 - jthumshirn@suse.com
- Initial import for SUSE (FATE#321732)

91
nvmetcli.spec Normal file
View File

@ -0,0 +1,91 @@
#
# spec file for package nvmetcli
#
# Copyright (c) 2023 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/
#
Name: nvmetcli
Version: 0.8
Release: 1%{?dist}
Summary: Command line interface for the kernel NVMe nvmet
License: Apache-2.0
Group: System/Management
URL: http://git.infradead.org/users/hch/nvmetcli.git
Source: nvmetcli-v%{version}.tar.gz
Patch1: nvmetcli-update-python-to-python3.patch
Patch2: harden_nvmet.service.patch
BuildRequires: %{pythons}
BuildRequires: fdupes
BuildRequires: python3-pip
BuildRequires: python3-rpm-macros
BuildRequires: python3-wheel
Requires: python3-configshell-fb
Requires: python3-kmod
Requires(post): systemd
Requires(postun):systemd
Requires(preun):systemd
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%description
This package contains the command line interface to the NVMe over
Fabrics target in the Linux kernel. It allows configuring the NVMe
target interactively as well as saving / restoring the configuration
to / from a json file.
%prep
%autosetup -p1 -n nvmetcli-v%{version}
%build
%python3_pyproject_wheel
%install
%python3_pyproject_install
mkdir -p %{buildroot}%{_sysconfdir}/nvmet
mkdir -p %{buildroot}%{_prefix}/sbin
%if 0%{?suse_version} <= 1500
install -m 755 nvmetcli %{buildroot}%{_sbindir}/nvmetcli
%else
mv %{buildroot}%{_bindir}/nvmetcli %{buildroot}%{_sbindir}
%endif
mkdir -p %{buildroot}%{_prefix}/usr/sbin
ln -s /usr/sbin/service %{buildroot}/usr/sbin/rcnvmet
mkdir -p %{buildroot}%{_unitdir}
install -m 644 nvmet.service %{buildroot}%{_unitdir}/nvmet.service
%fdupes %{buildroot}/%{python3_sitelib}/nvmet
%post
%service_add_post nvmet.service
%pre
%service_add_pre nvmet.service
%preun
%service_del_preun nvmet.service
%postun
%service_del_postun nvmet.service
%files
%defattr(-,root,root,-)
%{python3_sitelib}
%dir %{_sysconfdir}/nvmet
%{_sbindir}/nvmetcli
/usr/sbin/rcnvmet
%{_unitdir}/nvmet.service
%doc COPYING README
%changelog