SHA256
1
0
forked from pool/tgt

- Update to version v1.0.92 (from 1.0.89):

* fix arm64 compilation
  * do not rely on non-portable __WORDSIZE nor LFS64 interfaces
  * Enabled thin-provision option for discarding ranges from block
    devices, that supporting discard

OBS-URL: https://build.opensuse.org/package/show/Base:System/tgt?expand=0&rev=63
This commit is contained in:
Dirk Mueller 2024-08-31 09:24:29 +00:00 committed by Git OBS Bridge
commit 5971eaaae4
11 changed files with 613 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

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

20
harden_tgtd.service.patch Normal file
View File

@ -0,0 +1,20 @@
Index: tgt-1.0.92/scripts/tgtd.service
===================================================================
--- tgt-1.0.92.orig/scripts/tgtd.service
+++ tgt-1.0.92/scripts/tgtd.service
@@ -9,6 +9,15 @@ After=network.target
ConditionPathExists=/etc/tgt/targets.conf
[Service]
+# added automatically, for details please see
+# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
+ProtectSystem=full
+ProtectHome=true
+ProtectHostname=true
+ProtectKernelTunables=true
+ProtectKernelLogs=true
+RestrictRealtime=true
+# end of automatic additions
Type=forking
Environment=TGTD_CONFIG=/etc/tgt/targets.conf

11
sysconfig.tgt Normal file
View File

@ -0,0 +1,11 @@
## Path: Network/File systems/iSCSI
## Description: tgt iSCSI server options
## Type: string
## Default: ""
## ServiceRestart: tgtd
#
# Options for tgtd
# set listen addr with --iscsi portal=192.0.2.1:3260
#
TGTD_OPTS=""

28
tgt-fix-build Normal file
View File

@ -0,0 +1,28 @@
From bcaad0432c18a9a792fce4b10e5a0e7014461dc5 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Wed, 26 Feb 2014 12:45:56 +0100
Subject: [PATCH 1/2] Allow OPTFLAGS to override default CFLAGS
When building a package the build system might be wanting to
pass in some additional CFLAGS. So allow for the OPTFLAGS setting
to override the default CFLAGS.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
usr/Makefile | 3 +++
1 file changed, 3 insertions(+)
Index: tgt-1.0.92/usr/Makefile
===================================================================
--- tgt-1.0.92.orig/usr/Makefile
+++ tgt-1.0.92/usr/Makefile
@@ -41,6 +41,9 @@ INCLUDES += -I.
CFLAGS += -D_FILE_OFFSET_BITS=64
CFLAGS += -D_GNU_SOURCE
CFLAGS += $(INCLUDES)
+ifneq ($(OPTFAGS),)
+CFLAGS += $(OPTFLAGS)
+endif
ifneq ($(DEBUG),)
CFLAGS += -g -O0 -ggdb -rdynamic
else

View File

@ -0,0 +1,37 @@
From 4711fc19b6b83d572fd6eafd64a834559cae8ce2 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Wed, 26 Feb 2014 12:50:09 +0100
Subject: Install examples in documentation directory
The examples should be installed in the documentation directory,
not the standard configuration directory.
Signed-off-by: Dirk Mueller <dmueller@suse.com>
Acked-by: Hannes Reinecke <hare@suse.de>
---
conf/Makefile | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Index: tgt-1.0.92/conf/Makefile
===================================================================
--- tgt-1.0.92.orig/conf/Makefile
+++ tgt-1.0.92/conf/Makefile
@@ -1,4 +1,5 @@
sysconfdir ?= /etc
+docdatadir ?= /usr/share/doc/packages/
EXAMPLES = targets.conf.example targets.conf.vtl.L700 targets.conf.vtl.MSL2024
@@ -11,9 +12,10 @@ install:
if [ ! -f $(DESTDIR)$(sysconfdir)/tgt/targets.conf ] ; then \
install -m 644 targets.conf $(DESTDIR)$(sysconfdir)/tgt ; \
fi
- install -d -m 755 $(DESTDIR)$(sysconfdir)/tgt/examples
+ install -d -m 755 $(DESTDIR)$(sysconfdir)/tgt/conf.d
+ install -d -m 755 $(DESTDIR)$(docdatadir)/tgt/examples
for f in $(EXAMPLES) ; do \
- install -m 644 examples/$$f $(DESTDIR)$(sysconfdir)/tgt/examples ;\
+ install -m 644 examples/$$f $(DESTDIR)$(docdatadir)/tgt/examples ;\
done
install -d $(DESTDIR)$(sysconfdir)/tgt/conf.d

