Accepting request 1042036 from home:lee_duncan:branches:network

- Moving DB files from /etc/iscsi/* to /var/lib/iscsi/* for
  SLE-15-SP5 and forward, as is done in Tumbleweed.
- Added /etc/iscsi/README.DB-files-moved, and added SPEC file
  changes to support this, including a post-install script to
  move the DB files, only installed if DB files are moved.
- Renamed shared library from libopeniscsiusr0_2_0 to
  libopeniscsiusr0, to correctly match SONAME in library.
- iscsid/iscsiuio: fix OOM adjustment (github issue #377)

OBS-URL: https://build.opensuse.org/request/show/1042036
OBS-URL: https://build.opensuse.org/package/show/network/open-iscsi?expand=0&rev=215
This commit is contained in:
Lee Duncan 2022-12-10 22:59:01 +00:00 committed by Git OBS Bridge
parent 17cd078d51
commit 21b60124c6
4 changed files with 72 additions and 28 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:0ec13f45bbaba494c940f868798cda35e49aa747747c169a7348ac61d472f2b7 oid sha256:abc8c23748927b77116e314c2710bdec8fc4ee33b01a67bf53c71d88de6e19e9
size 509310 size 509776

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:da635f5802cd402af427c6de7d71d8ec0e06edec38ded7190939aafd5e113224 oid sha256:09e54b2f8c96b9c8acf69eebb8ef2fe9b50e013f628fbab001af51d27d6b0a9b
size 1697 size 2890

View File

@ -1,8 +1,19 @@
-------------------------------------------------------------------
Wed Dec 7 18:47:08 UTC 2022 - Lee Duncan <lduncan@suse.com>
- Moving DB files from /etc/iscsi/* to /var/lib/iscsi/* for
SLE-15-SP5 and forward, as is done in Tumbleweed.
- Added /etc/iscsi/README.DB-files-moved, and added SPEC file
changes to support this, including a post-install script to
move the DB files, only installed if DB files are moved.
- Renamed shared library from libopeniscsiusr0_2_0 to
libopeniscsiusr0, to correctly match SONAME in library.
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Nov 16 17:14:36 UTC 2022 - Lee Duncan <lduncan@suse.com> Wed Nov 16 17:14:36 UTC 2022 - Lee Duncan <lduncan@suse.com>
- Updated to latest upstream. Changes: - Updated to latest upstream. Changes:
* scsid/iscsiuio: fix OOM adjustment (github issue #377) * iscsid/iscsiuio: fix OOM adjustment (github issue #377)
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Sep 26 21:15:57 UTC 2022 - Lee Duncan <lduncan@suse.com> Mon Sep 26 21:15:57 UTC 2022 - Lee Duncan <lduncan@suse.com>

View File

@ -16,6 +16,8 @@
# #
%define _home_dir %{_sysconfdir}/iscsi
# Ensure usr-merge does not effect existing SLE. Cannot use _sbindir # Ensure usr-merge does not effect existing SLE. Cannot use _sbindir
# directly since meson macros pass that on, and meson does not like # directly since meson macros pass that on, and meson does not like
# setting it to "/sbin". Also and move DB root to /var/lib/iscsi and # setting it to "/sbin". Also and move DB root to /var/lib/iscsi and
@ -23,18 +25,31 @@
%if ! 0%{?is_opensuse} %if ! 0%{?is_opensuse}
# sle # sle
%define _iscsi_sbindir /sbin %define _iscsi_sbindir /sbin
%define _dbroot %{_sysconfdir}/iscsi %define _lockdir %{_home_dir}
%define _lockdir %{_sysconfdir}/iscsi %if 0%{?suse_version} <= 1540
%define _dbroot %{_home_dir}
%else
%define _dbroot %{_sharedstatedir}/iscsi
%define _dbroot_new 1
%endif
%else %else
# opensuse # opensuse
%define _iscsi_sbindir /usr/sbin %define _iscsi_sbindir /usr/sbin
%define _dbroot %{_sharedstatedir}/iscsi
%define _lockdir %{_rundir}/lock/iscsi %define _lockdir %{_rundir}/lock/iscsi
%define _dbroot %{_sharedstatedir}/iscsi
%define _dbroot_new 1
%endif
%if 0%{?_dbroot_new}
%define _install_dbdir_move_readme_value true
%else
%define _install_dbdir_move_readme_value false
%endif %endif
%define iscsi_minor_release 1 %define iscsi_minor_release 1
%define iscsi_patch_release 8 %define iscsi_patch_release 8
%define iscsi_patch_release_suse %{iscsi_patch_release}-suse %define iscsi_patch_release_suse %{iscsi_patch_release}-suse
%define libname libopeniscsiusr0
%define libversion 0.2.0
Name: open-iscsi Name: open-iscsi
Version: 2.1.8 Version: 2.1.8
Release: 0 Release: 0
@ -60,7 +75,7 @@ BuildRequires: suse-module-tools
BuildRequires: pkgconfig(libsystemd) BuildRequires: pkgconfig(libsystemd)
BuildRequires: pkgconfig(systemd) BuildRequires: pkgconfig(systemd)
Requires(post): coreutils Requires(post): coreutils
Requires: libopeniscsiusr0_2_0 = %{version} Requires: %{libname} = %{libversion}
%{?systemd_requires} %{?systemd_requires}
%description %description
@ -78,14 +93,16 @@ connection-level error processing, Nop-In and Nop-Out handling. It
comes with a daemon process called iscsid, and a management utility, comes with a daemon process called iscsid, and a management utility,
iscsiadm. iscsiadm.
%package -n libopeniscsiusr0_2_0 %package -n %{libname}
Version: 2.%{iscsi_minor_release}.%{iscsi_patch_release} Version: 0.2.0
Release: 0 Release: 0
Summary: The iSCSI User-level Library Summary: The iSCSI User-level Library
Group: System/Libraries Group: System/Libraries
Obsoletes: libopeniscsiusr0_1_0 < %{version} Obsoletes: libopeniscsiusr0_1_0
Obsoletes: libopeniscsiusr0_2_0
Conflicts: libopeniscsiusr0_2_0
%description -n libopeniscsiusr0_2_0 %description -n %{libname}
The iSCSI user-space API from the open-iscsi project. The iSCSI user-space API from the open-iscsi project.
%package -n iscsiuio %package -n iscsiuio
@ -115,8 +132,8 @@ Version: 2.%{iscsi_minor_release}.%{iscsi_patch_release}
Release: 0 Release: 0
Summary: The iSCSI User-level Library Development Library and Include files Summary: The iSCSI User-level Library Development Library and Include files
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
Requires: %{libname} = %{libversion}
Requires: %{name} = %{version} Requires: %{name} = %{version}
Requires: libopeniscsiusr0_2_0 = %{version}
Conflicts: libopeniscsiusr0_1_0 Conflicts: libopeniscsiusr0_1_0
%description devel %description devel
@ -133,6 +150,7 @@ the libopeniscsiusr library.
%meson --libdir=%{_libdir} \ %meson --libdir=%{_libdir} \
-Dc_flags="%{optflags} -fno-strict-aliasing -fno-common -DOFFLOAD_BOOT_SUPPORTED" \ -Dc_flags="%{optflags} -fno-strict-aliasing -fno-common -DOFFLOAD_BOOT_SUPPORTED" \
-Discsi_sbindir=%{_iscsi_sbindir} -Ddbroot=%{_dbroot} -Drulesdir=%{_udevrulesdir} -Dlockdir=%{_lockdir} \ -Discsi_sbindir=%{_iscsi_sbindir} -Ddbroot=%{_dbroot} -Drulesdir=%{_udevrulesdir} -Dlockdir=%{_lockdir} \
-Dinstall_dbdir_move_readme=%{_install_dbdir_move_readme_value} \
--strip --strip
%meson_build %meson_build
@ -149,7 +167,7 @@ ln -s %{_iscsi_sbindir}/service %{buildroot}%{_iscsi_sbindir}/rciscsiuio
ln -s %{_iscsi_sbindir}/service %{buildroot}%{_iscsi_sbindir}/rciscsi-init ln -s %{_iscsi_sbindir}/service %{buildroot}%{_iscsi_sbindir}/rciscsi-init
(cd %{buildroot}/etc; ln -sf iscsi/iscsid.conf iscsid.conf) (cd %{buildroot}/etc; ln -sf iscsi/iscsid.conf iscsid.conf)
# create an empty initiatorname file, as a package place holder # create an empty initiatorname file, as a package place holder
echo > %{buildroot}%{_sysconfdir}/iscsi/initiatorname.iscsi echo > %{buildroot}%{_home_dir}/initiatorname.iscsi
# rename iscsiuio logrotate file to proper name # rename iscsiuio logrotate file to proper name
%if 0%{?suse_version} > 1500 %if 0%{?suse_version} > 1500
mkdir -p %{buildroot}%{_distconfdir}/logrotate.d mkdir -p %{buildroot}%{_distconfdir}/logrotate.d
@ -159,28 +177,40 @@ mv %{buildroot}%{_sysconfdir}/logrotate.d/iscsiuiolog %{buildroot}%{_sysconfdir}
%endif %endif
%fdupes %{buildroot}/%{_prefix} %fdupes %{buildroot}/%{_prefix}
%pre
%service_add_pre iscsi.service iscsid.service iscsid.socket iscsi-init.service
%post %post
%{?regenerate_initrd_post} %{?regenerate_initrd_post}
if [ ! -f %{_sysconfdir}/iscsi/initiatorname.iscsi ] ; then if [ ! -f %{_home_dir}/initiatorname.iscsi ] ; then
%{_iscsi_sbindir}/iscsi-gen-initiatorname %{_iscsi_sbindir}/iscsi-gen-initiatorname
fi fi
%if 0%{?_dbroot_new}
# move DB files if and only if not present in new location
for d in ifaces send_targets fw nodes static isns slp; do
if [ -d %{_home_dir}/$d ]; then
if [ -d %{_dbroot}/$d ]; then
echo "Warning: cannot copy DB directory %{_home_dir}/$d to %{_dbroot}/$d: already present" 1>&2
else
cp -a %{_home_dir}/$d %{_dbroot}
fi
fi
done
%endif
%service_add_post iscsi.service iscsid.service iscsid.socket iscsi-init.service %service_add_post iscsi.service iscsid.service iscsid.socket iscsi-init.service
%posttrans %posttrans
%{?regenerate_initrd_posttrans} %{?regenerate_initrd_posttrans}
%preun
%service_del_preun iscsi.service iscsid.service iscsid.socket iscsi-init.service
%postun %postun
%service_del_postun_without_restart iscsi.service %service_del_postun_without_restart iscsi.service
%service_del_postun iscsi.service iscsid.service iscsid.socket iscsi-init.service %service_del_postun iscsi.service iscsid.service iscsid.socket iscsi-init.service
%pre %post -n %{libname} -p %{run_ldconfig}
%service_add_pre iscsi.service iscsid.service iscsid.socket iscsi-init.service %postun -n %{libname} -p %{run_ldconfig}
%preun
%service_del_preun iscsi.service iscsid.service iscsid.socket iscsi-init.service
%post -n libopeniscsiusr0_2_0 -p %{run_ldconfig}
%postun -n libopeniscsiusr0_2_0 -p %{run_ldconfig}
%post -n iscsiuio %post -n iscsiuio
%service_add_post iscsiuio.service iscsiuio.socket %service_add_post iscsiuio.service iscsiuio.socket
@ -195,10 +225,13 @@ fi
%service_del_preun iscsiuio.service iscsiuio.socket %service_del_preun iscsiuio.service iscsiuio.socket
%files %files
%dir %{_sysconfdir}/iscsi %dir %{_home_dir}
%{_sysconfdir}/iscsid.conf %{_sysconfdir}/iscsid.conf
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/iscsi/iscsid.conf %attr(0600,root,root) %config(noreplace) %{_home_dir}/iscsid.conf
%ghost %{_sysconfdir}/iscsi/initiatorname.iscsi %ghost %{_home_dir}/initiatorname.iscsi
%if 0%{?_dbroot_new}
%config %{_home_dir}/README.DB-files-moved
%endif
%dir %{_dbroot} %dir %{_dbroot}
%dir %{_dbroot}/ifaces %dir %{_dbroot}/ifaces
%{_dbroot}/ifaces/iface.example %{_dbroot}/ifaces/iface.example
@ -229,7 +262,7 @@ fi
%{_mandir}/man8/iscsi-gen-initiatorname.8%{ext_man} %{_mandir}/man8/iscsi-gen-initiatorname.8%{ext_man}
%{_udevrulesdir}/50-iscsi-firmware-login.rules %{_udevrulesdir}/50-iscsi-firmware-login.rules
%files -n libopeniscsiusr0_2_0 %files -n %{libname}
%{_libdir}/libopeniscsiusr.so.* %{_libdir}/libopeniscsiusr.so.*
%files -n iscsiuio %files -n iscsiuio