View File

@ -0,0 +1,22 @@
From: Lee Duncan
Date: Sat 24 Dec 2022 09:15:40 AM PST
Subject: [PATCH] tgt: systemd service update
Update our systemd service file to match what we do at SUSE.
---
Index: tgt-1.0.92/scripts/tgtd.service
===================================================================
--- tgt-1.0.92.orig/scripts/tgtd.service
+++ tgt-1.0.92/scripts/tgtd.service
@@ -20,8 +20,9 @@ RestrictRealtime=true
# end of automatic additions
Type=forking
Environment=TGTD_CONFIG=/etc/tgt/targets.conf
+EnvironmentFile=-/etc/sysconfig/tgt
-ExecStart=/usr/sbin/tgtd
+ExecStart=/usr/sbin/tgtd $TGTD_OPTS
ExecStartPost=/usr/sbin/tgtadm --op update --mode sys --name State -v offline
ExecStartPost=/usr/sbin/tgtadm --op update --mode sys --name State -v ready
ExecStartPost=/usr/sbin/tgt-admin -e -c ${TGTD_CONFIG}

353
tgt.changes Normal file
View File

@ -0,0 +1,353 @@
-------------------------------------------------------------------
Wed Aug 28 14:30:59 UTC 2024 - Andrea Manzini <andrea.manzini@suse.com>
- Update to version v1.0.92 (from 1.0.89):
* fix arm64 compilation
* do not rely on non-portable __WORDSIZE nor LFS64 interfaces
* Enabled thin-provision option for discarding ranges from block
devices, that supporting discard
-------------------------------------------------------------------
Mon Feb 26 14:37:40 UTC 2024 - pgajdos@suse.com
- Use %autosetup macro. Allows to eliminate the usage of deprecated
%patchN
-------------------------------------------------------------------
Wed Nov 15 07:31:31 UTC 2023 - ming li <mli@suse.com>
- Update to version v1.0.89 (from 1.0.85):
* tgt 1.0.89
* tgtd.initd
add missing
* Prevents threads from looping indefinitely
* tgt 1.0.88
* Create tgtd.confd
/etc/conf.d/tgtd config file for openrc init system
* openrc init script
An openrc init script for tgtd.
* tgt 1.0.87
* fix posix_fallocate ret check
"posix_fallocate() returns zero on success, or an error number on failure. Note that errno is not set."
* Add rotation_rate parameter to tgtadm.8.xml
Add `rotation_rate` parameter and description.
* tgt 1.0.86
* fix: unused function errors
* add github actions CI
just build test.
* README: minor update
update URLs.
remove too old kernel version info.
-------------------------------------------------------------------
Mon Jan 2 13:28:45 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 1.0.85:
* remove duplicate includes
* Fix blank documentation line in service file
-------------------------------------------------------------------
Fri Dec 23 20:01:34 UTC 2022 - Lee Duncan <lduncan@suse.com>
- Some cleanup (bsc#1206639):
* removed patch setup-tgt-conf-d.patch, since it's upstream,
and having it caused duplicated include of user config
* renamed setup-tgt-conf-d.patch to
tgt-install-examples-in-documentation-dir.patch, to better
reflect what it does (since it no longer sets up tgt.conf.d)
* removed the sytemd source file we have, since we get
tgtd.service from upstream now (with a patch)
* added patch tgt-systemd-service-update.patch, to ensure
SUSE-specific changes are in the service file
* dropped tgt-include-sys-macros-for-major.patch (obsolete)
-------------------------------------------------------------------
Sat Dec 3 17:25:58 UTC 2022 - Dirk Müller <dmueller@suse.com>
- update to 1.0.84:
* fix bug: target bound initiator-name but client cannot discovery the
target device
* fix use-after-free in iser_conn_free()
-------------------------------------------------------------------
Tue Apr 5 19:01:02 UTC 2022 - Lee Duncan <lduncan@suse.com>
- Update to version v1.0.82 (from 1.0.74):
* tgt 1.0.82
* README: minor improvement
* Fix FMK and other flags. sg return good length and sense len. Not needed, additional condition. LTO streamer not work with check only ILI flag, need check FMK and may be other. Without thois check working fine. Test on LTO1 and LTO5 streamers.
* tgt 1.0.81
* README: use markdown format
* Add LICENSE file
* replace sourceforge with github
* tgt 1.0.80
* scripts/checkpatch.pl: escape literal left braces
* Replace __packed with __attribute__(...)
* Avoid passing NULL pointer to printf
* set INFORMATION field on COMPARE AND WRITE miscompare
* add helper to fill sense INFORMATION field
* Clean up error handling
* target: replace bzero with memset
* CHAP_AUTH_STATE_RESPONSE belongs to auth_state
* After rewind option, la->tail may equal la->head. This causes the old logmsg to be lost
* tgt 1.0.79
* fix coding style in log.h
* tgt 1.0.78
* tgtd: support pid file for tgtd daemon
* iscsi_tcp: add support for listening on random port
* iscsi_tcp: fix compile warning
* iscsi_tcp: Replace deprecated valloc function
* tgt 1.0.77
* spc: implement spc 0xb1 and support rotation rate
* tgt 1.0.76
* fix segmentation fault caused by scsi_sprintf
* tgt 1.0.75
* Fix gcc7 string truncation warnings.
* Update README
This removed the need for the following patch (in the code now):
* tgt-Fix-gcc7-string-truncation-warnings.patch
The SPEC file was also updated to match updated filenames.
-------------------------------------------------------------------
Wed Nov 24 15:09:05 UTC 2021 - Johannes Segitz <jsegitz@suse.com>
- Added hardening to systemd service(s) (bsc#1181400). Added patch(es):
* harden_tgtd.service.patch
Modified:
* tgtd.service
-------------------------------------------------------------------
Fri Jul 26 12:21:06 UTC 2019 - matthias.gerstner@suse.com
- removal of SuSEfirewall2 service, since SuSEfirewall2 has been replaced by
firewalld, see [1].
[1]: https://lists.opensuse.org/opensuse-factory/2019-01/msg00490.html
-------------------------------------------------------------------
Fri Feb 15 23:19:22 UTC 2019 - lduncan@suse.com
- Update to version v1.0.74 from version v1.0.60:
* tgt 1.0.74
* AIO backing store now reports a list of supported opcodes
* tgt 1.0.73
* Update tgt-admin
* fix build w/newer glibc
* Display nop_count and and nop_interval
* Quote $backing_store variable in system(), execute() and
backtick-calls
* Buffer size is stored in struct concat_buf.size field, so
use that instead of BUFSIZE since buffer size can be more
than BUFSIZE. Also, remove BUFSIZE since its not used anymore.
* tgt 1.0.72
* smc: fix snprintf warnings with gcc7
This removed the tarball v1.0.60.tar.gz, and replaced it
with v1.0.74.tar.gz, which can now be gotten using the new
_service file. This also updated the SPEC file with the new
version number and the different patch set. Remaining
patches were renumbered.
This following patches were UPDATED (refreshed):
* tgt-fix-build
* tgt-include-sys-macros-for-major.patch
The following patches were REMOVED (no longer needed):
* tgt-handle-access-of-a-target-that-has-been-removed
* tgt-missing-module-directory-not-an-error
* tgt-compare-pointer-to-null.patch
And the following patch was added (and submitted upstream):
* tgt-Fix-gcc7-string-truncation-warnings.patch
-------------------------------------------------------------------
Sun Aug 12 01:11:13 UTC 2018 - lduncan@suse.com
- Fixing build issue with "major()" and a pointer
comparison warning while I was at it, adding patches (bsc#1181571):
* tgt-include-sys-macros-for-major.patch
* tgt-compare-pointer-to-null.patch
-------------------------------------------------------------------
Thu Nov 23 13:42:22 UTC 2017 - rbrown@suse.com
- Replace references to /var/adm/fillup-templates with new
%_fillupdir macro (boo#1069468)
-------------------------------------------------------------------
Tue Jan 31 01:17:49 UTC 2017 - lduncan@suse.com
- Adding documentation files to SPEC file to
silence rpmlint
-------------------------------------------------------------------
Mon Nov 16 16:43:18 UTC 2015 - lduncan@suse.com
- Adding upstream patch to silence bogus error
message when backing-store directory not present
(bsc#954801), adding patch:
* tgt-missing-module-directory-not-an-error
-------------------------------------------------------------------
Mon Nov 16 00:54:26 UTC 2015 - lduncan@suse.com
- Added upstream patch to handle possible target removal
while accessing it (bsc#922526), adding patch:
* tgt-handle-access-of-a-target-that-has-been-removed
-------------------------------------------------------------------
Fri Sep 18 09:52:28 UTC 2015 - p.drouand@gmail.com
- Update to version 1.0.60
* No changelog available
- Update homepage Url
- Use download Url as source
- Remove tgt-git-update; fixed on upstream
- Remove depreciated AUTHORS section
- Perform a spec-cleaner on spec file
-------------------------------------------------------------------
Sun Sep 13 23:31:32 UTC 2015 - ddiss@suse.com
- Fix rctgtd systemd service symlink; (bnc#945604).
-------------------------------------------------------------------
Thu Sep 10 07:03:47 UTC 2015 - bwiedemann@suse.com
- Allow to add options via sysconfig (bnc#828214)
- Drop invalid ExecStopPre entry
-------------------------------------------------------------------
Fri Jun 26 06:14:44 UTC 2015 - bwiedemann@suse.com
- fix tgtd start by giving tgtd time to open the socket (bnc#934642)
and use bash to run multiple programs in ExecStartPost
-------------------------------------------------------------------
Tue Sep 2 19:34:55 CEST 2014 - mls@suse.de
- support ppc64le
-------------------------------------------------------------------
Wed May 14 14:20:38 UTC 2014 - meissner@suse.com
- add missed %service_add_pre in %pre section
-------------------------------------------------------------------
Wed Feb 26 12:57:52 CET 2014 - hare@suse.de
- Update to latest upstream version 1.0.44 (FATE#316717):
* Add sheepdog support
* Add rbd support
* Update iSER support
* Add support for iSCSI NOP-OUT
* SPC/SBC fixes
* iSCSI fixes
* Fixup persistent group reservations
- Removed tgt-mgmt-fixed-m-system-o-delete-handling.patch:
Merged with upstream
- Removed tgt-1.0.28.tar.bz2
- Added tgt-1.0.44.tar.bz2
-------------------------------------------------------------------
Tue Jan 28 15:51:43 UTC 2014 - werner@suse.de
- Make service link a local one
-------------------------------------------------------------------
Wed Oct 23 16:24:11 UTC 2013 - p.drouand@gmail.com
- Drop sysvinit support
- Add systemd support
-------------------------------------------------------------------
Sat Jul 13 14:25:21 UTC 2013 - dmueller@suse.com
- add setup-tgt-conf-d.patch: Configure a /etc/tgt/conf.d by default
- move examples to docdir
-------------------------------------------------------------------
Thu Apr 11 10:36:23 PDT 2013 - lduncan@suse.com
- Renamed firewall service file from iscsitarget to tgt
to remove conflict with tgt package (bnc#814364)
-------------------------------------------------------------------
Fri Oct 26 01:14:03 UTC 2012 - lduncan@suse.com
- Add tgt-mgmt-fixed-m-system-o-delete-handling.patch: Fixes
shutdown hang (bnc#767438)
- Removed PIDFILE completely from init file, as it is not used
-------------------------------------------------------------------
Tue Jul 10 08:25:16 UTC 2012 - cfarrell@suse.com
- license update: GPL-2.0
Most of the source code files carry a GPL-2.0 notice, not GPL-2.0+
-------------------------------------------------------------------
Thu Jun 14 09:51:09 CEST 2012 - vuntz@opensuse.org
- Remove "# pidfile: /var/run/tgtd.pid" from tgt.init, as it makes
the script hang on systemd-based systems. This is the same bug as
rh#797913, and the fix was used in Fedora. Apparently, there's no
such pid file written by tgtd.
-------------------------------------------------------------------
Mon Jun 4 14:39:47 CEST 2012 - hare@suse.de
- Update to latest upstream release 1.0.23
* Improved SCSI emulation
* Various small fixes
-------------------------------------------------------------------
Mon Sep 21 11:02:59 CEST 2009 - dmueller@suse.de
- require perl-Config-General (bnc#474129)
- add rc-symlink (bnc#474136)
-------------------------------------------------------------------
Thu Oct 9 13:53:39 CEST 2008 - hare@suse.de
- Update to latest upstream release 0.9.0
* tgt-admin fixes
* add null backing store
* Improve iSER scheduling
* Various small fixes
-------------------------------------------------------------------
Mon Sep 15 08:20:24 CEST 2008 - hare@suse.de
- Include fixes from upstream:
* Add support to update targets
* tgtadm fixes
* Add PREVENT ALLOW MEDIA REMOVAL to ssc
* Add MANAGEMENT PROTOCOL IN to ssc
* Update README
- Fix rpmlint errors
-------------------------------------------------------------------
Fri Aug 8 15:01:22 CEST 2008 - hare@suse.de
- Update to latest released version 20080805
* Include FCP backend
* Include FCoE backend
* Bugfixes
-------------------------------------------------------------------
Thu Aug 9 19:12:28 CEST 2007 - olh@suse.de
- remove inclusion of linux/hash.h, include it directly
-------------------------------------------------------------------
Wed Apr 4 11:21:52 CEST 2007 - hare@suse.de
- Added service definition for SUSEFirewall2 (#251679)
-------------------------------------------------------------------
Wed Apr 4 10:26:41 CEST 2007 - hare@suse.de
- Initial version svn r849
- Update to latest git version
- Fixes for build on openSUSE

112
tgt.spec Normal file
View File

@ -0,0 +1,112 @@
#
# spec file for package tgt
#
# 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/
#
#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
%define _fillupdir %{_localstatedir}/adm/fillup-templates
%endif
#Compat macro for make_build macro (needed in SLE12-SP5)
%if ! %{defined make_build}
%define make_build %{__make} %{?_smp_mflags}
%endif
Name: tgt
Version: 1.0.92
Release: 0
Summary: Generic Linux target framework (tgt)
License: GPL-2.0-only
Group: System/Daemons
URL: https://github.com/fujita/tgt
Source: https://github.com/fujita/tgt/archive/refs/tags/v%{version}.tar.gz
Source1: sysconfig.%{name}
Patch1: %{name}-fix-build
Patch2: %{name}-install-examples-in-documentation-dir.patch
Patch3: harden_tgtd.service.patch
Patch4: %{name}-systemd-service-update.patch
BuildRequires: docbook-xsl-stylesheets
BuildRequires: libaio-devel
BuildRequires: libxslt-tools
BuildRequires: libxslt1
BuildRequires: openssl-devel
BuildRequires: perl-Config-General
BuildRequires: systemd-rpm-macros
Requires: perl-Config-General
Requires(pre): %fillup_prereq
Obsoletes: iscsitarget
%{?systemd_requires}
%description
Linux target framework (tgt) aims to simplify various SCSI target
driver (iSCSI, Fibre Channel, SRP, etc) creation and maintenance.
Tgt consists of kernel modules, user-space daemon, and user-space
tools. Some target drivers uses all of them and some use only
user-space daemon and tools (i.e. they completely runs in user space).
%prep
%autosetup -p1
%build
%ifarch ppc ppc64 ppc64le
%define backends ISCSI=1 FCP=1 FCOE=1 IBMVIO=1
%else
%define backends ISCSI=1 FCP=1 FCOE=1
%endif
%make_build OPTFLAGS="%{optflags}" %{backends}
%install
make DESTDIR=%{buildroot} docdir=%{_docdir}/%{name} install
install -vDm644 scripts/tgtd.service %{buildroot}%{_unitdir}/tgtd.service
install -vD %{S:1} %{buildroot}%{_fillupdir}/sysconfig.%{name}
ln -sf service %{buildroot}/%{_sbindir}/rc%{name}d
%pre
%service_add_pre %{name}d.service
%post
%fillup_only
%service_add_post %{name}d.service
%preun
%service_del_preun %{name}d.service
%postun
%service_del_postun %{name}d.service
%files
%license LICENSE
%doc README.md doc/README.iscsi doc/README.iser doc/README.lu_configuration
%doc doc/README.mmc doc/README.passthrough doc/README.sbcjukebox doc/README.ssc
%doc doc/README.rbd doc/README.glfs doc/README.sheepdog doc/README.vtl
%doc doc/tmf.txt
%doc %{_defaultdocdir}/%{name}/examples
%doc %{_defaultdocdir}/%{name}/html
%{_sbindir}/rctgtd
%{_sbindir}/tgt-admin
%{_sbindir}/tgt-setup-lun
%{_sbindir}/tgtadm
%{_sbindir}/tgtd
%{_sbindir}/tgtimg
%dir %{_sysconfdir}/tgt
%dir %{_sysconfdir}/tgt/conf.d
%config %attr(0644,root,root) %{_sysconfdir}/tgt/targets.conf
%{_fillupdir}/sysconfig.tgt
%{_unitdir}/%{name}d.service
%{_mandir}/man5/*
%{_mandir}/man8/*
%changelog

3
v1.0.89.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cd09daffacc00a6641a7b95d31c43441656ce0b01af8d512359bc91bac3c6d99
size 305773

3
v1.0.92.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:06721dcdb88bcc13721bf5de92b57e84a208e04084f8ed937c3ecade6459662f
size 305797