Debian

Available patches from Ubuntu

To see Ubuntu differences wrt. to Debian, write down a grep-dctrl query identifying the packages you're interested in:
grep-dctrl -n -sPackage Sources.Debian
(e.g. -FPackage linux-ntfs or linux-ntfs)

Modified packages are listed below:

Debian ( Changelog | PTS | Bugs ) Ubuntu ( Changelog | txt | LP | Bugs ) | Diff from Ubuntu

Source: multipath-tools

multipath-tools (0.8.4-4ubuntu2) groovy; urgency=medium * Add README.alua to docs section -- Rafael David Tinoco <rafaeldtinoco@ubuntu.com> Fri, 11 Sep 2020 17:39:12 +0000 multipath-tools (0.8.4-4ubuntu1) groovy; urgency=low * Merge from Debian unstable. Remaining changes: - multipath initramfs fixes for booting from multipathed devices: - d/initramfs/hooks: also copy wwids file on the installed system to ensure all paths come up on boot. (LP 1479929) - d/initramfs/hooks: install multipathd and required directories. - d/initramfs/hooks: copy multipath udev rules to initramfs - d/initramfs/hooks: do not copy kpartx rules to initramfs - d/initramfs/local-bottom: remember to stop multipathd. - d/initramfs/local-premount: wait for udev to settle before the call to resolve_device() in local_mount_root(), so the by-uuid/ symlinks have a chance to be updated by the multipath udev rules (LP 1503286). - d/initramfs/local-premount: Run multipath with -B so not to assign names nor change /etc/multipath/bindings during initramfs (LP 1561103) - d/rules: install d/initramfs/local-bottom - d/rules: install d/initramfs/local-premount - d/control: multipath-udeb: add sg3-udeb Depends - patches to multipath source: - d/p/kpartx_more_loopback_fixes.patch: fix loopback mounted files some more: since we stat() the loopback device node, we can't rely on S_ISREG() tests to handle this case, and should look at the device itself instead. (LP 1543430) - d/p/enable-find-multipaths.patch: re-enable find_multipaths by default -- see the removed 'add_find-multipaths.patch' (LP 1463046) - Split kpartx initramfs bits into kpartx-boot for dmraid (LP 941874) - d/initramfs/kpartx.hook - d/kpartx-boot.postinst - d/kpartx-boot.postrm - d/control: Add kpartx-boot package for dmraid - d/rules: Install kpartx initramfs hook - d/kpartx.install: install all arch /lib* kpartx udev rules - debian/multipath-tools.dm-mpath-lvm.udev: Adjust initramfs integration for new udev rules - Remove d/initramfs/local-top (redundant with other initramfs scripts): - init-top: take over loading modules (dm-multipath and SCSI device handlers); move the missing dm-emc there (now scsi-dh-emc; see BTS 567014). - d/rules: do not install local-top anymore. - remove d/initramfs/local-top - d/control: Enable udebs on riscv64 to fix FTBFS. - d/control, d/rules: i386 related fixes - Stop producing udebs on i386 where we no longer have d-i or a kernel. - Fix debian/rules to not explode when building without udebs on i386. - Don't build the multipath-tools binary package on i386; we only want kpartx. - Disable -fexceptions on multipath-udeb (LP 1489379): the flag causes libchecktur.so to link with libgcc_s.so.1 (even with -static-libgcc), which is not available in the installer environment. - d/p/disable-fexceptions-udeb.patch: conditionally disable -fexceptions with CFLAGS_DISABLE_FEXCEPTIONS. - d/rules: set CFLAGS_DISABLE_FEXCEPTIONS to build multipath-udeb. - d/p/kpartx-print-loop-deleted-to-stdout-not-stderr.patch: Print loop deleted message to stdout again, not stderr; to fix autopkgtest - d/multipath.conf: Install friendly names multipath.conf by default, instead of generating it in every installer. - d/rules: Move udev rules to priority 95, because rules that load modules should be >90. - d/p/no-start-in-containers.patch: Do not attempt to start multipath-tools in containers, should switch for on-demand udev/socket based activation in the future. (LP 1823093) - d/p/kpartx-Improve-finding-loopback-device-by-file.patch: Improve finding loopback devices (LP 1747044) - debian/initramfs/hooks: Add dm-queue-length: users may want to change from the default selector and should be able to do so. (LP 1673350) - debian/initramfs/local-bottom: wait for the multipathd unix socket to close, so to avoid multipathd.socket unit failure. (LP 1682178) - debian/tests/tgtbasedmpaths: - Add sleep to allow for device creation - Use stable wwn-* names in autopkgtest that work with or without friendly names, as scsi-${DM_NAME} is not a stable symlink name. * Dropped changes, superseeded by systemd switch to service script: - d/multipath-tools.preinst: modprobe dm-multipath; This will make sure that multipathd will be able to start. -- Gianfranco Costamagna <locutusofborg@debian.org> Mon, 31 Aug 2020 00:12:32 +0200

Modifications :
  1. Download patch debian/multipath-tools.docs

    --- 0.8.4-4/debian/multipath-tools.docs 2020-08-30 01:14:10.000000000 +0000 +++ 0.8.4-4ubuntu2/debian/multipath-tools.docs 2020-09-11 17:39:06.000000000 +0000 @@ -1 +1,2 @@ README +README.alua
  2. Download patch debian/initramfs/local-top

    --- 0.8.4-4/debian/initramfs/local-top 2020-08-30 01:14:10.000000000 +0000 +++ 0.8.4-4ubuntu2/debian/initramfs/local-top 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ -#!/bin/sh -# -# multipath discovery - -PREREQ="udev iscsi" - -prereqs() { echo "$PREREQ"; } - -case $1 in -prereqs) - prereqs - exit 0 - ;; -esac - -. /scripts/functions - -verbose() -{ - case "$quiet" in y*|Y*|1|t*|T*) - return 1;; - *) - return 0;; - esac -} - -maybe_break pre-multipath -VERBOSITY=0 -MP_MODULES="scsi_dh_alua scsi_dh_emc scsi_dh_rdac dm-multipath" - -if [ ! -e /sbin/multipath ]; then - exit 0 -fi - -verbose && log_begin_msg "Loading multipath modules" -for module in ${MP_MODULES}; do - if modprobe "$module"; then - verbose && log_success_msg "loaded module ${module}." - else - log_failure_msg "failed to load module ${module}." - fi -done -verbose && log_end_msg - -verbose && log_begin_msg "Discovering multipaths" -/sbin/multipath -v $VERBOSITY -verbose && log_end_msg - -if [ -x /sbin/kpartx -a -x /sbin/dmsetup ]; then - /sbin/dmsetup ls --target multipath --exec "/sbin/kpartx -a -p -part" >/dev/null -fi - -if [ -x /bin/udevadm ]; then - /bin/udevadm settle --timeout=10 -fi - -maybe_break post-multipath - -exit 0 -
  3. Download patch debian/initramfs/local-bottom

    --- 0.8.4-4/debian/initramfs/local-bottom 1970-01-01 00:00:00.000000000 +0000 +++ 0.8.4-4ubuntu2/debian/initramfs/local-bottom 2020-07-30 14:45:10.000000000 +0000 @@ -0,0 +1,62 @@ +#!/bin/sh +# +# multipathd shutdown + +PREREQ="" + +prereqs() { echo "$PREREQ"; } + +case $1 in +prereqs) + prereqs + exit 0 + ;; +esac + +. /scripts/functions + +verbose() +{ + case "$quiet" in y*|Y*|1|t*|T*) + return 1;; + *) + return 0;; + esac +} + +maybe_break pre-multipath + +if [ ! -e /sbin/multipathd ]; then + exit 0 +fi + +# Stop multipathd +verbose && log_begin_msg "Stopping multipathd" + +pid_pidof="$(pidof multipathd)" +pid_file="$(cat /run/multipathd.pid)" + +if [ "${pid_pidof}" = "${pid_file}" ]; then + kill ${pid_pidof} + verbose && log_end_msg +else + verbose && log_failure_msg "inconsistent PIDs (pidof: '${pid_pidof}', multipathd.pid: '${pid_file}')" +fi + +# Wait for multipathd unix socket to close. +# It might take a while for multipathd to handle the signal, +# which might leave the unix socket open until the upcoming +# systemd multipath.socket unit starts. Then it fails with +# (Result: resources) like this (logs in journalctl): +# "Failed to listen on sockets: Address already in use" +seconds=10 +while [ $seconds -gt 0 ]; do + grep -q '@/org/kernel/linux/storage/multipathd' /proc/net/unix || break + seconds=$((seconds - 1)) + sleep 1 +done + +maybe_break post-multipath + +exit 0 +
  4. Download patch debian/kpartx-boot.postrm

    --- 0.8.4-4/debian/kpartx-boot.postrm 1970-01-01 00:00:00.000000000 +0000 +++ 0.8.4-4ubuntu2/debian/kpartx-boot.postrm 2020-07-30 14:45:10.000000000 +0000 @@ -0,0 +1,45 @@ +#!/bin/sh +# postrm script for kpartx-boot +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <postrm> `remove' +# * <postrm> `purge' +# * <old-postrm> `upgrade' <new-version> +# * <new-postrm> `failed-upgrade' <old-version> +# * <new-postrm> `abort-install' +# * <new-postrm> `abort-install' <old-version> +# * <new-postrm> `abort-upgrade' <old-version> +# * <disappearer's-postrm> `disappear' <overwriter> +# <overwriter-version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove) + if [ -x /usr/sbin/update-initramfs -a -e /etc/initramfs-tools/initramfs.conf ]; then + update-initramfs -u + fi + ;; + + purge|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + +
  5. Download patch debian/multipath-tools.dm-mpath-lvm.udev

    --- 0.8.4-4/debian/multipath-tools.dm-mpath-lvm.udev 1970-01-01 00:00:00.000000000 +0000 +++ 0.8.4-4ubuntu2/debian/multipath-tools.dm-mpath-lvm.udev 2020-07-30 14:45:10.000000000 +0000 @@ -0,0 +1,26 @@ +# An individual device may be part of a multipath device. +# In such case, remove its partition device nodes so for +# LVM to scan/lock/use only the multipath device. +# - Check it on 'add' uevent. +# - Check it on 'change' uevent (it may change). + +SUBSYSTEM!="block", \ + GOTO="end_mpath" + +ACTION=="remove", \ + GOTO="end_mpath" + +ENV{DEVTYPE}=="partition", \ + IMPORT{parent}="DM_MULTIPATH_DEVICE_PATH", \ + GOTO="end_mpath" + +PROGRAM=="/sbin/multipath -u $devnode", \ + ENV{DM_MULTIPATH_DEVICE_PATH}="1", \ + ENV{ID_FS_TYPE}="mpath_member", \ + RUN+="/usr/bin/partx -d --nr 1-1024 $devnode", \ + GOTO="end_mpath" + +# Not part of a multipath device. +ENV{DM_MULTIPATH_DEVICE_PATH}="" + +LABEL="end_mpath"
  6. Download patch debian/rules

    --- 0.8.4-4/debian/rules 2020-08-30 01:14:10.000000000 +0000 +++ 0.8.4-4ubuntu2/debian/rules 2020-08-31 01:13:01.000000000 +0000 @@ -2,6 +2,13 @@ INITRAMFS=$(CURDIR)/debian/multipath-tools-boot/usr/share/initramfs-tools/ +ifeq ($(shell dpkg-architecture -qDEB_HOST_ARCH),i386) + ADD_UDEB = --no-add-udeb + skip_packages = -Nmultipath-tools +else + ADD_UDEB = --add-udeb=multipath-udeb +endif + # For Hardening export DEB_BUILD_MAINT_OPTIONS = hardening=+all DPKG_EXPORT_BUILDFLAGS = 1 @@ -37,7 +44,7 @@ build-stamp: clean-tree build-multipath-udeb-stamp: dh_testdir - DEB_CFLAGS_MAINT_APPEND="-static-libgcc" dh_auto_build --parallel -- $(OPTFLAGS) LIB=/lib USE_SYSTEMD=0 + DEB_CFLAGS_MAINT_APPEND="-static-libgcc" CFLAGS_DISABLE_FEXCEPTIONS=1 dh_auto_build --parallel -- $(OPTFLAGS) LIB=/lib USE_SYSTEMD=0 # store files for install target mkdir -p $(CURDIR)/debian/tmp-multipath-udeb/sbin @@ -65,8 +72,11 @@ install-indep: # initramfs stuff: install -D -m 755 debian/initramfs/hooks $(INITRAMFS)/hooks/multipath - install -D -m 755 debian/initramfs/local-top \ - $(INITRAMFS)/scripts/local-top/multipath + install -D -m 755 debian/initramfs/kpartx.hook $(CURDIR)/debian/kpartx-boot/usr/share/initramfs-tools/hooks/kpartx + install -D -m 755 debian/initramfs/local-premount \ + $(INITRAMFS)/scripts/local-premount/multipath + install -D -m 755 debian/initramfs/local-bottom \ + $(INITRAMFS)/scripts/local-bottom/multipath install -D -m 755 debian/initramfs/init-top \ $(INITRAMFS)/scripts/init-top/multipath @@ -88,6 +98,8 @@ install: install-indep mkdir -p $(CURDIR)/debian/tmp/sbin $(MAKE) -j1 install DESTDIR=$(CURDIR)/debian/tmp LIB=/lib SYSTEMDPATH=/lib USE_SYSTEMD=1 install -m 755 debian/dmsetup_env $(CURDIR)/debian/tmp/lib/udev/ + mkdir -p $(CURDIR)/debian/tmp/etc + cp debian/multipath.conf $(CURDIR)/debian/tmp/etc dh_install -X.rules --fail-missing -Nmultipath-udeb --sourcedir=$(CURDIR)/debian/tmp dh_install -Xkpartx_id -X.rules -X.service -X.socket --fail-missing -pmultipath-udeb --sourcedir=$(CURDIR)/debian/tmp-multipath-udeb @@ -119,7 +131,7 @@ binary-arch: build install dh_lintian -a dh_systemd_enable -pmultipath-tools multipathd.service dh_installinit -pmultipath-tools - dh_installudev -pkpartx + dh_installudev -pkpartx --priority=95 dh_installudev -pkpartx --name=dm-parts --priority=56 dh_installudev -pkpartx --name=del-part-nodes --priority=68 dh_installudev -pmultipath-tools --name=multipath @@ -128,16 +140,16 @@ binary-arch: build install lib/systemd/system/multipath-tools.service dh_systemd_start -pmultipath-tools multipathd.service dh_installman -a - dh_makeshlibs -a --add-udeb=multipath-udeb + dh_makeshlibs -a $(ADD_UDEB) dh_link -a dh_strip -a dh_compress -a dh_fixperms -a dh_installdeb -a dh_shlibdeps -a - dh_gencontrol -a + dh_gencontrol -a $(skip_packages) dh_md5sums -a - dh_builddeb -a + dh_builddeb -a $(skip_packages) binary: binary-indep binary-arch .PHONY: binary binary-arch binary-indep unpack configure build clean
  7. Download patch debian/multipath-tools.install

    --- 0.8.4-4/debian/multipath-tools.install 2020-08-30 01:14:10.000000000 +0000 +++ 0.8.4-4ubuntu2/debian/multipath-tools.install 2020-07-30 14:45:10.000000000 +0000 @@ -14,3 +14,4 @@ /usr/include/libdmmp/libdmmp.h /lib/systemd/system/multipathd.service /lib/systemd/system/multipathd.socket +/etc/multipath.conf
  8. Download patch debian/control

    --- 0.8.4-4/debian/control 2020-08-30 01:14:10.000000000 +0000 +++ 0.8.4-4ubuntu2/debian/control 2020-08-31 01:13:01.000000000 +0000 @@ -1,7 +1,8 @@ Source: multipath-tools Section: admin Priority: optional -Maintainer: Debian DM Multipath Team <team+linux-blocks@tracker.debian.org> +Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> +XSBC-Original-Maintainer: Debian DM Multipath Team <team+linux-blocks@tracker.debian.org> Uploaders: Guido Günther <agx@sigxcpu.org>, Ritesh Raj Sarraf <rrs@debian.org>, Chris Hofstaedtler <zeha@debian.org> Build-Depends: debhelper-compat (= 9), po-debconf, libdevmapper-dev, libreadline-dev, libaio-dev, libudev-dev, libsystemd-dev, systemd, liburcu-dev, pkg-config, libjson-c-dev Vcs-Git: https://salsa.debian.org/linux-blocks-team/multipath-tools.git @@ -27,10 +28,18 @@ Description: create device mappings for Kpartx can be used to set up device mappings for the partitions of any partitioned block device. It is part of the Linux multipath-tools. +Package: kpartx-boot +Architecture: all +Depends: ${misc:Depends}, initramfs-tools, + kpartx (>= ${source:Version}), kpartx (<< ${source:Version}.1~) +Description: Provides kpartx during boot + This package makes kpartx available during boot to activate partitions + Package: multipath-tools-boot Architecture: all Depends: ${misc:Depends}, initramfs-tools | linux-initramfs-tool, lsb-base, - multipath-tools (>= ${source:Version}), multipath-tools (<< ${source:Version}.1~) + multipath-tools (>= ${source:Version}), multipath-tools (<< ${source:Version}.1~), + kpartx-boot (= ${binary:Version}) Description: Support booting from multipath devices This package contains the necessary support for booting from a multipath device: @@ -43,8 +52,8 @@ Description: Support booting from multip Package: multipath-udeb Package-Type: udeb -Architecture: linux-any -Depends: ${shlibs:Depends}, ${misc:Depends}, multipath-modules, kpartx-udeb +Architecture: amd64 arm64 armhf ppc64el riscv64 s390x +Depends: ${shlibs:Depends}, ${misc:Depends}, multipath-modules, kpartx-udeb, sg3-udeb Section: debian-installer Description: maintain multipath block device access - udeb package This is a udeb, or a microdeb, for the debian-installer. @@ -54,7 +63,7 @@ Description: maintain multipath block de Package: kpartx-udeb Package-Type: udeb -Architecture: linux-any +Architecture: amd64 arm64 armhf ppc64el riscv64 s390x Depends: ${shlibs:Depends}, ${misc:Depends} Section: debian-installer Description: create device mappings for partitions - udeb package
  9. Download patch debian/tests/tgtbasedmpaths

    --- 0.8.4-4/debian/tests/tgtbasedmpaths 2020-08-30 01:14:10.000000000 +0000 +++ 0.8.4-4ubuntu2/debian/tests/tgtbasedmpaths 2020-07-30 14:45:10.000000000 +0000 @@ -15,8 +15,8 @@ localhost="127.0.0.1" portal="${localhost}:3260" maxpaths=4 backfn="backingfile" -expectwwid="360000000000000000e00000000010001" -testdisk="/dev/disk/by-id/scsi-${expectwwid}" +expectwwid="60000000000000000e00000000010001" +testdisk="/dev/disk/by-id/wwn-0x${expectwwid}" bglog="$AUTOPKGTEST_ARTIFACTS/test-background.log" fioprep="$AUTOPKGTEST_ARTIFACTS/path-change-prep.fio" fiovrfy="$AUTOPKGTEST_ARTIFACTS/path-change-check.fio" @@ -48,6 +48,7 @@ do done udevadm settle +sleep 5 # sleep a bit to allow device to be created.... # status summary echo "Status after initial setup"
  10. Download patch debian/patches/kpartx-Improve-finding-loopback-device-by-file.patch

    --- 0.8.4-4/debian/patches/kpartx-Improve-finding-loopback-device-by-file.patch 1970-01-01 00:00:00.000000000 +0000 +++ 0.8.4-4ubuntu2/debian/patches/kpartx-Improve-finding-loopback-device-by-file.patch 2020-08-31 01:13:01.000000000 +0000 @@ -0,0 +1,70 @@ +From f2bd34f273a02c0ed12e996ebe57211576e40fa6 Mon Sep 17 00:00:00 2001 +From: Julian Andres Klode <julian.klode@canonical.com> +Date: Mon, 5 Feb 2018 09:44:36 +0100 +Subject: [PATCH] kpartx: Improve finding loopback device by file + +Commit 9bdfa3eb8e24b668e6c2bb882cddb0ccfe23ed5b changed kpartx +to lookup files by absolute path, using realpath(). This introduced +a regression when part of the filename where symbolic links. While +the kernel stores the absolute path to the backing file, it does not +resolve symbolic links, and hence kpartx would fail to find the loopback +device because it resolves symbolic links when deleting. + +This introduces two workarounds in find_loop_by_file() + +(1) We match against the specified file name as is as well +(2) We canonicalize the loopinfo.lo_name and match the canonicalized filename + against that. + +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/multipath-tools/+bug/1747044 +Signed-off-by: Julian Andres Klode <julian.klode@canonical.com> +Forwarded: https://www.redhat.com/archives/dm-devel/2018-February/msg00019.html +--- + kpartx/kpartx.c | 8 +------- + kpartx/lopart.c | 12 +++++++++++- + 2 files changed, 12 insertions(+), 8 deletions(-) + +--- a/kpartx/kpartx.c ++++ b/kpartx/kpartx.c +@@ -333,10 +333,10 @@ main(int argc, char **argv){ + char rpath[PATH_MAX]; + if (realpath(device, rpath) == NULL) { + fprintf(stderr, "Error: %s: %s\n", device, +- strerror(errno)); ++ strerror(errno)); + exit (1); + } +- loopdev = find_loop_by_file(rpath); ++ loopdev = find_loop_by_file(device); + + if (!loopdev && what == DELETE) + exit (0); +--- a/kpartx/lopart.c ++++ b/kpartx/lopart.c +@@ -69,6 +69,14 @@ char *find_loop_by_file(const char *file + struct loop_info loopinfo; + const char VIRT_BLOCK[] = "/sys/devices/virtual/block"; + char path[PATH_MAX]; ++ char rfilename[PATH_MAX]; ++ char rloopfilename[PATH_MAX]; ++ if (realpath(filename, rfilename) == NULL) { ++ fprintf(stderr, "Error: %s: %s\n", filename, ++ strerror(errno)); ++ exit (1); ++ } ++ + char bf_path[PATH_MAX]; + char backing_file[PATH_MAX]; + +@@ -120,7 +128,10 @@ char *find_loop_by_file(const char *file + + close (fd); + +- if (0 == strcmp(filename, loopinfo.lo_name)) { ++ if (0 == strcmp(filename, loopinfo.lo_name) || ++ 0 == strcmp(rfilename, loopinfo.lo_name) || ++ (realpath(loopinfo.lo_name, rloopfilename) && ++ 0 == strcmp(rfilename, rloopfilename))) { + found = realpath(path, NULL); + break; + }
  11. Download patch debian/patches/disable-fexceptions-udeb.patch

    --- 0.8.4-4/debian/patches/disable-fexceptions-udeb.patch 1970-01-01 00:00:00.000000000 +0000 +++ 0.8.4-4ubuntu2/debian/patches/disable-fexceptions-udeb.patch 2020-08-31 01:13:01.000000000 +0000 @@ -0,0 +1,17 @@ +From: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com> +Subject: Make the use of -fexceptions conditional. +Last-Update: 2019-04-29 + +--- a/Makefile.inc ++++ b/Makefile.inc +@@ -110,6 +110,10 @@ SHARED_FLAGS = -shared + LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS) + BIN_LDFLAGS = -pie + ++ifdef CFLAGS_DISABLE_FEXCEPTIONS ++ CFLAGS := $(filter-out -fexceptions,$(CFLAGS)) ++endif ++ + # Check whether a function with name $1 has been declared in header file $2. + check_func = $(shell \ + if grep -Eq "^[^[:blank:]]+[[:blank:]]+$1[[:blank:]]*(.*)*" "$2"; then \
  12. Download patch debian/multipath-udeb.install

    --- 0.8.4-4/debian/multipath-udeb.install 2020-08-30 01:14:10.000000000 +0000 +++ 0.8.4-4ubuntu2/debian/multipath-udeb.install 2020-07-30 14:45:10.000000000 +0000 @@ -2,3 +2,4 @@ /lib/multipath/ /lib/libmultipath.so.* /lib/libmpathcmd.so* +/etc/multipath.conf \ No newline at end of file
  13. Download patch debian/kpartx-boot.postinst

    --- 0.8.4-4/debian/kpartx-boot.postinst 1970-01-01 00:00:00.000000000 +0000 +++ 0.8.4-4ubuntu2/debian/kpartx-boot.postinst 2020-07-30 14:45:10.000000000 +0000 @@ -0,0 +1,34 @@ +#!/bin/sh +# postinst script for kpartx-boot +# +# see: dh_installdeb(1) + +set -e + +# Source debconf library. +. /usr/share/debconf/confmodule + +case "$1" in + configure) + if [ -x /usr/sbin/update-initramfs -a -e /etc/initramfs-tools/initramfs.conf ]; then + update-initramfs -u + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + +
  14. Download patch debian/patches/kpartx-print-loop-deleted-to-stdout-not-stderr.patch

    --- 0.8.4-4/debian/patches/kpartx-print-loop-deleted-to-stdout-not-stderr.patch 1970-01-01 00:00:00.000000000 +0000 +++ 0.8.4-4ubuntu2/debian/patches/kpartx-print-loop-deleted-to-stdout-not-stderr.patch 2020-08-31 01:13:01.000000000 +0000 @@ -0,0 +1,33 @@ +From dc2cd8f1c7d910d98e2046fd096a5eb67a8e9b9a Mon Sep 17 00:00:00 2001 +From: Julian Andres Klode <julian.klode@canonical.com> +Date: Mon, 5 Feb 2018 11:34:14 +0100 +Subject: [PATCH] kpartx: print "loop deleted" to stdout, not stderr + +Commit fa643f5d2590028a59c671b81ab41383806fd258 moved some +code around and changed the print for loop deleted from stdout +to stderr - but this is not an error message, and also printed +to stdout in another place, so let's just use printf() again +here. + +Signed-off-by: Julian Andres Klode <julian.klode@canonical.com> +Forwarded: https://www.redhat.com/archives/dm-devel/2018-February/msg00021.html +--- + kpartx/kpartx.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kpartx/kpartx.c b/kpartx/kpartx.c +index c1af1c5e..2e882721 100644 +--- a/kpartx/kpartx.c ++++ b/kpartx/kpartx.c +@@ -408,7 +408,7 @@ main(int argc, char **argv){ + loopdev); + r = 1; + } else +- fprintf(stderr, "loop deleted : %s\n", loopdev); ++ printf("loop deleted : %s\n", loopdev); + } + goto end; + } +-- +2.15.1 +
  15. Download patch debian/multipath.conf

    --- 0.8.4-4/debian/multipath.conf 1970-01-01 00:00:00.000000000 +0000 +++ 0.8.4-4ubuntu2/debian/multipath.conf 2020-07-30 14:45:10.000000000 +0000 @@ -0,0 +1,3 @@ +defaults { + user_friendly_names yes +}
  16. Download patch debian/patches/series

    --- 0.8.4-4/debian/patches/series 2020-08-30 01:14:10.000000000 +0000 +++ 0.8.4-4ubuntu2/debian/patches/series 2020-08-31 01:13:01.000000000 +0000 @@ -10,3 +10,9 @@ partx-path.patch static-assert.patch jsonc-true.patch libmpathpersist-depend-on-libmultipath.patch +disable-fexceptions-udeb.patch +kpartx_more_loopback_fixes.patch +enable-find-multipaths.patch +kpartx-Improve-finding-loopback-device-by-file.patch +kpartx-print-loop-deleted-to-stdout-not-stderr.patch +no-start-in-containers.patch
  17. Download patch debian/patches/no-start-in-containers.patch

    --- 0.8.4-4/debian/patches/no-start-in-containers.patch 1970-01-01 00:00:00.000000000 +0000 +++ 0.8.4-4ubuntu2/debian/patches/no-start-in-containers.patch 2020-07-30 14:45:10.000000000 +0000 @@ -0,0 +1,17 @@ +Description: Do not attempt to start multipath-tools in containers, + should switch for on-demand udev/socket based activation in the + future. +Author: Dimitri John Ledkov <xnox@ubuntu.com> +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1823093 + + +--- multipath-tools-0.7.4.orig/multipathd/multipathd.service ++++ multipath-tools-0.7.4/multipathd/multipathd.service +@@ -8,6 +8,7 @@ DefaultDependencies=no + Conflicts=shutdown.target + ConditionKernelCommandLine=!nompath + ConditionKernelCommandLine=!multipath=off ++ConditionVirtualization=!container + + [Service] + Type=notify
  18. Download patch debian/kpartx.install

    --- 0.8.4-4/debian/kpartx.install 2020-08-30 01:14:10.000000000 +0000 +++ 0.8.4-4ubuntu2/debian/kpartx.install 2020-07-30 14:45:10.000000000 +0000 @@ -1,4 +1,4 @@ /usr/share/man/man8/kpartx.8.gz /sbin/kpartx -/lib/udev/kpartx_id -/lib/udev/dmsetup_env +/lib*/udev/kpartx_id +/lib*/udev/dmsetup_env
  19. Download patch debian/initramfs/kpartx.hook

    --- 0.8.4-4/debian/initramfs/kpartx.hook 1970-01-01 00:00:00.000000000 +0000 +++ 0.8.4-4ubuntu2/debian/initramfs/kpartx.hook 2020-07-30 14:45:10.000000000 +0000 @@ -0,0 +1,22 @@ +#!/bin/sh + +PREREQS="udev" + +prereqs() { echo "$PREREQS"; } + +case $1 in +prereqs) + prereqs + exit 0 + ;; +esac + +. /usr/share/initramfs-tools/hook-functions + +copy_exec /sbin/kpartx /sbin +copy_exec /sbin/dmsetup /sbin +copy_exec /lib/udev/dmsetup_env /lib/udev +copy_exec /lib/udev/kpartx_id /lib/udev +cp -p /lib/udev/rules.d/56-dm-parts.rules $DESTDIR/lib/udev/rules.d/ +cp -p /lib/udev/rules.d/68-del-part-nodes.rules $DESTDIR/lib/udev/rules.d/ +cp -p /lib/udev/rules.d/95-kpartx.rules $DESTDIR/lib/udev/rules.d/
  20. Download patch debian/patches/newer-jsonc.patch

    --- 0.8.4-4/debian/patches/newer-jsonc.patch 1970-01-01 00:00:00.000000000 +0000 +++ 0.8.4-4ubuntu2/debian/patches/newer-jsonc.patch 2020-07-31 23:10:37.000000000 +0000 @@ -0,0 +1,22 @@ +Description: Patch to make it build with newer json-c deprecated TRUE/FALSE defines + +Author: Gianfranco Costamagna <locutusofborg@debian.org> +Last-Update: 2020-07-31 + +--- multipath-tools-0.8.4.orig/libdmmp/libdmmp_private.h ++++ multipath-tools-0.8.4/libdmmp/libdmmp_private.h +@@ -32,6 +32,14 @@ + #include <assert.h> + #include <json.h> + ++// not exported anymore by new json-c ++#ifndef TRUE ++#define TRUE 1 ++#endif ++#ifndef FALSE ++#define FALSE 0 ++#endif ++ + #include "libdmmp/libdmmp.h" + + #ifdef __cplusplus
  21. Download patch debian/initramfs/init-top

    --- 0.8.4-4/debian/initramfs/init-top 2020-08-30 01:14:10.000000000 +0000 +++ 0.8.4-4ubuntu2/debian/initramfs/init-top 2020-07-30 14:45:10.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh # -# multipath hardware handler +# multipath: load modules and daemon PREREQ=" " @@ -26,7 +26,18 @@ verbose() maybe_break pre-multipath VERBOSITY=0 -HW_HANDLERS="" +HW_HANDLERS="scsi_dh_alua scsi_dh_rdac scsi_dh_emc" +MP_MODULES="dm-multipath" + +verbose && log_begin_msg "Loading multipath modules" +for module in ${MP_MODULES}; do + if modprobe --syslog "$module"; then + verbose && log_success_msg "loaded module ${module}." + else + log_failure_msg "failed to load module ${module}." + fi +done +verbose && log_end_msg verbose && log_begin_msg "Loading multipath hardware handlers" for module in ${HW_HANDLERS}; do @@ -38,6 +49,11 @@ for module in ${HW_HANDLERS}; do done verbose && log_end_msg +# Start multipathd +verbose && log_begin_msg "Starting multipathd" +/sbin/multipathd -B +verbose && log_end_msg + maybe_break post-multipath exit 0
  22. Download patch debian/initramfs/local-premount

    --- 0.8.4-4/debian/initramfs/local-premount 1970-01-01 00:00:00.000000000 +0000 +++ 0.8.4-4ubuntu2/debian/initramfs/local-premount 2020-07-30 14:45:10.000000000 +0000 @@ -0,0 +1,30 @@ +#!/bin/sh + +set -e + +PREREQ="" + +prereqs() +{ + echo "${PREREQ}" +} + +case "${1}" in + prereqs) + prereqs + exit 0 + ;; +esac + +. /scripts/functions + +if [ -x /sbin/multipath ] +then + [ "$quiet" != "y" ] && log_begin_msg "Waiting for udev to settle (multipath)" + udevadm settle --timeout=121 || true + [ "$quiet" != "y" ] && log_end_msg +fi + +multipath -r -v0 -B + +exit 0
  23. Download patch debian/initramfs/hooks

    --- 0.8.4-4/debian/initramfs/hooks 2020-08-30 01:14:10.000000000 +0000 +++ 0.8.4-4ubuntu2/debian/initramfs/hooks 2020-07-30 14:45:10.000000000 +0000 @@ -30,9 +30,17 @@ add_bindings() fi } +add_wwids() +{ + if [ -r /etc/multipath/wwids ]; then + mkdir -p $DESTDIR/etc/multipath + cp /etc/multipath/wwids $DESTDIR/etc/multipath + fi +} + add_udev_rules() { - for rules in 60-multipath.rules 60-kpartx.rules; do + for rules in 60-multipath.rules 56-dm-mpath.rules; do if [ -e /lib/udev/rules.d/$rules ]; then cp -p /lib/udev/rules.d/$rules $DESTDIR/lib/udev/rules.d/ fi @@ -48,12 +56,24 @@ mkdir -p $DESTDIR/lib/multipath/ for x in /lib/multipath/*; do copy_exec $x /lib/multipath/ done +copy_exec /usr/bin/partx add_udev_rules +copy_exec /sbin/multipathd /sbin +# multipathd requires libgcc_s.so.1 (not handled by copy_exec() as it's dlopen()'ed). +# hack: find libgcc_s.so.1 via ldconfig cache (dpkg-architecture pulls lots of deps). +for x in $(ldconfig --print-cache | grep -o '/lib/.*/libgcc_s\.so\.1'); do + copy_exec $x $(dirname $x) +done + +# multipathd requires /run/multipathd.pid +mkdir -p $DESTDIR/run + [ -r /etc/multipath.conf ] && cp /etc/multipath.conf $DESTDIR/etc/ add_bindings +add_wwids -for x in dm-multipath dm-service-time dm-round-robin; do +for x in dm-multipath dm-service-time dm-round-robin dm-queue-length; do manual_add_modules ${x} done
  24. Download patch debian/patches/enable-find-multipaths.patch

    --- 0.8.4-4/debian/patches/enable-find-multipaths.patch 1970-01-01 00:00:00.000000000 +0000 +++ 0.8.4-4ubuntu2/debian/patches/enable-find-multipaths.patch 2020-08-31 01:13:01.000000000 +0000 @@ -0,0 +1,17 @@ +From: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com> +Date: Thu, 25 Jan 2018 12:02:55 +0100 +Subject: enable find multipaths + +Forwarded: no +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1463046 +--- a/libmultipath/defaults.h ++++ b/libmultipath/defaults.h +@@ -22,7 +22,7 @@ + #define DEFAULT_NO_PATH_RETRY NO_PATH_RETRY_UNDEF + #define DEFAULT_VERBOSITY 2 + #define DEFAULT_REASSIGN_MAPS 0 +-#define DEFAULT_FIND_MULTIPATHS FIND_MULTIPATHS_STRICT ++#define DEFAULT_FIND_MULTIPATHS FIND_MULTIPATHS_ON + #define DEFAULT_FAST_IO_FAIL 5 + #define DEFAULT_DEV_LOSS_TMO 600 + #define DEFAULT_RETAIN_HWHANDLER RETAIN_HWHANDLER_ON
  25. Download patch debian/patches/kpartx_more_loopback_fixes.patch

    --- 0.8.4-4/debian/patches/kpartx_more_loopback_fixes.patch 1970-01-01 00:00:00.000000000 +0000 +++ 0.8.4-4ubuntu2/debian/patches/kpartx_more_loopback_fixes.patch 2020-08-31 01:13:01.000000000 +0000 @@ -0,0 +1,40 @@ +From: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com> +Subject: Fix kpartx some more to correctly remove loopback devices on delete. +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/multipath-tools/+bug/1543430 + +Loop devices get created when using kpartx with an image file, but should be +removed afterwards when using kpartx -d. Unfortunately, the devmapper maps +did get removed but not the losetup nodes behind it, which were still bound +to the image file. This is because we re-stat the loop device once we've +figured which one to use, since otherwise we wouldn't have major and minor +numbers for a loopback file; yet we need those to create the devmapper maps +reliably. + +Instead of checking if we're dealing with a regular type file (since after +stat() we'd not have the S_ISREG check succeed since we stat()'ed a device), +use the loopdev variable. It's equivalent to device but only set if we've been +called to work on an image. + +*update* +This got partially upstream with the following patch - maybe we can drop it now?: +commit ed4c3119cc1d6bc6656cf84d1e9c1ab184d87814 +Author: Christian Kastner <ckk@kvr.at> +Date: Wed Jul 13 19:23:02 2016 +0200 + kpartx: Fix check whether to detach loop device + + +--- + kpartx/kpartx.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/kpartx/kpartx.c ++++ b/kpartx/kpartx.c +@@ -649,7 +649,7 @@ main(int argc, char **argv){ + if (n > 0) + break; + } +- if (what == LIST && loopcreated && S_ISREG (buf.st_mode)) { ++ if (what == LIST && loopcreated && loopdev) { + if (fd != -1) + close(fd); + if (del_loop(device)) {

Debian ( Changelog | PTS | Bugs ) Ubuntu ( Changelog | txt | LP | Bugs ) | Diff from Ubuntu

Source: open-iscsi

open-iscsi (2.1.1-1ubuntu2) groovy; urgency=medium * debian/control, debian/rules: Fix libopeniscsiusr binary package name (LP: #1892228). * debian/rules: Fix deprecated warning for dh_installinit that --no-restart-on-upgrade has been replaced by --no-stop-on-upgrade, which is equivalent in functionality (ref deb #837528). -- Rafael David Tinoco <rafaeldtinoco@ubuntu.com> Wed, 19 Aug 2020 19:08:47 +0000 open-iscsi (2.1.1-1ubuntu1) groovy; urgency=medium * New upstream version 2.1.1 * d/rules: Don't FTBFS due to warnings new in gcc10 regarding bounds and initialization, because upstream's gcc10 support is incomplete. This change can be dropped when upstream has completed their gcc support. * Merge with Debian unstable (LP: #1891374). Remaining changes: - debian/tests: Add Ubuntu autopkgtest suite: - README-boot-test.md - tgt-boot-test: tests - test-open-iscsi.py - testlib.py - get-image - patch-image - testsuite - xkvm - d/iscsid.service: Let iscsid systemd job run in privileged containers but not in unprivileged ones - d/extra/initramfs.local-top: handle iSCSI iBFT DHCP to correctly run ipconfig to gather all DHCP config info, including DNS search domain, which iBFT can't provide. - Remove initramfs interfaces stamp in case no iscsi devs mounted. If iscsi root was requested, but no iscsi devices were mounted, remove the initramfs interfaces stamp file. Meaning, that on shutdown there is no 30s delay, whilst trying to re-establish iscsi login to perform a logout. - add IPv6 support - Source /run/net6-*.conf when needed. - d/extra/initramfs.local-top: handle IPv6 configs being shipped in DEVICE6 or /run/net6-*.conf in the initramfs, so we can fill in .interface - d/rules, d/open-iscsi.finalrd, d/control: ship the finalrd iscsi logout hook and recommend finalrd and busybox for the logout hook to work. - Make iscsid socket-activated to only activate it as needed: - debian/open-iscsi.service: do not start or check iscsid.service - debian/rules: install and enable iscsid.socket - debian/open-iscsi.postinst: - run restart logic only if service is running on upgrade - drop no longer reachable upgrade path that affects iscsid - disable iscsid.service on upgrade - handle iscsid.socket to be started if the service is not running yet - d/iscsi-disk.rules: Add a udev rule so that iscsid.service will be run when udev disks are attached. - d/iscsid.service: Remove ExecStop= directive. - debian/tests/install: fix tests to work with socket activation - debian/patches/lp1755858-default-iscsid_conf-to-iscsid_socket.patch - debian/open-iscsi.service: Start open-iscsi systemd job when either /etc/iscsi/nodes or /sys/class/iscsi_session have content. - Prevent network interface that contains iscsi root from bouncing during boot or going down during shutdown if the system is using resolvconf or ifupdown: - d/iscsi-network-interface.rules - d/extra/net-interface-handler - d/extra/initramfs.hook: add ib_iser to the list of modules included in the initramfs, so that we can in principle support iscsi root on infiniband. - d/open-iscsi.kmod drop: (LP #1833586) no static module list is needed if we let iscsid load modules itself. - Stop producing udebs on i386 where we no longer have d-i or a kernel. - Use python2 instead of python in the autopkg tests: Next step for open-iscsi is to revist all iscsi-root feature and autopkgtests, so keep python2 to avoid re-work later. - d/extra/initramfs.local-{top,bottom}: move removal of open-iscsi.interface file from local-top to local-bottom, and fix shell quoting issue that would result in /run/initramfs/ open-iscsi.interface always being removed (LP #1872813) -- Rafael David Tinoco <rafaeldtinoco@ubuntu.com> Thu, 13 Aug 2020 04:29:43 +0000

Modifications :
  1. Download patch debian/tests/xkvm
  2. Download patch debian/tests/README-boot-test.md

    --- 2.0.874-7.1/debian/tests/README-boot-test.md 1970-01-01 00:00:00.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/tests/README-boot-test.md 2020-08-16 18:46:13.000000000 +0000 @@ -0,0 +1,139 @@ +## open-iscsi boot test +The purpose of this test (`CloudImageTest`) is to test the boot of a system +using an iscsi root target. In order to accomplish that, the tests does + + 1. Download Ubuntu cloud image + 2. installs the open-iscsi deb inside + 3. collect kernel and initramfs from inside + 4. register the image as a read-only iscsi target served by tgt + 5. boot kernel and initramfs with a command line to use the image as root. + And additionally attach a local disk for collecting output. + 6. provide user-data that executes commands, colects files and writes them + to the output disk and then shuts the system down. + 7. extract the collected files from the output disk and inspect them. + +The `CloudImageTest` uses qemu user networking. + + +## Caveats + + 1. It depends on a cloud-image being present. + + Cloud-images are often not available for the first few weeks of a cycle. + If no cloud-image of 'REL' is available, then boot-test will skip. + If 'REL' is not known in distro-info-data, then test will fail. + + This means that uploads of open-iscsi (or its dependencies) will not + be properly tested until a cloud-image is available, and will fail + until distro-info-data is uploaded. + + 2. Installation of large packages via patch-image may fail. + An ubuntu image downloaded has only a small amount of extra space. + Installation of a new kernel into the target would probably fail. + + If this becomes a problem, we could grow the disk like done at + https://gist.github.com/smoser/6a048a0e2795b48221fc44962202fa14 + + +### testing manually ### +The test case in `debian/tests/test-open-iscsi.py` uses some helper tools. + + * **patch-image**: this is used to install packages into the pristine image + and collect the kernel and initramfs out of the image. This allows us to + test the portions of open-iscsi that update the initramfs. Without + using the updated initramfs we wouldn't really be testing the new + open-iscsi. + + It will upgrade any packages inside that are mentioned in + ADT_TEST_TRIGGERS environment. It will also install open-iscsi if + it is not in that list. + + It installs packages into the target by copying the host system's + /etc/apt content in, and also includes copying local (file://) apt + repos into the target. This is necessary for the autopackage test + environment that adds local package repositories to sources.list.d. + + It may also make other changes to the image to workaround bugs. + See --help output for list of bugs. + + * **get-image**: This downloads an image from cloud-images.ubuntu.com. See + its Usage for more information. it downloads via stream data and verifies + download. One thing to note is that it does not overwrite existing files. + + * **tgt-boot-test**: this registers an image in tgt locally, and then boots + kernel and initramfs to mount that. It knows how to build iscsi kernel + command lines. + + By default, the xkvm process that is started will be allowed `60m` to + complete. This can be adjusted by setting `BOOT_TIMEOUT` in the + environment. + + * **xkvm**: this is a helper/wrapper around qemu. It is taken from the curtin + projects tools/ directory. It allows some simplified command lines, and + most usefully, the '--netdev=<bridge>' argument will create a tun/tap + device and attach it to the bridge. + + If the host system is not bare metal, kvm will not be + enabled in the guest that is lauched. To force use of kvm, set + _USE_KVM=1 in the environment. See 'should_try_kvm' in xkvm for details. + +Testing manually looks like this: + + ## set up path to include debian/tests directory. + $ PATH=$PWD/debian/tests:$PATH + + ## Get the image you want. This creates out.d/disk.img and disk.img.dist + $ get-image xenial.d xenial + + ## patch the image with an open-iscsi, which creates xenial.d/kernel + ## and xenial.d/initrd from the kernel and initramfs inside the image. + $ apt-get download open-iscsi + $ deb=$(ls open-iscsi_*.deb | tail -n 1) + $ sudo ./debian/tests/patch-image \ + --kernel=xenial.d/kernel --initrd=xenial.d/initrd + xenial.d/disk.img "$deb" + + ## Boot the system, log in, look around. + $ tgt-boot-test -v xenial.d/disk.img xenial.d/kernel xenial.d/initrd + + +### Features of tgt-boot-test ### + +tgt-boot-test does a number of useful things. + + * determines the host address that the guest will use. + This should support ipv6 and ipv4 addresses on bridges, and + knows values that qemu's user networking uses. Flags passed to `--netdev` + are read intelligently. This can be overriden with `--host-addr`, but + it does a good job of determining what the right values are. + + * provides a nocloud metadata service with a python web server that + supports ipv4 and ipv6. + + * provides the ability to provide additional kernel command line options + or to provide a 'template' that references variables it knows such as + {iserver} (iscsi server) or {seed_url}. + + * Sets ubuntu (passw0rd) and root password (root) and imports users + ssh keys to the ubuntu user. + +One thing to note is that yakkety's version of qemu does not run an ipv6 +dhcp server on its user-network, so a stateful dhclient request will not +work. + +In order to create a bridge easily with a ipv6 dhcp server, you can use +lxd at sufficent version (https://github.com/lxc/lxd/issues/2481). +Assuming that bug is fixed, to create an ipv6 only bridge: + + $ netname="ipv6-only" + $ lxc network create $netname + $ lxc network unset $netname ipv4.address + $ lxc network unset $netname ipv4.nat + $ lxc network set $netname ipv6.dhcp.stateful true + +Then, you can use tgt-boot-test with that: + + $ PATH=$PWD/debian/tests:$PATH + $ ./debian/tests/tgt-boot-test -vv --netdev=ipv6-only \ + --cmdline-ip="ip=off ip6=dhcp" \ + disk.img kernel initramfs
  3. Download patch debian/tests/install

    --- 2.0.874-7.1/debian/tests/install 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/tests/install 2020-08-18 22:34:08.000000000 +0000 @@ -28,5 +28,8 @@ grep -vq '^GenerateName=yes' /etc/iscsi/ grep -q '^InitiatorName=' /etc/iscsi/initiatorname.iscsi || die_with_file /etc/iscsi/initiatorname.iscsi "InitiatorName is not set" # Make sure the daemon is started -service iscsid status || die "iscsid not running" -pgrep -c iscsid >/dev/null || die "iscsid not running" +systemctl is-active iscsid.socket || die "iscsid socket not running" +# no-op discovery to socket activate service +iscsiadm -m discovery -t sendtargets -p 127.0.0.1 >/dev/null 2>&1|| /bin/true +systemctl is-active iscsid.service || die "iscsid service not running" +pgrep -c iscsid >/dev/null || die "iscsid process not running"
  4. Download patch debian/patches/security/Skip-useless-strcopy-and-validate-CIDR-length.patch

    --- 2.0.874-7.1/debian/patches/security/Skip-useless-strcopy-and-validate-CIDR-length.patch 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/patches/security/Skip-useless-strcopy-and-validate-CIDR-length.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -From a7a96131bd2ea342f6def0e46be514baf8037ae8 Mon Sep 17 00:00:00 2001 -From: Lee Duncan <lduncan@suse.com> -Date: Fri, 15 Dec 2017 11:18:35 -0800 -Subject: [PATCH 6/8] Skip useless strcopy, and validate CIDR length - -Remove a useless strcpy() that copies a string onto itself, -and ensure the CIDR length "keepbits" is not negative. -Found by Qualsys. ---- - iscsiuio/src/unix/iscsid_ipc.c | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) - ---- a/iscsiuio/src/unix/iscsid_ipc.c -+++ b/iscsiuio/src/unix/iscsid_ipc.c -@@ -148,7 +148,7 @@ static int decode_cidr(char *in_ipaddr_s - char *tmp, *tok; - char ipaddr_str[NI_MAXHOST]; - char str[INET6_ADDRSTRLEN]; -- int keepbits = 0; -+ unsigned long keepbits = 0; - struct in_addr ia; - struct in6_addr ia6; - -@@ -161,8 +161,7 @@ static int decode_cidr(char *in_ipaddr_s - tmp = ipaddr_str; - tok = strsep(&tmp, "/"); - LOG_INFO(PFX "in cidr: bitmask '%s' ip '%s'", tmp, tok); -- keepbits = atoi(tmp); -- strcpy(ipaddr_str, tok); -+ keepbits = strtoull(tmp, NULL, 10); - } - - /* Determine if the IP address passed from the iface file is
  5. Download patch etc/iscsid.conf

    --- 2.0.874-7.1/etc/iscsid.conf 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/etc/iscsid.conf 2020-02-26 19:07:13.000000000 +0000 @@ -10,17 +10,19 @@ ###################### # iscsid daemon config ###################### +# # If you want iscsid to start the first time an iscsi tool # needs to access it, instead of starting it when the init # scripts run, set the iscsid startup command here. This # should normally only need to be done by distro package -# maintainers. +# maintainers. If you leave the iscsid daemon running all +# the time then leave this attribute commented out. # # Default for Fedora and RHEL. (uncomment to activate). -# iscsid.startup = /etc/rc.d/init.d/iscsid force-start +# iscsid.startup = /bin/systemctl start iscsid.socket iscsiuio.soccket # -# Default for upstream open-iscsi scripts (uncomment to activate). -iscsid.startup = /sbin/iscsid +# Default if you are not using systemd (uncomment to activate) +# iscsid.startup = /usr/bin/service start iscsid # Check for active mounts on devices reachable through a session # and refuse to logout if there are any. Defaults to "No". @@ -55,6 +57,13 @@ node.leading_login = No # to CHAP. The default is None. #node.session.auth.authmethod = CHAP +# To configure which CHAP algorithms to enable set +# node.session.auth.chap_algs to a comma seperated list. +# The algorithms should be listen with most prefered first. +# Valid values are MD5, SHA1, SHA256, and SHA3-256. +# The default is MD5. +#node.session.auth.chap_algs = SHA3-256,SHA256,SHA1,MD5 + # To set a CHAP username and password for initiator # authentication by the target(s), uncomment the following lines: #node.session.auth.username = username @@ -291,6 +300,17 @@ discovery.sendtargets.iscsi.MaxRecvDataS # appropriate number of sessions is created. node.session.nr_sessions = 1 +# When iscsid starts up it recovers existing sessions, if possible. +# If the target for a session has gone away when this occurs, the +# iscsid daemon normally tries to reestablish each session, +# in succession, in the background, by trying again every two +# seconds, until all sessions are restored. This configuration +# variable can limits the number of retries for each session. +# For example, setting reopen_max=150 would mean that each session +# recovery was limited to about five minutes. +# +node.session.reopen_max = 0 + #************ # Workarounds #************ @@ -305,3 +325,11 @@ node.session.iscsi.FastAbort = Yes # a task management function like an ABORT TASK or LOGICAL UNIT RESET, that # it continue to respond to R2Ts. To enable this uncomment this line # node.session.iscsi.FastAbort = No + +# To prevent doing automatic scans that would add unwanted luns to the system +# we can disable them and have sessions only do manually requested scans. +# Automatic scans are performed on startup, on login, and on AEN/AER reception +# on devices supporting it. For HW drivers all sessions will use the value +# defined in the configuration file. This configuration option is independent +# of scsi_mod scan parameter. (The default behavior is auto): +node.session.scan = auto
  6. Download patch debian/TODO.Debian

    --- 2.0.874-7.1/debian/TODO.Debian 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/TODO.Debian 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -TODO for package open-iscsi ---------------------------- - - - find a way to make event-based activation work on sysvinit systems - and then deprecate the current LVM hacks
  7. Download patch debian/open-iscsi-udeb.lintian-overrides

    --- 2.0.874-7.1/debian/open-iscsi-udeb.lintian-overrides 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/open-iscsi-udeb.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -open-iscsi-udeb udeb: non-standard-file-perm etc/iscsi/iscsid.conf 0600 != 0644
  8. Download patch Changelog
  9. Download patch iscsiuio/src/uip/uip.c

    --- 2.0.874-7.1/iscsiuio/src/uip/uip.c 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/iscsiuio/src/uip/uip.c 2020-02-26 19:07:13.000000000 +0000 @@ -102,9 +102,6 @@ ******************************************************************************/ #define PFX "uip " -static const uip_ip6addr_t all_ones_addr6 = { - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff -}; static const uip_ip4addr_t all_ones_addr4 = { 0xffff, 0xffff }; const uip_ip6addr_t all_zeroes_addr6 = {
  10. Download patch debian/patches/security/Do-not-double-close-IPC-file-stream-to-iscsid.patch

    --- 2.0.874-7.1/debian/patches/security/Do-not-double-close-IPC-file-stream-to-iscsid.patch 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/patches/security/Do-not-double-close-IPC-file-stream-to-iscsid.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -From 5504053cc08df38d8d85032fa1691e363dfcfb92 Mon Sep 17 00:00:00 2001 -From: Lee Duncan <lduncan@suse.com> -Date: Fri, 15 Dec 2017 11:13:29 -0800 -Subject: [PATCH 4/8] Do not double-close IPC file stream to iscsid - -A double-close of a file descriptor and its associated FILE stream -can be an issue in multi-threaded cases. Found by Qualsys. ---- - iscsiuio/src/unix/iscsid_ipc.c | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - ---- a/iscsiuio/src/unix/iscsid_ipc.c -+++ b/iscsiuio/src/unix/iscsid_ipc.c -@@ -913,6 +913,9 @@ early_exit: - /** - * process_iscsid_broadcast() - This function is used to process the - * broadcast messages from iscsid -+ * -+ * s2 is an open file descriptor, which -+ * must not be left open upon return - */ - int process_iscsid_broadcast(int s2) - { -@@ -928,6 +931,7 @@ int process_iscsid_broadcast(int s2) - if (fd == NULL) { - LOG_ERR(PFX "Couldn't open file descriptor: %d(%s)", - errno, strerror(errno)); -+ close(s2); - return -EIO; - } - -@@ -1030,7 +1034,8 @@ int process_iscsid_broadcast(int s2) - } - - error: -- free(data); -+ if (data) -+ free(data); - fclose(fd); - - return rc; -@@ -1132,8 +1137,8 @@ static void *iscsid_loop(void *arg) - break; - } - -+ /* this closes the file descriptor s2 */ - process_iscsid_broadcast(s2); -- close(s2); - } - - pthread_cleanup_pop(0);
  11. Download patch debian/tests/control

    --- 2.0.874-7.1/debian/tests/control 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/tests/control 2020-08-18 22:36:46.000000000 +0000 @@ -1,7 +1,10 @@ Tests: install +Restrictions: needs-root, isolation-machine, breaks-testbed + +Tests: testsuite Restrictions: needs-root isolation-machine breaks-testbed -Depends: +Depends: open-iscsi, python2, tgt, qemu-system, ubuntu-cloudimage-keyring, simplestreams, python-netifaces, distro-info, cloud-image-utils, dctrl-tools, rsync Tests: nested Restrictions: needs-root, isolation-machine, breaks-testbed, allow-stderr -Depends: targetcli-fb, autopkgtest (>= 4~), qemu-system, qemu-utils, python3, python3-netifaces +Depends: targetcli-fb, qemu-system, qemu-utils, python3, python3-netifaces
  12. Download patch iscsiuio/src/uip/uip.h

    --- 2.0.874-7.1/iscsiuio/src/uip/uip.h 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/iscsiuio/src/uip/uip.h 2020-02-26 19:07:13.000000000 +0000 @@ -70,8 +70,8 @@ struct uip_stack; typedef u16_t uip_ip4addr_t[2]; typedef u16_t uip_ip6addr_t[8]; -const uip_ip6addr_t all_zeroes_addr6; -const uip_ip4addr_t all_zeroes_addr4; +extern const uip_ip6addr_t all_zeroes_addr6; +extern const uip_ip4addr_t all_zeroes_addr4; #define ETH_BUF(buf) ((struct uip_eth_hdr *)buf) #define VLAN_ETH_BUF(buf) ((struct uip_vlan_eth_hdr *)buf)
  13. Download patch debian/patches/adapt-chap-auth-algorithms-to-debian.patch
  14. Download patch doc/iscsid.8

    --- 2.0.874-7.1/doc/iscsid.8 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/doc/iscsid.8 2020-02-26 19:07:13.000000000 +0000 @@ -40,7 +40,7 @@ do not write a process ID file. .TP .BI [-p|--pid=]\fIpid\-file\fP write process ID to \fIpid\-file\fR rather than the default -\fI/var/run/iscsid.pid\fR +\fI/run/iscsid.pid\fR .TP .BI [-h|--help] display this help and exit
  15. Download patch include/fw_context.h

    --- 2.0.874-7.1/include/fw_context.h 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/include/fw_context.h 2020-02-26 19:07:13.000000000 +0000 @@ -60,6 +60,7 @@ struct boot_context { /* network settings */ int nic_flags; enum ibft_ip_prefix_origin origin; + int prefix; char dhcp[NI_MAXHOST]; char iface[IF_NAMESIZE]; char mac[18];
  16. Download patch debian/patches/security/Check-for-root-peer-user-for-iscsiuio-IPC.patch

    --- 2.0.874-7.1/debian/patches/security/Check-for-root-peer-user-for-iscsiuio-IPC.patch 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/patches/security/Check-for-root-peer-user-for-iscsiuio-IPC.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,122 +0,0 @@ -From e313bd648a4c8a9526421e270eb597a5de1e0c7f Mon Sep 17 00:00:00 2001 -From: Lee Duncan <lduncan@suse.com> -Date: Fri, 15 Dec 2017 10:36:11 -0800 -Subject: [PATCH 1/8] Check for root peer user for iscsiuio IPC - -This fixes a possible vulnerability where a non-root -process could connect with iscsiuio. Fouund by Qualsys. ---- - iscsiuio/src/unix/Makefile.am | 3 ++- - iscsiuio/src/unix/iscsid_ipc.c | 47 ++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 49 insertions(+), 1 deletion(-) - ---- a/iscsiuio/src/unix/Makefile.am -+++ b/iscsiuio/src/unix/Makefile.am -@@ -20,7 +20,8 @@ iscsiuio_SOURCES = build_date.c \ - nic_utils.c \ - packet.c \ - iscsid_ipc.c \ -- ping.c -+ ping.c \ -+ ${top_srcdir}/../utils/sysdeps/sysdeps.c - - iscsiuio_CFLAGS = $(AM_CFLAGS) \ - $(LIBNL_CFLAGS) \ ---- a/iscsiuio/src/unix/iscsid_ipc.c -+++ b/iscsiuio/src/unix/iscsid_ipc.c -@@ -37,6 +37,8 @@ - * - */ - -+#define _GNU_SOURCE -+ - #include <errno.h> - #include <pthread.h> - #include <signal.h> -@@ -47,6 +49,8 @@ - #include <sys/socket.h> - #include <sys/time.h> - #include <sys/un.h> -+#include <sys/types.h> -+#include <pwd.h> - - #define PFX "iscsi_ipc " - -@@ -61,6 +65,7 @@ - #include "iscsid_ipc.h" - #include "uip.h" - #include "uip_mgmt_ipc.h" -+#include "sysdeps.h" - - #include "logger.h" - #include "uip.h" -@@ -102,6 +107,7 @@ struct iface_rec_decode { - uint16_t mtu; - }; - -+#define PEERUSER_MAX 64 - - /****************************************************************************** - * iscsid_ipc Constants -@@ -1029,6 +1035,40 @@ static void iscsid_loop_close(void *arg) - LOG_INFO(PFX "iSCSI daemon socket closed"); - } - -+/* -+ * check that the peer user is privilidged -+ * -+ * return 1 if peer is ok else 0 -+ * -+ * XXX: this function is copied from iscsid_ipc.c and should be -+ * moved into a common library -+ */ -+static int -+mgmt_peeruser(int sock, char *user) -+{ -+ struct ucred peercred; -+ socklen_t so_len = sizeof(peercred); -+ struct passwd *pass; -+ -+ errno = 0; -+ if (getsockopt(sock, SOL_SOCKET, SO_PEERCRED, &peercred, -+ &so_len) != 0 || so_len != sizeof(peercred)) { -+ /* We didn't get a valid credentials struct. */ -+ LOG_ERR(PFX "peeruser_unux: error receiving credentials: %m"); -+ return 0; -+ } -+ -+ pass = getpwuid(peercred.uid); -+ if (pass == NULL) { -+ LOG_ERR(PFX "peeruser_unix: unknown local user with uid %d", -+ (int) peercred.uid); -+ return 0; -+ } -+ -+ strlcpy(user, pass->pw_name, PEERUSER_MAX); -+ return 1; -+} -+ - /** - * iscsid_loop() - This is the function which will process the broadcast - * messages from iscsid -@@ -1038,6 +1078,7 @@ static void *iscsid_loop(void *arg) - { - int rc; - sigset_t set; -+ char user[PEERUSER_MAX]; - - pthread_cleanup_push(iscsid_loop_close, arg); - -@@ -1077,6 +1118,12 @@ static void *iscsid_loop(void *arg) - continue; - } - -+ if (!mgmt_peeruser(iscsid_opts.fd, user) || strncmp(user, "root", PEERUSER_MAX)) { -+ close(s2); -+ LOG_ERR(PFX "Access error: non-administrative connection rejected"); -+ break; -+ } -+ - process_iscsid_broadcast(s2); - close(s2); - }
  17. Download patch debian/open-iscsi-udeb.install

    --- 2.0.874-7.1/debian/open-iscsi-udeb.install 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/open-iscsi-udeb.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -#!/usr/bin/dh-exec -usr/iscsiadm /bin -utils/iscsi-iname /sbin -utils/iscsi_discovery /sbin -usr/iscsid /sbin -usr/iscsistart /sbin -etc/iscsid.conf /etc/iscsi -debian/open-iscsi-udeb.start => /sbin/iscsi-start -debian/open-iscsi-udeb.finish-install => /usr/lib/finish-install.d/10open-iscsi -# dh_lintian ignores udebs, force installation -debian/open-iscsi-udeb.lintian-overrides => /usr/share/lintian/overrides/open-iscsi-udeb
  18. Download patch debian/rules

    --- 2.0.874-7.1/debian/rules 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/rules 2020-08-19 19:08:47.000000000 +0000 @@ -1,85 +1,108 @@ #!/usr/bin/make -f -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 +# export DH_VERBOSE = 1 -export DEB_BUILD_MAINT_OPTIONS = hardening=+all -export DEB_CFLAGS_MAINT_APPEND = -Wall -DOFFLOAD_BOOT_SUPPORTED +DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) + +SOURCE := $(shell dpkg-parsechangelog | sed -ne 's,^Source: *\(.*\)$$,\1,p') +VERSION_COMPLETE := $(shell dpkg-parsechangelog | sed -ne 's,^Version: *\(.*\)$$,\1,p') +VERSION_DEBIAN := $(shell echo "$(VERSION_COMPLETE)" | sed -e 's,^[^-]*-,,') DPKG_EXPORT_BUILDFLAGS = 1 -include /usr/share/dpkg/default.mk +include /usr/share/dpkg/buildflags.mk -%: - dh $@ --with autotools_dev,autoreconf,systemd +# Fix gcc10 warnings as errors while upstream doesn't catch up +export DEB_CFLAGS_PREPEND=-Wno-error=zero-length-bounds -Wno-error=format-overflow= -Wno-error=format-truncation= -Wno-error=maybe-uninitialized +export DEB_CXXFLAGS_PREPEND=${DEB_CFLAGS_PREPEND} -DEB_UPSTREAM_VERSION := $(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-]+).*,\1,p') +%: + dh $@ -get-orig-source: - uscan --force-download --rename --repack --download-version=$(DEB_UPSTREAM_VERSION) --destdir=. +override_dh_update_autotools_config: +override_autoreconf: +override_dh_auto_configure: override_dh_auto_build: - @# We want to regenerate the parser/lexer files with bison/flex - @# to make sure that the package is fully built from source. - @# Store the generated files upstream added to the source - @# tarball away and explicitly call flex/bison here. - mv utils/fwparam_ibft/prom_lex.c utils/fwparam_ibft/prom_lex.c.upstream - mv utils/fwparam_ibft/prom_parse.tab.c utils/fwparam_ibft/prom_parse.tab.c.upstream - mv utils/fwparam_ibft/prom_parse.tab.h utils/fwparam_ibft/prom_parse.tab.h.upstream - cd utils/fwparam_ibft && flex -t prom_lex.l | \ - ../../debian/workaround_flex_bug.sh > prom_lex.c - cd utils/fwparam_ibft && bison -d prom_parse.y - - @# The build system doesn't support CPPFLAGS - env CFLAGS="$(CPPFLAGS) $(CFLAGS)" dh_auto_build - @# Build udeb variant without libmount - mkdir -p build.deb - cp -a usr/iscsid usr/iscsistart build.deb/ - rm usr/initiator_common.o usr/mntcheck.o usr/iscsid usr/iscsistart - env CFLAGS="$(CPPFLAGS) $(CFLAGS) -DNO_LIBMOUNT" dh_auto_build -- LIBMOUNT_LIB= + CFLAGS="$(CPPFLAGS) $(CFLAGS)" dh_auto_build override_dh_auto_install: - @# do nothing, we install stuff with dh_install etc. -override_dh_auto_clean: - dh_auto_clean - rm -rf build.deb - @# Make dpkg-source happy and restore upstream's generated lexer/parser files - @# in the clean step. - ! [ -f utils/fwparam_ibft/prom_lex.c.upstream ] || mv utils/fwparam_ibft/prom_lex.c.upstream utils/fwparam_ibft/prom_lex.c - ! [ -f utils/fwparam_ibft/prom_parse.tab.c.upstream ] || mv utils/fwparam_ibft/prom_parse.tab.c.upstream utils/fwparam_ibft/prom_parse.tab.c - ! [ -f utils/fwparam_ibft/prom_parse.tab.h.upstream ] || mv utils/fwparam_ibft/prom_parse.tab.h.upstream utils/fwparam_ibft/prom_parse.tab.h - -override_dh_fixperms: - dh_fixperms - @# That configuration file might contain authentication data, so - @# don't make it world-readable. See bug #735773 for details. - chmod 0600 $(CURDIR)/debian/open-iscsi/etc/iscsi/iscsid.conf - @# Since this file is copied from the installer ramdisk to the - @# system if the udeb is used, the permissions need to be changed - @# here as well. - @# However, we might be building on an architecture that doesn't - @# have udeb support yet (see debian/control), so see if it was - @# installed during build before trying to adjust permissions. - if [ -f $(CURDIR)/debian/open-iscsi-udeb/etc/iscsi/iscsid.conf ] ; then \ - chmod 0600 $(CURDIR)/debian/open-iscsi-udeb/etc/iscsi/iscsid.conf ; \ - fi - -override_dh_installchangelogs: - dh_installchangelogs -piscsiuio iscsiuio/ChangeLog - dh_installchangelogs --remaining-packages + @# libopeniscsiusr + dh_install -p libopeniscsiusr0.2.0 libopeniscsiusr/libopeniscsiusr.so.* usr/lib/${DEB_HOST_MULTIARCH} + + @# libopeniscsi-dev + dh_install -p libopeniscsiusr-dev libopeniscsiusr/libopeniscsiusr.so usr/lib/${DEB_HOST_MULTIARCH} + dh_install -p libopeniscsiusr-dev libopeniscsiusr/libopeniscsiusr/ usr/include/ + + @# open-iscsi + dh_install -p open-iscsi usr/iscsid sbin/ + dh_install -p open-iscsi usr/iscsistart sbin/ + dh_install -p open-iscsi usr/iscsiadm sbin/ + dh_install -p open-iscsi utils/iscsi_discovery sbin/ + dh_install -p open-iscsi utils/iscsi-iname sbin/ + dh_install -p open-iscsi etc/iscsid.conf etc/iscsi/ + dh_install -p open-iscsi debian/extra/umountiscsi.sh lib/open-iscsi/ + dh_install -p open-iscsi debian/extra/logout-all.sh lib/open-iscsi/ + dh_install -p open-iscsi debian/extra/startup-checks.sh lib/open-iscsi/ + dh_install -p open-iscsi debian/extra/activate-storage.sh lib/open-iscsi/ + dh_install -p open-iscsi debian/extra/net-interface-handler lib/open-iscsi/ + dh_install -p open-iscsi debian/open-iscsi.finalrd usr/share/finalrd/ + dh_install -p open-iscsi etc/systemd/iscsid.socket lib/systemd/system/ + mkdir -p debian/open-iscsi/usr/bin + ln -s /sbin/iscsiadm debian/open-iscsi/usr/bin/iscsiadm + mkdir -p debian/open-iscsi/usr/share/initramfs-tools/hooks + mkdir -p debian/open-iscsi/usr/share/initramfs-tools/scripts/local-top/ + mkdir -p debian/open-iscsi/usr/share/initramfs-tools/scripts/local-bottom/ + cp -p debian/extra/initramfs.hook debian/open-iscsi/usr/share/initramfs-tools/hooks/iscsi + cp -p debian/extra/initramfs.local-top debian/open-iscsi/usr/share/initramfs-tools/scripts/local-top/iscsi + cp -p debian/extra/initramfs.local-bottom debian/open-iscsi/usr/share/initramfs-tools/scripts/local-bottom/iscsi + mkdir -p debian/open-iscsi/lib/udev/rules.d/ + cp -p debian/open-iscsi.rules debian/open-iscsi/lib/udev/rules.d/70-open-iscsi.rules + cp -p debian/iscsi-network-interface.rules debian/open-iscsi/lib/udev/rules.d/70-iscsi-network-interface.rules + + @# iscsiuio + dh_install -p iscsiuio iscsiuio/src/unix/iscsiuio /sbin + mkdir -p debian/iscsiuio/usr/share/initramfs-tools/hooks + cp -p debian/extra/iscsiuio.initramfs.hook debian/iscsiuio/usr/share/initramfs-tools/hooks/iscsiuio + + @# open-iscsi-udeb + dh_install -p open-iscsi-udeb usr/iscsid sbin/ + dh_install -p open-iscsi-udeb usr/iscsistart sbin/ + dh_install -p open-iscsi-udeb usr/iscsiadm sbin/ + dh_install -p open-iscsi-udeb utils/iscsi_discovery sbin/ + dh_install -p open-iscsi-udeb utils/iscsi-iname sbin/ + dh_install -p open-iscsi-udeb etc/iscsid.conf etc/iscsi/ + dh_install -p open-iscsi-udeb debian/open-iscsi-udeb.start sbin/iscsi-start + dh_install -p open-iscsi-udeb debian/open-iscsi-udeb.finish-install usr/lib/finish-install.d/10open-iscsi override_dh_installinit: - dh_installinit -popen-iscsi --no-start --name=iscsid - dh_installinit -popen-iscsi --no-start - dh_installinit --remaining-packages + dh_installinit -p open-iscsi --no-start --no-enable --no-stop-on-upgrade --name=iscsid + dh_installinit -p open-iscsi --no-start --no-enable --no-stop-on-upgrade + dh_installinit -p iscsiuio --no-start --no-enable --no-stop-on-upgrade override_dh_systemd_enable: - dh_systemd_enable -popen-iscsi --name=iscsid - dh_systemd_enable -popen-iscsi - dh_systemd_enable --remaining-packages + dh_systemd_enable -p open-iscsi --name=iscsid --no-enable iscsid.service + dh_systemd_enable -p open-iscsi --name=iscsid iscsid.socket + dh_systemd_enable -p open-iscsi open-iscsi.service + dh_systemd_enable -p iscsiuio override_dh_systemd_start: - dh_systemd_start -popen-iscsi --no-restart-on-upgrade --no-start iscsid.service open-iscsi.service - dh_systemd_start --remaining-packages + dh_systemd_start -p open-iscsi --no-restart-on-upgrade iscsid.socket + dh_systemd_start -p open-iscsi --no-restart-on-upgrade open-iscsi.service + dh_systemd_start -p iscsiuio --no-restart-on-upgrade iscsiuio.service + +override_dh_installman: + dh_installman -p open-iscsi ./doc/* + dh_installman -p libopeniscsiusr-dev ./libopeniscsiusr/docs/man/* + dh_installman -p iscsiuio iscsiuio/docs/* + +override_dh_installdocs: + dh_installdocs -p open-iscsi README sysfs-documentation THANKS + dh_installdocs -p iscsiuio iscsiuio/RELEASE.TXT iscsiuio/README + dh_installdocs -p libopeniscsiusr0.2.0 ./libopeniscsiusr/docs/doc-preclean.pl ./libopeniscsiusr/docs/kernel-doc ./libopeniscsiusr/docs/libopeniscsiusr.h.3 ./libopeniscsiusr/docs/split-man.pl + dh_installdocs -p libopeniscsiusr-dev + +override_dh_missing: + dh_missing --fail-missing # The following is taken from the initramfs-tools package. (We recommend # busybox in the initramfs because otherwise we don't have access to the
  19. Download patch iscsiuio/src/.gitignore

    --- 2.0.874-7.1/iscsiuio/src/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ 2.1.1-1ubuntu2/iscsiuio/src/.gitignore 2020-02-26 19:07:13.000000000 +0000 @@ -0,0 +1 @@ +*.a
  20. Download patch debian/iscsiuio.manpages

    --- 2.0.874-7.1/debian/iscsiuio.manpages 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/iscsiuio.manpages 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -iscsiuio/docs/iscsiuio.8
  21. Download patch debian/open-iscsi.prerm

    --- 2.0.874-7.1/debian/open-iscsi.prerm 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/open-iscsi.prerm 2020-08-18 22:36:46.000000000 +0000 @@ -25,26 +25,8 @@ case "$1" in invoke-rc.d open-iscsi stop || true invoke-rc.d iscsid stop || exit $? ;; - - upgrade) - if dpkg --compare-versions "$2" le "2.0.873+git0.3b4b4500-9"; then - # The user is attempting to downgrade, ask them if they - # really want to do this. - db_reset open-iscsi/downgrade_and_break_system || true - db_input critical open-iscsi/downgrade_and_break_system || true - db_go - db_get open-iscsi/downgrade_and_break_system - if [ "$RET" = "false" ] ; then - echo "Aborting prerm due to user request." >&2 - exit 1 - fi - fi - ;; - - deconfigure) - ;; - failed-upgrade) + upgrade|deconfigure|failed-upgrade) ;; *)
  22. Download patch iscsiuio/RELEASE.TXT

    --- 2.0.874-7.1/iscsiuio/RELEASE.TXT 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/iscsiuio/RELEASE.TXT 2020-02-26 19:07:13.000000000 +0000 @@ -1,7 +1,7 @@ Release Notes QLogic uIP Linux Driver - Version 0.7.8.2 - 12/10/2013 + Version 0.7.8.6 + 06/27/2019 QLogic Corporation 26650 Aliso Viejo Pkwy, @@ -11,17 +11,85 @@ Copyright (c) 2014, QLogic Corporation All rights reserved -uIP v0.7.10.2 (Feb 12, 2014) +uIP v0.7.8.6 (Jun 27, 2019) ======================================================= - Fixes - ----- - 1. Problem: Cont00072504 - ifconfig shows allocation failure after - up/down few hours with iSCSI + L2 traffic - Cause: A memory leak was discovered in the ongoing pthread creation - destruction code during the connection recovery process - Change: Fixed the pthread creation code - Impact: All + Fixes: + ------- + 1. Problem: OS fails to boot after one path is + disconnected from iSCSI MPIO config. + Change: In the event of DHCP failure, killing of enable_nic_thread did + not process any iscsid requests leading to error, + iscsistart: Could not broadcast to uIP after 5 tries + and login failure of active path. + Added fix to not kill enable_nic_thread and allow further + processing of iscsid requests and performing login + to next active path. + Impact: All +uIP v0.7.8.5 (Nov 20, 2018) +======================================================= + Fixes: + ------- + 1. Problem: CQ102578: observing ISCSI initiator IP ping drop + Change: 1. Do not flush tx queue on each uio interrupt + 2. Use UIO BD index instead on buffer index. + 3. Set buf_size in case of ICMP and ARP packet + Impact: QL41xxx adapters + + 2. Problem: CQ103034 - Unable to boot iSCSI BFS in IPv6 DHCP config + Change: Limit retries of performing dhcpv6 before declaring dhcp failure + Impact: All + + 3. Problem: CQ102438: I/O fails to resume on multipath LUN during port toggle. + Change: lib/cnic, lib/qedi, Release xmit_mutex in error code path and + during clear tx queue. + Impact: QL84xx adapters + + 4. Problem: Netlink buffer corruption when more than one host + try to xmit packet at the same time + Change: Add inter-host mutex while doing xmit + Impact: All + +uIP v0.7.8.4 (Feb 22, 2018) +======================================================= + Fixes: + ------- + 1. Problem: CQ95605: iSCSI BFS in DHCP config intermittently fails to boot + into the OS when source and destination addresses are in + different networks. + Change: Allow ARP for non-matching source and destination addresses. + For source and destination IP addresses in different networks, + continue with the ARP retries and further login process + instead of assuming abrupt failure. iSCSI offload adapters + may not rely on netmask information for successful iSCSI + target login. + Impact: All + +uIP v0.7.8.3 (May 18, 2017) +======================================================= + Fixes: + ------- + 1. Problem: CQ93985: iscsiuio seg faults if discovery done to not + reachable target + Change: Serialize xmit_mutex lock to prevent iscsiuio seg fault. + Impact: All + + 2. Problem: CQ91497 - Initiator fails to acquire IPv6 DHCP address + from the DHCP server + Change: Initialize the transaction-id within the dhcpv6 packet with + correct byte order, to fix the trans-id mismatch error. + Impact: All + + 3. Problem: Missing qedi ping transport hook + Change: Add qedi ping transport hook + Impact: 10/25/40/50GGbE Controller (iSCSI) + +uIP v0.7.8.3 (Sept 28, 2016) +======================================================= + Enhancements + ------------ + 1. Change: Add support for the new qedi transport + Impact: 10/25/40/50GGbE Controller (iSCSI) uIP v0.7.8.2 (Dec 10, 2013) =======================================================
  23. Download patch debian/tests/test-open-iscsi.py
  24. Download patch iscsiuio/src/uip/ipv6_ndpc.c

    --- 2.0.874-7.1/iscsiuio/src/uip/ipv6_ndpc.c 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/iscsiuio/src/uip/ipv6_ndpc.c 2020-02-26 19:07:13.000000000 +0000 @@ -134,6 +134,7 @@ wait_rtr: } while (!(ipv6c->flags & IPV6_FLAGS_ROUTER_ADV_RECEIVED)); LOG_DEBUG("%s: ndpc_handle got rtr adv", s->nic->log_name); + s->retry_count = 0; no_rtr_adv: s->state = NDPC_STATE_RTR_ADV; @@ -200,9 +201,13 @@ wait_dhcp: } else { /* Static IPv6 */ if (ustack->ip_config == IPV6_CONFIG_DHCP) { - LOG_DEBUG("%s: ndpc_handle DHCP failed", - s->nic->log_name); - PT_RESTART(&s->pt); + s->retry_count++; + if (s->retry_count > DHCPV6_NUM_OF_RETRY) { + LOG_DEBUG("%s: ndpc_handle DHCP failed", + s->nic->log_name); + } else { + PT_RESTART(&s->pt); + } } staticv6: ipv6_disable_dhcpv6(ipv6c);
  25. Download patch debian/tests/get-image
  26. Download patch debian/open-iscsi.rules

    --- 2.0.874-7.1/debian/open-iscsi.rules 1970-01-01 00:00:00.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/open-iscsi.rules 2020-08-18 22:36:46.000000000 +0000 @@ -0,0 +1,3 @@ +# When iscsi disks are present, iscsid.service should be running. LP: #1802354 +# ID_PATH looks like ip-<ipv4-dotted-quad>:<port>-iscsi-<target>-lun-<lun> +SUBSYSTEM=="block", ACTION=="add", ENV{ID_PATH}=="*-iscsi-*", ENV{SYSTEMD_WANTS}+="iscsid.service"
  27. Download patch debian/dirs

    --- 2.0.874-7.1/debian/dirs 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/dirs 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -etc/default -etc/init.d -etc/iscsi -etc/network/if-up.d -lib/modules-load.d -lib/open-iscsi -usr/share/initramfs-tools/hooks/ -usr/share/initramfs-tools/scripts/local-top/
  28. Download patch debian/compat

    --- 2.0.874-7.1/debian/compat 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/compat 2020-08-18 22:36:46.000000000 +0000 @@ -1 +1 @@ -9 +10
  29. Download patch debian/patches/security/iscsiuio-should-ignore-bogus-iscsid-broadcast-packet.patch

    --- 2.0.874-7.1/debian/patches/security/iscsiuio-should-ignore-bogus-iscsid-broadcast-packet.patch 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/patches/security/iscsiuio-should-ignore-bogus-iscsid-broadcast-packet.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -From b9c33683bdc0aed28ffe31c3f3d50bf5cdf519ea Mon Sep 17 00:00:00 2001 -From: Lee Duncan <lduncan@suse.com> -Date: Fri, 15 Dec 2017 10:37:56 -0800 -Subject: [PATCH 2/8] iscsiuio should ignore bogus iscsid broadcast packets - -When iscsiuio is receiving broadcast packets from iscsid, -if the 'payload_len', carried in the packet, is too -large then ignore the packet and print a message. -Found by Qualsys. ---- - iscsiuio/src/unix/iscsid_ipc.c | 6 ++++++ - 1 file changed, 6 insertions(+) - ---- a/iscsiuio/src/unix/iscsid_ipc.c -+++ b/iscsiuio/src/unix/iscsid_ipc.c -@@ -950,6 +950,12 @@ int process_iscsid_broadcast(int s2) - - cmd = data->header.command; - payload_len = data->header.payload_len; -+ if (payload_len > sizeof(data->u)) { -+ LOG_ERR(PFX "Data payload length too large (%d). Corrupt payload?", -+ payload_len); -+ rc = -EINVAL; -+ goto error; -+ } - - LOG_DEBUG(PFX "recv iscsid request: cmd: %d, payload_len: %d", - cmd, payload_len);
  30. Download patch debian/patches/debian/udeb-without-libmount.patch

    --- 2.0.874-7.1/debian/patches/debian/udeb-without-libmount.patch 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/patches/debian/udeb-without-libmount.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,115 +0,0 @@ -Description: Temporarily support builds without libmount - libmount is not available as an udeb at the moment, so in order for - the udeb not to break, temporarily support builds without libmount - for d-i environments (removing the safety check at session shutdown). - This is not intended for upstream, only as a stop-gap measure until - a libmount udeb is available again. -Forwarded: no -Author: Christian Seiler <christian@iwakd.de> -Bug-Debian: https://bugs.debian.org/834241 -Last-Update: 2016-08-14 ---- -This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ ---- a/usr/Makefile -+++ b/usr/Makefile -@@ -33,6 +33,8 @@ WARNFLAGS ?= -Wall -Wstrict-prototypes - CFLAGS += $(WARNFLAGS) -I../include -I. -D$(OSNAME) $(IPC_CFLAGS) - PROGRAMS = iscsid iscsiadm iscsistart - -+LIBMOUNT_LIB = -lmount -+ - # libc compat files - SYSDEPS_SRCS = $(sort $(wildcard ../utils/sysdeps/*.o)) - # sources shared between iscsid, iscsiadm and iscsistart -@@ -54,10 +56,10 @@ all: $(PROGRAMS) - - iscsid: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(DISCOVERY_SRCS) \ - iscsid.o session_mgmt.o discoveryd.o mntcheck.o -- $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -lisns-nocrypto -lrt -lmount -+ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -lisns-nocrypto -lrt $(LIBMOUNT_LIB) - - iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_SRCS) iscsiadm.o session_mgmt.o mntcheck.o -- $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -lisns-nocrypto -lmount -+ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ -lisns-nocrypto $(LIBMOUNT_LIB) - - iscsistart: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \ - iscsistart.o statics.o ---- a/usr/initiator_common.c -+++ b/usr/initiator_common.c -@@ -24,7 +24,9 @@ - #include <stdlib.h> - #include <errno.h> - #include <dirent.h> -+#ifndef NO_LIBMOUNT - #include <libmount/libmount.h> -+#endif - - #include "initiator.h" - #include "transport.h" ---- a/usr/mntcheck.c -+++ b/usr/mntcheck.c -@@ -22,7 +22,9 @@ - #include <stdlib.h> - #include <errno.h> - #include <dirent.h> -+#ifndef NO_LIBMOUNT - #include <libmount/libmount.h> -+#endif - - #include "initiator.h" - #include "transport.h" -@@ -37,6 +39,7 @@ - #include "iscsi_err.h" - #include "iscsi_net_util.h" - -+#ifndef NO_LIBMOUNT - static struct libmnt_table *mtab, *swaps; - static struct libmnt_cache *mntcache; - -@@ -66,6 +69,7 @@ static int libmount_init(void) - mnt_table_parse_swaps(swaps, NULL); - return 0; - } -+#endif - - static int trans_filter(const struct dirent *d) - { -@@ -97,6 +101,7 @@ static int is_partition(const char *path - - static int blockdev_check_mnts(char *syspath) - { -+#ifndef NO_LIBMOUNT - struct libmnt_fs *fs; - char *devname = NULL; - char *_devname = NULL; -@@ -123,6 +128,9 @@ out: - free(devname); - free(_devname); - return rc; -+#else -+ return 0; -+#endif - } - - static int count_device_users(char *syspath); -@@ -218,16 +226,20 @@ int session_in_use(int sid) - int host_no = -1, err = 0; - int count = 0; - -+#ifndef NO_LIBMOUNT - if (libmount_init()) { - log_error("Failed to initialize libmount, " - "not checking for active mounts on session [%d].", sid); - return 0; - } -+#endif - - host_no = iscsi_sysfs_get_host_no_from_sid(sid, &err); - if (!err) - iscsi_sysfs_for_each_device(&count, host_no, sid, device_in_use); - -+#ifndef NO_LIBMOUNT - libmount_cleanup(); -+#endif - return count; - }
  31. Download patch debian/patches/security/Ensure-all-fields-in-iscsiuio-IPC-response-are-set.patch

    --- 2.0.874-7.1/debian/patches/security/Ensure-all-fields-in-iscsiuio-IPC-response-are-set.patch 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/patches/security/Ensure-all-fields-in-iscsiuio-IPC-response-are-set.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -From be58eed849f5457bb49b79e94aa6a26971ba6deb Mon Sep 17 00:00:00 2001 -From: Lee Duncan <lduncan@suse.com> -Date: Fri, 15 Dec 2017 11:11:17 -0800 -Subject: [PATCH 3/8] Ensure all fields in iscsiuio IPC response are set - -Make sure all fields in the response strcuture are set, -or info from the stack can be leaked to our caller. -Found by Qualsys. ---- - iscsiuio/src/unix/iscsid_ipc.c | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/iscsiuio/src/unix/iscsid_ipc.c -+++ b/iscsiuio/src/unix/iscsid_ipc.c -@@ -960,6 +960,8 @@ int process_iscsid_broadcast(int s2) - LOG_DEBUG(PFX "recv iscsid request: cmd: %d, payload_len: %d", - cmd, payload_len); - -+ memset(&rsp, 0, sizeof(rsp)); -+ - switch (cmd) { - case ISCSID_UIP_IPC_GET_IFACE: - size = fread(&data->u.iface_rec, payload_len, 1, fd);
  32. Download patch debian/open-iscsi.lintian-overrides

    --- 2.0.874-7.1/debian/open-iscsi.lintian-overrides 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/open-iscsi.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -open-iscsi: non-standard-file-perm etc/iscsi/iscsid.conf 0600 != 0644 -open-iscsi: postinst-uses-db-input - -# See discussion in Bug #797860 -open-iscsi: too-long-extended-description-in-templates open-iscsi/remove_even_with_active_sessions
  33. Download patch debian/control

    --- 2.0.874-7.1/debian/control 2018-12-12 00:05:19.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/control 2020-08-19 19:08:47.000000000 +0000 @@ -1,67 +1,135 @@ Source: open-iscsi Section: net Priority: optional -Maintainer: Debian iSCSI Maintainers <open-iscsi@packages.debian.org> +Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> +XSBC-Original-Maintainer: Debian iSCSI Maintainers <open-iscsi@packages.debian.org> Uploaders: Ritesh Raj Sarraf <rrs@debian.org>, Christian Seiler <christian@iwakd.de> -Build-Depends: autotools-dev, - bison, +Build-Depends: bison, bzip2, - debhelper (>= 9), - dh-autoreconf, + debhelper (>= 10), dh-exec, - dh-systemd, - dpkg-dev (>= 1.16.1~), + dpkg-dev (>= 1.19), flex, - libisns-dev (>= 0.96-4~), + libisns-dev, libmount-dev, - po-debconf -Standards-Version: 3.9.8 + pkg-config, + libkmod-dev, + libsystemd-dev, + libssl-dev +Standards-Version: 4.5.0 Vcs-Git: https://salsa.debian.org/linux-blocks-team/open-iscsi.git Vcs-Browser: https://salsa.debian.org/linux-blocks-team/open-iscsi.git Homepage: http://www.open-iscsi.com/ Testsuite: autopkgtest +Rules-Requires-Root: no Package: open-iscsi Architecture: linux-any -Depends: udev, ${misc:Depends}, ${shlibs:Depends}, lsb-base (>= 3.0-6) -Recommends: ${busybox:Recommends} +Depends: ${misc:Depends}, + ${shlibs:Depends}, + libopeniscsiusr0.2.0, + udev +Recommends: ${busybox:Recommends}, finalrd (>= 3) Pre-Depends: debconf | debconf-2.0 Description: iSCSI initiator tools - Open-iSCSI is a high-performance, transport independent, multi-platform - implementation of the RFC3720 Internet Small Computer Systems Interface - (iSCSI). - . - Open-iSCSI is partitioned into user and kernel parts, where the kernel - portion implements the iSCSI data path (i.e. iSCSI Read and iSCSI Write). - The userspace contains the entire control plane: - * Configuration Manager; - * iSCSI Discovery; - * Login and Logout processing; - * Connection level error processing; - * Nop-In and Nop-Out handling; - * (in the future) Text processing, iSNS, SLP, Radius, etc. + The Open-iSCSI project is a high-performance, transport independent, + multi-platform implementation of RFC3720 iSCSI. + . + Open-iSCSI is partitioned into user and kernel parts. + . + The kernel portion of Open-iSCSI is a from-scratch code + licensed under GPL. The kernel part implements iSCSI data path + (that is, iSCSI Read and iSCSI Write), and consists of three + loadable modules: scsi_transport_iscsi.ko, libiscsi.ko and iscsi_tcp.ko. + . + User space contains the entire control plane: configuration + manager, iSCSI Discovery, Login and Logout processing, + connection-level error processing, Nop-In and Nop-Out handling, + and (in the future:) Text processing, iSNS, SLP, Radius, etc. + . + The user space Open-iSCSI consists of a daemon process called + iscsid, and a management utility iscsiadm. . This package includes a daemon, iscsid, and a management utility, iscsiadm. +Package: libopeniscsiusr0.2.0 +Architecture: linux-any +Depends: ${misc:Depends}, + ${shlibs:Depends} +Enhances: open-iscsi +Description: iSCSI userspace library + The Open-iSCSI project is a high-performance, transport independent, + multi-platform implementation of RFC3720 iSCSI. + . + Open-iSCSI is partitioned into user and kernel parts. + . + The kernel portion of Open-iSCSI is a from-scratch code + licensed under GPL. The kernel part implements iSCSI data path + (that is, iSCSI Read and iSCSI Write), and consists of three + loadable modules: scsi_transport_iscsi.ko, libiscsi.ko and iscsi_tcp.ko. + . + User space contains the entire control plane: configuration + manager, iSCSI Discovery, Login and Logout processing, + connection-level error processing, Nop-In and Nop-Out handling, + and (in the future:) Text processing, iSNS, SLP, Radius, etc. + . + The user space Open-iSCSI consists of a daemon process called + iscsid, and a management utility iscsiadm. + . + This package contains the iSCSI userspace library. + +Package: libopeniscsiusr-dev +Architecture: linux-any +Depends: ${misc:Depends}, + libopeniscsiusr0.2.0 (= ${binary:Version}) +Enhances: open-iscsi +Description: iSCSI userspace library headers + The Open-iSCSI project is a high-performance, transport independent, + multi-platform implementation of RFC3720 iSCSI. + . + Open-iSCSI is partitioned into user and kernel parts. + . + The kernel portion of Open-iSCSI is a from-scratch code + licensed under GPL. The kernel part implements iSCSI data path + (that is, iSCSI Read and iSCSI Write), and consists of three + loadable modules: scsi_transport_iscsi.ko, libiscsi.ko and iscsi_tcp.ko. + . + User space contains the entire control plane: configuration + manager, iSCSI Discovery, Login and Logout processing, + connection-level error processing, Nop-In and Nop-Out handling, + and (in the future:) Text processing, iSNS, SLP, Radius, etc. + . + The user space Open-iSCSI consists of a daemon process called + iscsid, and a management utility iscsiadm. + . + This package contains the iSCSI userspace library headers. + Package: iscsiuio Architecture: linux-any -Depends: udev, ${misc:Depends}, ${shlibs:Depends} +Depends: ${misc:Depends}, + ${shlibs:Depends}, + libopeniscsiusr0.2.0, + udev Enhances: open-iscsi Description: iSCSI offloading daemon for QLogic devices - Open-iSCSI is a high-performance, transport independent, multi-platform - implementation of the RFC3720 Internet Small Computer Systems Interface - (iSCSI). - . - This package contains the userspace offloading daemon, for use with - QLogic (formerly Broadcom) NetXtreme II hardware, as supported by the - 'bnx2' and 'bnx2x' drivers, in conjunction with the 'bnx2i' driver. - . - The following network controllers are supported: - bnx2: BCM5706, BCM5708, BCM5709 devices - bnx2x: BCM57710, BCM57711, BCM57711E, BCM57712, BCM57712E, BCM57800, - BCM57810, BCM57840 + The Open-iSCSI project is a high-performance, transport independent, + multi-platform implementation of RFC3720 iSCSI. + . + This tool is to be used in conjunction with the QLogic NetXtreme II Linux + driver (Kernel module name: 'bnx2' and 'bnx2x'), QLogic CNIC driver, + and the QLogic iSCSI driver (Kernel module name: 'bnx2i'). + . + This user space tool is used in conjunction with the following + QLogic Network Controllers: + bnx2: BCM5706, BCM5708, BCM5709 devices + bnx2x: BCM57710, BCM57711, BCM57711E, BCM57712, BCM57712E, + BCM57800, BCM57810, BCM57840 devices + . + This utility will provide the ARP and DHCP functionality for the iSCSI + offload. The communication to the driver is done via Userspace I/O (Kernel + module name 'uio'). . This package is required to offload iSCSI onto these devices. @@ -70,14 +138,16 @@ Package: open-iscsi-udeb # linux kernel udebs) must exist for these architectures - so # check that before adding them to this list; the other # scsi-(core|common|...)-modules are NOT sufficient! -Architecture: amd64 arm64 armhf i386 ia64 mips mipsel powerpc ppc64 ppc64el s390x +Architecture: amd64 arm64 armhf ia64 mips mipsel powerpc ppc64 ppc64el s390x Section: debian-installer Package-Type: udeb -Depends: scsi-modules, ${misc:Depends}, ${shlibs:Depends} +Depends: ${misc:Depends}, + ${shlibs:Depends}, + libopeniscsiusr0.2.0, + udev, + scsi-modules Description: Configure iSCSI - Open-iSCSI is a high-performance, transport independent, multi-platform - implementation of the RFC3720 Internet Small Computer Systems Interface - (iSCSI). + The Open-iSCSI project is a high-performance, transport independent, + multi-platform implementation of RFC3720 iSCSI. . This is the minimal package (udeb) used by debian-installer. -
  34. Download patch etc/systemd/iscsi.service

    --- 2.0.874-7.1/etc/systemd/iscsi.service 1970-01-01 00:00:00.000000000 +0000 +++ 2.1.1-1ubuntu2/etc/systemd/iscsi.service 2020-02-26 19:07:13.000000000 +0000 @@ -0,0 +1,18 @@ +[Unit] +Description=Login and scanning of iSCSI devices +Documentation=man:iscsiadm(8) man:iscsid(8) +Before=remote-fs.target +After=network.target network-online.target iscsid.service +Requires=iscsid.service +ConditionPathExists=/etc/iscsi/initiatorname.iscsi + +[Service] +Type=oneshot +ExecStart=/sbin/iscsiadm -m node --loginall=automatic +ExecStop=/sbin/iscsiadm -m node --logoutall=automatic +ExecStop=/sbin/iscsiadm -m node --logoutall=manual +SuccessExitStatus=21 +RemainAfterExit=true + +[Install] +WantedBy=remote-fs.target
  35. Download patch debian/open-iscsi.kmod

    --- 2.0.874-7.1/debian/open-iscsi.kmod 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/open-iscsi.kmod 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -iscsi_tcp -ib_iser
  36. Download patch debian/tests/patch-image
  37. Download patch debian/manpages

    --- 2.0.874-7.1/debian/manpages 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/manpages 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -doc/iscsi-iname.8 -doc/iscsi_discovery.8 -doc/iscsiadm.8 -doc/iscsid.8 -doc/iscsistart.8
  38. Download patch debian/extra/initramfs.local-top

    --- 2.0.874-7.1/debian/extra/initramfs.local-top 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/extra/initramfs.local-top 2020-08-18 22:34:49.000000000 +0000 @@ -93,6 +93,7 @@ do_iscsi_login () . /scripts/functions udevadm settle + IBFT_DHCP_DEVICE="" if [ -n "$ISCSI_AUTO" ] ; then # try to auto-configure network interface based @@ -136,7 +137,13 @@ do_iscsi_login () echo "UPTIME='${UPTIME}'" echo "DHCPLEASETIME='${DHCPLEASETIME}'" echo "DOMAINSEARCH=''" - } > "/run/net-${DEVICE}.conf" + } > "/run/net-${DEVICE}.conf.ibft" + if [ "$PROTO" != "dhcp" -a "$DHCPLEASETIME" = "0" ]; then + # this is static ibft configuration. + mv "/run/net-${DEVICE}.conf.ibft" "/run/net-${DEVICE}.conf" + else + IBFT_DHCP_DEVICE="$DEVICE" + fi echo "${DEVICE}" > /run/initramfs/open-iscsi.interface # iscsistart -N doesn't set the default gateway. Therefore, # we need to add it ourselves. However, the ip command is @@ -172,9 +179,23 @@ do_iscsi_login () # run configure_networking even if we have iscsi_auto, because there # could be other network interfaces that need to be configured - # manually + # also, if we set up DHCP iBFT, we need ipconfig to run so it creates + # a proper /run/net-${DEVICE}.conf file that includes the DNS search + # domain, which we don't get in our iBFT data (see LP: #1806777) configure_networking + if [ -n "$IBFT_DHCP_DEVICE" ]; then + if ! [ -e "/run/net-${DEVICE}.conf" ] ; then + echo "WARN: ipconfig dhcp failed, using iSCSI iBFT config - DNS search domain may be missing at runtime" >&2 + # We have DHCP iBFT, but ipconfig DHCP failed; + # so we should fallback to just using the iBFT config, + # though that will not include the DNS search domain + mv "/run/net-${DEVICE}.conf.ibft" "/run/net-${DEVICE}.conf" + # need to re-run configure_networking to process conf file + configure_networking + fi + fi + # Save network device we configured via configure_networking, but only # if we didn't already get one from autoconfiguration (then we always # prefer that). @@ -186,6 +207,13 @@ do_iscsi_login () fi if [ -n "${DEVICE}" ] ; then echo "${DEVICE}" > /run/initramfs/open-iscsi.interface + else + for i in /run/net6-*.conf; do + [ -e "${i}" ] && { . "${i}" ; break ; } + done + fi + if [ -z "${DEVICE}" ] && [ -n "${DEVICE6}" ] ; then + echo "${DEVICE6}" > /run/initramfs/open-iscsi.interface fi fi
  39. Download patch debian/patches/debian/var-run-lock.patch

    --- 2.0.874-7.1/debian/patches/debian/var-run-lock.patch 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/patches/debian/var-run-lock.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -Description: Move from /var/lock and /var/run to /run/lock and /run -Author: Stéphane Graber <stgraber@ubuntu.com> - ---- a/doc/iscsid.8 -+++ b/doc/iscsid.8 -@@ -40,7 +40,7 @@ do not write a process ID file. - .TP - .BI [-p|--pid=]\fIpid\-file\fP - write process ID to \fIpid\-file\fR rather than the default --\fI/var/run/iscsid.pid\fR -+\fI/run/iscsid.pid\fR - .TP - .BI [-h|--help] - display this help and exit ---- a/usr/initiator.h -+++ b/usr/initiator.h -@@ -38,9 +38,9 @@ - #define CONFIG_FILE ISCSI_CONFIG_ROOT"iscsid.conf" - #define INITIATOR_NAME_FILE ISCSI_CONFIG_ROOT"initiatorname.iscsi" - --#define PID_FILE "/var/run/iscsid.pid" -+#define PID_FILE "/run/iscsid.pid" - #ifndef LOCK_DIR --#define LOCK_DIR "/var/lock/iscsi" -+#define LOCK_DIR "/run/lock/iscsi" - #endif - #define LOCK_FILE LOCK_DIR"/lock" - #define LOCK_WRITE_FILE LOCK_DIR"/lock.write" ---- a/iscsiuio/src/unix/main.c -+++ b/iscsiuio/src/unix/main.c -@@ -76,7 +76,7 @@ - ******************************************************************************/ - #define PFX "main " - --static const char default_pid_filepath[] = "/var/run/iscsiuio.pid"; -+static const char default_pid_filepath[] = "/run/iscsiuio.pid"; - - /******************************************************************************* - * Global Variables
  40. Download patch debian/patches/bugfixes/fix_iscsiuio_long_options.patch

    --- 2.0.874-7.1/debian/patches/bugfixes/fix_iscsiuio_long_options.patch 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/patches/bugfixes/fix_iscsiuio_long_options.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -Description: Fix iscsiuio long options -Author: Andrew Patterson <andrew.patterson@hpe.com> -Bug: https://groups.google.com/forum/?_escaped_fragment_=msg/open-iscsi/PsT65Z4$ -Bug-Debian: https://bugs.debian.org/850057 -Last-Update: 2017-01-24 ---- -This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ ---- a/iscsiuio/src/unix/main.c -+++ b/iscsiuio/src/unix/main.c -@@ -82,10 +82,12 @@ - * Global Variables - ******************************************************************************/ - static const struct option long_options[] = { -- {"debug", 0, 0, 0}, -- {"version", 0, 0, 0}, -- {"help", 0, 0, 0}, -- {0, 0, 0, 0} -+ {"foreground", no_argument, NULL, 'f'}, -+ {"debug", required_argument, NULL, 'd'}, -+ {"pid", required_argument, NULL, 'p'}, -+ {"version", no_argument, NULL, 'v'}, -+ {"help", no_argument, NULL, 'h'}, -+ {NULL, no_argument, NULL, 0} - }; - - struct options opt = { -@@ -172,7 +174,7 @@ - printf("iscsiuio daemon.\n" - "-f, --foreground make the program run in the foreground\n" - "-d, --debug debuglevel print debugging information\n" -- "-p, --pid=pidfile use pid file (default %s).\n" -+ "-p, --pid pidfile use pid file (default %s).\n" - "-h, --help display this help and exit\n" - "-v, --version display version and exit\n", - default_pid_filepath); ---- a/iscsiuio/docs/iscsiuio.8 -+++ b/iscsiuio/docs/iscsiuio.8 -@@ -45,7 +45,7 @@ - .SH PARAMETERS - There are very few parameters when running this application. - .TP --.BI -d <debug level> -+.BI -d|--debug <debug level> - This is to enable debug mode where debug messages will be sent to stdout - The following debug modes are supported - .P -@@ -61,20 +61,20 @@ - .PP - .TP - .TP --.BI -f -+.BI -f|--foreground - This is to enable foreground mode so that this application doesn't get sent - into the background. - .PP - .TP --.BI -v -+.BI -v|--version - This is to print the version. - .PP - .TP --.BI -p <pidfile> -+.BI -p|--pid <pidfile> - Use pidfile (default /var/run/iscsiuio.pid ) - .PP - .TP --.BI -h -+.BI -h|--help - Display this help and exit. - -
  41. Download patch iscsiuio/src/unix/libs/cnic.c

    --- 2.0.874-7.1/iscsiuio/src/unix/libs/cnic.c 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/iscsiuio/src/unix/libs/cnic.c 2020-02-26 19:07:13.000000000 +0000 @@ -55,6 +55,7 @@ #include <sys/types.h> #include <sys/user.h> #include <sys/socket.h> +#include <sys/mman.h> #include "uip_arp.h" #include "nic.h" @@ -65,15 +66,13 @@ #include "cnic.h" #include "iscsi_if.h" #include "ipv6_ndpc.h" +#include "qedi.h" /******************************************************************************* * Constants ******************************************************************************/ #define PFX "CNIC " -static const uip_ip6addr_t all_ones_addr6 = { - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }; - /******************************************************************************* * Constants shared between the bnx2 and bnx2x modules ******************************************************************************/ @@ -81,6 +80,13 @@ const char bnx2i_library_transport_name[ const size_t bnx2i_library_transport_name_size = sizeof(bnx2i_library_transport_name); +/******************************************************************************* + * Constants for qedi module + ******************************************************************************/ +const char qedi_library_transport_name[] = "qedi"; +const size_t qedi_library_transport_name_size = + sizeof(qedi_library_transport_name); + /****************************************************************************** * Netlink Functions ******************************************************************************/ @@ -97,6 +103,8 @@ static int cnic_arp_send(nic_t *nic, nic static const uint8_t multicast_mac[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; + LOG_DEBUG(PFX "%s: host:%d - try getting xmit mutex cnic arp send", + nic->log_name, nic->host_no); rc = pthread_mutex_trylock(&nic->xmit_mutex); if (rc != 0) { LOG_DEBUG(PFX "%s: could not get xmit_mutex", nic->log_name); @@ -106,6 +114,7 @@ static int cnic_arp_send(nic_t *nic, nic eth = (*nic->ops->get_tx_pkt) (nic); if (eth == NULL) { LOG_WARN(PFX "%s: couldn't get tx packet", nic->log_name); + pthread_mutex_unlock(&nic->xmit_mutex); return -EAGAIN; } @@ -132,6 +141,7 @@ static int cnic_arp_send(nic_t *nic, nic memcpy(&addr.s_addr, &dst_ip, sizeof(addr.s_addr)); LOG_DEBUG(PFX "%s: Sent cnic arp request for IP: %s", nic->log_name, addr_str); + pthread_mutex_unlock(&nic->xmit_mutex); return 0; } @@ -195,6 +205,8 @@ static int cnic_neigh_soliciation_send(n LOG_DEBUG(PFX "%s: Sent cnic ICMPv6 neighbor request %s", nic->log_name, addr_str); + pthread_mutex_unlock(&nic->xmit_mutex); + return 0; } @@ -350,9 +362,8 @@ int cnic_handle_ipv4_iscsi_path_req(nic_ &nic_iface->ustack.default_route_addr, sizeof(dst_addr)); } else { - arp_retry = MAX_ARP_RETRY; - LOG_DEBUG(PFX "%s: no default", nic->log_name); - goto done; + LOG_DEBUG(PFX "%s: no default route address", + nic->log_name); } } arp_retry = 0; @@ -424,9 +435,6 @@ done: rc = -EIO; } - if (status != 0 || rc != 0) - pthread_mutex_unlock(&nic->xmit_mutex); - if (ev) { cnic_nl_neigh_rsp(nic, fd, ev, path, mac_addr, nic_iface, status, AF_INET); @@ -623,9 +631,6 @@ done: rc = -EIO; } - if (status != 0 || rc != 0) - pthread_mutex_unlock(&nic->xmit_mutex); - if (ev) { cnic_nl_neigh_rsp(nic, fd, ev, path, mac_addr, nic_iface, status, AF_INET6);
  42. Download patch include/iscsi_proto.h

    --- 2.0.874-7.1/include/iscsi_proto.h 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/include/iscsi_proto.h 2020-02-26 19:07:13.000000000 +0000 @@ -45,6 +45,7 @@ } #define zero_data(p) {p[0]=0;p[1]=0;p[2]=0;} +#if !defined(__bitwise) /* * If running svn modules we may need to define these. * This should not go upstream since this is already properly defined there @@ -59,6 +60,7 @@ #else #define __bitwise #endif +#endif /* initiator tags; opaque for target */ typedef uint32_t __bitwise__ itt_t;
  43. Download patch debian/patches/debian/dont-link-against-openssl.patch
  44. Download patch debian/iscsi-network-interface.rules

    --- 2.0.874-7.1/debian/iscsi-network-interface.rules 1970-01-01 00:00:00.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/iscsi-network-interface.rules 2020-08-18 22:34:49.000000000 +0000 @@ -0,0 +1,3 @@ +# run before 80-networking.rules to run before ifupdown +SUBSYSTEM=="net", ACTION=="add", RUN+="/lib/open-iscsi/net-interface-handler start" +SUBSYSTEM=="net", ACTION=="remove", RUN+="/lib/open-iscsi/net-interface-handler stop"
  45. Download patch .gitignore

    --- 2.0.874-7.1/.gitignore 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/.gitignore 2020-02-26 19:07:13.000000000 +0000 @@ -1 +1,14 @@ *.o +cscope.files +cscope.out +TAGS +tags +*.swp +*.so +*.so.* +libopeniscsiusr/docs/man/ +# ^ This folder is used for kernel-doc generated manpages. +libopeniscsiusr/tests/test_context +libopeniscsiusr/tests/test_session +libopeniscsiusr/tests/test_iface +libopeniscsiusr/tests/test_node
  46. Download patch iscsiuio/docs/iscsiuio.8

    --- 2.0.874-7.1/iscsiuio/docs/iscsiuio.8 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/iscsiuio/docs/iscsiuio.8 2020-02-26 19:07:13.000000000 +0000 @@ -45,7 +45,7 @@ on how to configure network protocol and .SH PARAMETERS There are very few parameters when running this application. .TP -.BI -d <debug level> +.BI -d|--debug <debug level> This is to enable debug mode where debug messages will be sent to stdout The following debug modes are supported .P @@ -61,20 +61,20 @@ ERROR 1 - Only print critical er .PP .TP .TP -.BI -f +.BI -f|--foreground This is to enable foreground mode so that this application doesn't get sent into the background. .PP .TP -.BI -v +.BI -v|--version This is to print the version. .PP .TP -.BI -p <pidfile> -Use pidfile (default /var/run/iscsiuio.pid ) +.BI -p|--pid <pidfile> +Use pidfile (default /run/iscsiuio.pid ) .PP .TP -.BI -h +.BI -h|--help Display this help and exit.
  47. Download patch iscsiuio/src/unix/libs/cnic.h

    --- 2.0.874-7.1/iscsiuio/src/unix/libs/cnic.h 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/iscsiuio/src/unix/libs/cnic.h 2020-02-26 19:07:13.000000000 +0000 @@ -44,6 +44,8 @@ ******************************************************************************/ extern const char bnx2i_library_transport_name[]; extern const size_t bnx2i_library_transport_name_size; +extern const char qedi_library_transport_name[]; +extern const size_t qedi_library_transport_name_size; int cnic_nl_open(); void cnic_nl_close();
  48. Download patch iscsiuio/configure.ac

    --- 2.0.874-7.1/iscsiuio/configure.ac 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/iscsiuio/configure.ac 2020-02-26 19:07:13.000000000 +0000 @@ -12,9 +12,9 @@ dnl Benjamin Li (benli@broa dnl PACKAGE=iscsiuio -VERSION=0.7.8.2 +VERSION=0.7.8.6 -AC_INIT([iscsiuio], [0.7.8.2], [QLogic-Storage-Upstream@qlogic.com]) +AC_INIT([iscsiuio], [0.7.8.6], [QLogic-Storage-Upstream@cavium.com]) AM_INIT_AUTOMAKE AC_CONFIG_HEADER(config.h) @@ -63,6 +63,14 @@ AC_ARG_ENABLE(debug, CFLAGS="${CFLAGS} -g -O0" fi]) AM_CONDITIONAL([DEBUG], [test x$debug = xtrue]) +## check for systemd support, default on +AC_ARG_WITH([systemd], + AS_HELP_STRING([--without-systemd], [Build without systemd]), + [case "${withval}" in + yes) LDFLAGS="`pkg-config --libs libsystemd`" ;; + no) CFLAGS="${CFLAGS} -DNO_SYSTEMD" ;; + *) AC_MSG_ERROR([bad value $withval for --with-systemd]) ;; + esac],[LDFLAGS="`pkg-config --libs libsystemd`"]) AC_CONFIG_COMMANDS([default],[[ if [ -n "$SOURCE_DATE_EPOCH" ] ; then @@ -70,7 +78,7 @@ AC_CONFIG_COMMANDS([default],[[ else echo 'char *build_date = "'`date`'";' > src/unix/build_date.c fi - echo 'char *build_date;'> src/unix/build_date.h + echo 'extern char *build_date;'> src/unix/build_date.h ]],[[]]) AC_PREFIX_DEFAULT()
  49. Download patch iscsiuio/src/uip/ipv6.c

    --- 2.0.874-7.1/iscsiuio/src/uip/ipv6.c 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/iscsiuio/src/uip/ipv6.c 2020-02-26 19:07:13.000000000 +0000 @@ -49,7 +49,7 @@ #include "dhcpv6.h" #include "ping.h" -inline int best_match_bufcmp(u8_t *a, u8_t *b, int len) +static inline int best_match_bufcmp(u8_t *a, u8_t *b, int len) { int i;
  50. Download patch debian/open-iscsi.install

    --- 2.0.874-7.1/debian/open-iscsi.install 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/open-iscsi.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -#!/usr/bin/dh-exec -usr/iscsiadm /sbin -build.deb/iscsid /sbin -build.deb/iscsistart /sbin -utils/iscsi_discovery /sbin -utils/iscsi-iname /sbin -etc/iscsid.conf /etc/iscsi -debian/extra/initramfs.hook => /usr/share/initramfs-tools/hooks/iscsi -debian/extra/initramfs.local-top => /usr/share/initramfs-tools/scripts/local-top/iscsi -debian/extra/initramfs.local-bottom => /usr/share/initramfs-tools/scripts/local-bottom/iscsi -debian/extra/umountiscsi.sh /lib/open-iscsi -debian/extra/logout-all.sh /lib/open-iscsi -debian/extra/startup-checks.sh /lib/open-iscsi -debian/extra/activate-storage.sh /lib/open-iscsi -debian/open-iscsi.kmod => /lib/modules-load.d/open-iscsi.conf
  51. Download patch debian/patches/bugfixes/move_offload_discovery_to_fw_get_targets.patch

    --- 2.0.874-7.1/debian/patches/bugfixes/move_offload_discovery_to_fw_get_targets.patch 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/patches/bugfixes/move_offload_discovery_to_fw_get_targets.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,91 +0,0 @@ -Description: Move iscsistart offload discovery/setup to fw_get_targets() -Author: Andrew Patterson <andrew.patterson@hpe.com> -Bug: https://groups.google.com/forum/?_escaped_fragment_=msg/open-iscsi/PsT65Z4$ -Bug-Debian: https://bugs.debian.org/850057 -Last-Update: 2017-01-24 ---- -This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ ---- a/utils/fwparam_ibft/fw_entry.c -+++ b/utils/fwparam_ibft/fw_entry.c -@@ -64,26 +64,40 @@ - * For each target in iBFT bring up required NIC and use routing - * to force iSCSI traffic through correct NIC - */ -- list_for_each_entry(context, &targets, list) { -- /* if it is a offload nic ignore it */ -- if (!net_get_transport_name_from_netdev(context->iface, -- transport)) -- continue; -- -+ list_for_each_entry(context, &targets, list) { - if (iface_prev == NULL || strcmp(context->iface, iface_prev)) { -- /* Note: test above works because there is a -- * maximum of two targets in the iBFT -- */ -- iface_prev = context->iface; -- needs_bringup = 1; -+ /* Note: test above works because there is a -+ * maximum of two targets in the iBFT -+ */ -+ iface_prev = context->iface; -+ needs_bringup = 1; - } -+ if (net_get_transport_name_from_netdev(context->iface, transport)) { -+ /* Setup software NIC, */ -+ printf("Setting up software interface %s\n", context->iface); -+ err = net_setup_netdev(context->iface, context->ipaddr, -+ context->mask, context->gateway, -+ context->vlan, -+ context->target_ipaddr, needs_bringup); -+ if (err) { -+ printf("Setting up software interface %s failed\n", -+ context->iface); -+ ret = err; -+ } -+ } else { -+ /* Setup offload NIC. */ -+ struct iface_rec iface; -+ -+ memset(&iface, 0, sizeof(iface)); -+ iface_setup_defaults(&iface); -+ printf("Setting up offload interface %s\n", context->iface); -+ if (!iface_setup_from_boot_context(&iface, context)) { -+ printf("Setting up offload interface %s failed\n", -+ context->iface); - -- err = net_setup_netdev(context->iface, context->ipaddr, -- context->mask, context->gateway, -- context->vlan, -- context->target_ipaddr, needs_bringup); -- if (err) -- ret = err; -+ ret = ISCSI_ERR; -+ } -+ } - } - - fw_free_targets(&targets); -@@ -147,11 +161,7 @@ - - static void dump_initiator(struct boot_context *context) - { -- struct iface_rec iface; -- -- memset(&iface, 0, sizeof(iface)); -- iface_setup_defaults(&iface); -- iface_setup_from_boot_context(&iface, context); -+ char transport_name[ISCSI_TRANSPORT_NAME_MAXLEN]; - - if (strlen(context->initiatorname)) - printf("%s = %s\n", IFACE_INAME, context->initiatorname); -@@ -159,7 +169,9 @@ - if (strlen(context->isid)) - printf("%s = %s\n", IFACE_ISID, context->isid); - -- printf("%s = %s\n", IFACE_TRANSPORTNAME, iface.transport_name); -+ memset(transport_name, 0, ISCSI_TRANSPORT_NAME_MAXLEN); -+ if (!net_get_transport_name_from_netdev(context->iface, transport_name)) -+ printf("%s = %s\n", IFACE_TRANSPORTNAME, transport_name); - } - - static void dump_target(struct boot_context *context)
  52. Download patch debian/iscsiuio.install

    --- 2.0.874-7.1/debian/iscsiuio.install 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/iscsiuio.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -#!/usr/bin/dh-exec -iscsiuio/src/unix/iscsiuio /sbin -debian/extra/iscsiuio.initramfs.hook => /usr/share/initramfs-tools/hooks/iscsiuio
  53. Download patch iscsiuio/src/unix/iscsid_ipc.c
  54. Download patch iscsiuio/src/unix/.gitignore

    --- 2.0.874-7.1/iscsiuio/src/unix/.gitignore 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/iscsiuio/src/unix/.gitignore 2020-02-26 19:07:13.000000000 +0000 @@ -1,2 +1,3 @@ build_date.c build_date.h +iscsiuio
  55. Download patch include/iscsi_if.h

    --- 2.0.874-7.1/include/iscsi_if.h 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/include/iscsi_if.h 2020-02-26 19:07:13.000000000 +0000 @@ -30,6 +30,12 @@ #include "iscsi_proto.h" +/* + * NOTE: This file should be kept in sync with the kernel include file + * of the same name. In particular, iscsi_param and iscsi_err need + * to be in sync. + */ + #define ISCSI_NL_GRP_ISCSID 1 #define ISCSI_NL_GRP_UIP 2 @@ -341,7 +347,7 @@ struct iscsi_iface_param_info { uint8_t iface_type; /* IPv4 or IPv6 */ uint8_t param_type; /* iscsi_param_type */ uint8_t value[0]; /* length sized value follows */ -} __packed; +} __attribute__((__packed__)); /* * To keep the struct iscsi_uevent size the same for userspace code @@ -536,6 +542,7 @@ enum iscsi_err { ISCSI_ERR_XMIT_FAILED = ISCSI_ERR_BASE + 19, ISCSI_ERR_TCP_CONN_CLOSE = ISCSI_ERR_BASE + 20, ISCSI_ERR_SCSI_EH_SESSION_RST = ISCSI_ERR_BASE + 21, + ISCSI_ERR_NOP_TIMEDOUT = ISCSI_ERR_BASE + 22, }; /* @@ -627,6 +634,7 @@ enum iscsi_param { ISCSI_PARAM_DISCOVERY_PARENT_IDX, ISCSI_PARAM_DISCOVERY_PARENT_TYPE, + ISCSI_PARAM_LOCAL_IPADDR, /* must always be last */ ISCSI_PARAM_MAX, }; @@ -731,6 +739,8 @@ enum iscsi_port_speed { ISCSI_PORT_SPEED_100MBPS = 0x4, ISCSI_PORT_SPEED_1GBPS = 0x8, ISCSI_PORT_SPEED_10GBPS = 0x10, + ISCSI_PORT_SPEED_25GBPS = 0x20, + ISCSI_PORT_SPEED_40GBPS = 0x40, }; /* iSCSI port state */
  56. Download patch debian/tests/testsuite

    --- 2.0.874-7.1/debian/tests/testsuite 1970-01-01 00:00:00.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/tests/testsuite 2020-08-18 22:34:49.000000000 +0000 @@ -0,0 +1,7 @@ +#!/bin/bash +#------------------- +# Testing open-iscsi +#------------------- +set -e +python2 `dirname $0`/test-open-iscsi.py 2>&1 +
  57. Download patch debian/extra/initramfs.hook

    --- 2.0.874-7.1/debian/extra/initramfs.hook 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/extra/initramfs.hook 2020-08-18 22:34:49.000000000 +0000 @@ -32,7 +32,7 @@ if [ -r /etc/iscsi/iscsi.initramfs ] ; t cp /etc/iscsi/iscsi.initramfs $DESTDIR/etc fi -for x in crc32c libcrc32c iscsi_tcp libiscsi scsi_transport_iscsi iscsi_ibft; do +for x in crc32c libcrc32c ib_iser iscsi_tcp libiscsi scsi_transport_iscsi iscsi_ibft; do manual_add_modules ${x} done for x in cxgb3i cxgb4i; do
  58. Download patch include/iscsi_err.h

    --- 2.0.874-7.1/include/iscsi_err.h 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/include/iscsi_err.h 2020-02-26 19:07:13.000000000 +0000 @@ -4,7 +4,7 @@ #ifndef _ISCSI_ERR_ #define _ISCSI_ERR_ -enum { +enum iscsi_error_list { ISCSI_SUCCESS = 0, /* Generic error */ ISCSI_ERR = 1, @@ -68,10 +68,14 @@ enum { ISCSI_ERR_UNKNOWN_DISCOVERY_TYPE = 30, /* child process terminated */ ISCSI_ERR_CHILD_TERMINATED = 31, + /* session likely not connected */ + ISCSI_ERR_SESSION_NOT_CONNECTED = 32, /* Always last. Indicates end of error code space */ ISCSI_MAX_ERR_VAL, -} iscsi_err; +}; + +extern enum iscsi_error_list iscsi_err; extern void iscsi_err_print_msg(int err); extern char *iscsi_err_to_str(int err);
  59. Download patch doc/iscsi_fw_login.8

    --- 2.0.874-7.1/doc/iscsi_fw_login.8 1970-01-01 00:00:00.000000000 +0000 +++ 2.1.1-1ubuntu2/doc/iscsi_fw_login.8 2020-02-26 19:07:13.000000000 +0000 @@ -0,0 +1,16 @@ +.TH "iscsi_fw_login" 8 +.SH NAME +iscsi_fw_login \- Login to all iSCSI Firmware targets +.SH SYNOPSIS +.B iscsi_fw_login +.SH DESCRIPTION +This helper function logs into all known iSCSI firmware targets. +.P +It is meant as a helper function to be called by udev when new +firmware targets are detected asynchronously. +.SH AUTHOR +Written by Lee Duncan +.SH "REPORTING BUGS" +Report bugs to <lduncan@suse.com>. +.SH COPYRIGHT +Copyright \(co 2015 Lee Duncan <lduncan@suse.com>
  60. Download patch debian/open-iscsi.finalrd

    --- 2.0.874-7.1/debian/open-iscsi.finalrd 1970-01-01 00:00:00.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/open-iscsi.finalrd 2020-08-17 14:13:01.000000000 +0000 @@ -0,0 +1,40 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-3.0-only + +set -e + +if [ "$1" = "setup" ] +then + . /usr/share/initramfs-tools/hook-functions + copy_exec /bin/grep + copy_exec /bin/sleep + copy_exec /sbin/iscsiadm + copy_exec /sbin/iscsid + # hm, not sure why expr is copied + copy_exec /usr/bin/expr + copy_file config /etc/iscsi/iscsid.conf + copy_file config /etc/iscsi/initiatorname.iscsi + exit 0 +fi + +# re-establish connection and logout during shutdown +# if initramfs did bring up open-iscsi on boot +[ -f /open-iscsi.interface ] || exit 0 + +iscsid + +# After restarting iscsid, wait for an active connection. +# Limit the wait time in case of unexpected failure of iscsid. +MAX_RETRIES=30 +RETRY=0 +while ! iscsiadm -m session -P 1 | grep -q "iSCSI Connection State: LOGGED IN"; do + RETRY=$(($RETRY + 1)) + if [ $RETRY -gt $MAX_RETRIES ]; then + echo "Unexpected iSCSI Connection State, forcing iSCSI logout." + break + fi + sleep 1 +done + +# Issue an iSCSI logout. +iscsiadm -m node -u
  61. Download patch COPYING

    --- 2.0.874-7.1/COPYING 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/COPYING 2020-02-26 19:07:13.000000000 +0000 @@ -1,12 +1,12 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - Preamble + Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public @@ -15,7 +15,7 @@ software--to make sure the software is f General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to +the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not @@ -55,8 +55,8 @@ patent must be licensed for everyone's f The precise terms and conditions for copying, distribution and modification follow. - - GNU GENERAL PUBLIC LICENSE + + GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains @@ -110,7 +110,7 @@ above, provided that you also meet all o License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) - + These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in @@ -168,7 +168,7 @@ access to copy from a designated place, access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. - + 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is @@ -225,7 +225,7 @@ impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - + 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License @@ -255,7 +255,7 @@ make exceptions for this. Our decision of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY + NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN @@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it @@ -303,10 +303,9 @@ the "copyright" line and a pointer to wh MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. @@ -336,5 +335,5 @@ necessary. Here is a sample; alter the This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General +library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.
  62. Download patch debian/tests/testlib.py
  63. Download patch debian/patches/series

    --- 2.0.874-7.1/debian/patches/series 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/patches/series 2020-08-18 22:36:51.000000000 +0000 @@ -1,15 +1,2 @@ -bugfixes/no-make-clean-kernel.patch -debian/var-run-lock.patch -debian/dont-link-against-openssl.patch -debian/udeb-without-libmount.patch -bugfixes/need_iscsiuio_for_hardware_offload.patch -bugfixes/move_offload_discovery_to_fw_get_targets.patch -bugfixes/fix_iscsiuio_long_options.patch -security/Check-for-root-peer-user-for-iscsiuio-IPC.patch -security/iscsiuio-should-ignore-bogus-iscsid-broadcast-packet.patch -security/Ensure-all-fields-in-iscsiuio-IPC-response-are-set.patch -security/Do-not-double-close-IPC-file-stream-to-iscsid.patch -security/Ensure-strings-from-peer-are-copied-correctly.patch -security/Skip-useless-strcopy-and-validate-CIDR-length.patch -security/Check-iscsiuio-ping-data-length-for-validity.patch -include-sys-sysmacros.h-to-properly-define-minor.patch +adapt-chap-auth-algorithms-to-debian.patch +lp1755858-default-iscsid_conf-to-iscsid_socket.patch
  64. Download patch debian/tests/tgt-boot-test
  65. Download patch debian/patches/include-sys-sysmacros.h-to-properly-define-minor.patch

    --- 2.0.874-7.1/debian/patches/include-sys-sysmacros.h-to-properly-define-minor.patch 2018-12-12 00:05:19.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/patches/include-sys-sysmacros.h-to-properly-define-minor.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -Description: Include <sys/sysmacros.h> to properly define minor() -Origin: upstream, https://github.com/open-iscsi/open-iscsi/commit/6d68ef5871c94c6ebbbe6e6b1fe0bc2dce711052 - -Index: open-iscsi/iscsiuio/src/unix/libs/bnx2x.c -=================================================================== ---- open-iscsi.orig/iscsiuio/src/unix/libs/bnx2x.c -+++ open-iscsi/iscsiuio/src/unix/libs/bnx2x.c -@@ -50,6 +50,7 @@ - #include <sys/user.h> - #include <fcntl.h> - #include <unistd.h> -+#include <sys/sysmacros.h> - - #include "config.h" - -Index: open-iscsi/iscsiuio/src/unix/libs/bnx2.c -=================================================================== ---- open-iscsi.orig/iscsiuio/src/unix/libs/bnx2.c -+++ open-iscsi/iscsiuio/src/unix/libs/bnx2.c -@@ -46,6 +46,7 @@ - #include <sys/user.h> - #include <fcntl.h> - #include <unistd.h> -+#include <sys/sysmacros.h> - - #include "config.h" -
  66. Download patch iscsiuio/src/apps/dhcpc/dhcpv6.c

    --- 2.0.874-7.1/iscsiuio/src/apps/dhcpc/dhcpv6.c 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/iscsiuio/src/apps/dhcpc/dhcpv6.c 2020-02-26 19:07:13.000000000 +0000 @@ -153,7 +153,7 @@ static u16_t dhcpv6_init_packet(struct d if (dhcpv6->dhcpv6_type != type) context->dhcpv6_transaction_id++; - dhcpv6->dhcpv6_trans_id = context->dhcpv6_transaction_id; + dhcpv6->dhcpv6_trans_id = HOST_TO_NET16(context->dhcpv6_transaction_id); dhcpv6->dhcpv6_type = type; /* Keep track of length of all DHCP options. */ @@ -265,8 +265,13 @@ void ipv6_udp_handle_dhcp(struct dhcpv6_ dhcpv6 = (union dhcpv6_hdr *)((u8_t *)context->udp + sizeof(struct udp_hdr)); - if (dhcpv6->dhcpv6_trans_id != context->dhcpv6_transaction_id) + if (dhcpv6->dhcpv6_trans_id != + HOST_TO_NET16(context->dhcpv6_transaction_id)) { + LOG_ERR("DHCPv6 transaction-id error, sent %x, received %x", + HOST_TO_NET16(context->dhcpv6_transaction_id), + dhcpv6->dhcpv6_trans_id); return; + } dhcpv6_len = NET_TO_HOST16(context->udp->length) - sizeof(struct udp_hdr);
  67. Download patch etc/systemd/iscsid.socket

    --- 2.0.874-7.1/etc/systemd/iscsid.socket 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/etc/systemd/iscsid.socket 2020-02-26 19:07:13.000000000 +0000 @@ -1,6 +1,6 @@ [Unit] Description=Open-iSCSI iscsid Socket -Documentation=man:iscsid(8) man:iscsiuio(8) man:iscsiadm(8) +Documentation=man:iscsid(8) man:iscsiadm(8) [Socket] ListenStream=@ISCSIADM_ABSTRACT_NAMESPACE
  68. Download patch debian/patches/security/Check-iscsiuio-ping-data-length-for-validity.patch

    --- 2.0.874-7.1/debian/patches/security/Check-iscsiuio-ping-data-length-for-validity.patch 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/patches/security/Check-iscsiuio-ping-data-length-for-validity.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -From 59ede2cf4eee8729a4221000a5d1ecdd312a31ac Mon Sep 17 00:00:00 2001 -From: Lee Duncan <lduncan@suse.com> -Date: Fri, 15 Dec 2017 11:21:15 -0800 -Subject: [PATCH 7/8] Check iscsiuio ping data length for validity - -We do not trust that the received ping packet data length -is correct, so sanity check it. Found by Qualsys. ---- - iscsiuio/src/unix/iscsid_ipc.c | 5 +++++ - iscsiuio/src/unix/packet.c | 2 +- - iscsiuio/src/unix/packet.h | 2 ++ - 3 files changed, 8 insertions(+), 1 deletion(-) - ---- a/iscsiuio/src/unix/iscsid_ipc.c -+++ b/iscsiuio/src/unix/iscsid_ipc.c -@@ -333,6 +333,11 @@ static void *perform_ping(void *arg) - - data = (iscsid_uip_broadcast_t *)png_c->data; - datalen = data->u.ping_rec.datalen; -+ if ((datalen > STD_MTU_SIZE) || (datalen < 0)) { -+ LOG_ERR(PFX "Ping datalen invalid: %d", datalen); -+ rc = -EINVAL; -+ goto ping_done; -+ } - - memset(dst_addr, 0, sizeof(uip_ip6addr_t)); - if (nic_iface->protocol == AF_INET) { ---- a/iscsiuio/src/unix/packet.c -+++ b/iscsiuio/src/unix/packet.c -@@ -112,7 +112,7 @@ int alloc_free_queue(nic_t *nic, size_t - for (i = 0; i < num_of_packets; i++) { - packet_t *pkt; - -- pkt = alloc_packet(1500, 1500); -+ pkt = alloc_packet(STD_MTU_SIZE, STD_MTU_SIZE); - if (pkt == NULL) { - goto done; - } ---- a/iscsiuio/src/unix/packet.h -+++ b/iscsiuio/src/unix/packet.h -@@ -43,6 +43,8 @@ - - #include "nic.h" - -+#define STD_MTU_SIZE 1500 -+ - struct nic; - struct nic_interface; -
  69. Download patch iscsiuio/src/unix/libs/Makefile.am

    --- 2.0.874-7.1/iscsiuio/src/unix/libs/Makefile.am 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/iscsiuio/src/unix/libs/Makefile.am 2020-02-26 19:07:13.000000000 +0000 @@ -10,4 +10,5 @@ noinst_LIBRARIES = lib_iscsiuio_hw_cnic. lib_iscsiuio_hw_cnic_a_SOURCES = ../build_date.c \ cnic.c \ bnx2.c \ - bnx2x.c + bnx2x.c \ + qedi.c
  70. Download patch debian/open-iscsi.maintscript

    --- 2.0.874-7.1/debian/open-iscsi.maintscript 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/open-iscsi.maintscript 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -rm_conffile /etc/init.d/umountiscsi.sh 2.0.873+git0.3b4b4500-9
  71. Download patch debian/open-iscsi.links
  72. Download patch iscsiuio/src/unix/libs/bnx2.c

    --- 2.0.874-7.1/iscsiuio/src/unix/libs/bnx2.c 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/iscsiuio/src/unix/libs/bnx2.c 2020-02-26 19:07:13.000000000 +0000 @@ -41,6 +41,7 @@ #include <string.h> #include <arpa/inet.h> #include <sys/mman.h> +#include <sys/sysmacros.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/user.h> @@ -76,7 +77,6 @@ static const char cnic_uio_sysfs_name[] /******************************************************************************* * String constants used to display human readable adapter name ******************************************************************************/ -static const char brcm_5706C[] = "QLogic NetXtreme II BCM5706 1000Base-T"; static const char hp_NC370T[] = "HP NC370T Multifunction Gigabit Server Adapter"; static const char hp_NC370I[] =
  73. Download patch debian/patches/security/Ensure-strings-from-peer-are-copied-correctly.patch

    --- 2.0.874-7.1/debian/patches/security/Ensure-strings-from-peer-are-copied-correctly.patch 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/patches/security/Ensure-strings-from-peer-are-copied-correctly.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ -From 85f647c4300a888bb6cbc27f33138549cab617e3 Mon Sep 17 00:00:00 2001 -From: Lee Duncan <lduncan@suse.com> -Date: Fri, 15 Dec 2017 11:15:26 -0800 -Subject: [PATCH 5/8] Ensure strings from peer are copied correctly. - -The method of using strlen() and strcpy()/strncpy() has -a couple of holes. Do not try to measure the length of -strings supplied from peer, and ensure copied strings are -NULL-terminated. Use the new strlcpy() instead. -Found by Qualsys. ---- - iscsiuio/src/unix/iscsid_ipc.c | 24 ++++++------------------ - 1 file changed, 6 insertions(+), 18 deletions(-) - ---- a/iscsiuio/src/unix/iscsid_ipc.c -+++ b/iscsiuio/src/unix/iscsid_ipc.c -@@ -152,10 +152,7 @@ static int decode_cidr(char *in_ipaddr_s - struct in_addr ia; - struct in6_addr ia6; - -- if (strlen(in_ipaddr_str) > NI_MAXHOST) -- strncpy(ipaddr_str, in_ipaddr_str, NI_MAXHOST); -- else -- strcpy(ipaddr_str, in_ipaddr_str); -+ strlcpy(ipaddr_str, in_ipaddr_str, NI_MAXHOST); - - /* Find the CIDR if any */ - tmp = strchr(ipaddr_str, '/'); -@@ -287,22 +284,16 @@ static int decode_iface(struct iface_rec - - /* For LL on, ignore the IPv6 addr in the iface */ - if (ird->linklocal_autocfg == IPV6_LL_AUTOCFG_OFF) { -- if (strlen(rec->ipv6_linklocal) > NI_MAXHOST) -- strncpy(ipaddr_str, rec->ipv6_linklocal, -- NI_MAXHOST); -- else -- strcpy(ipaddr_str, rec->ipv6_linklocal); -+ strlcpy(ipaddr_str, rec->ipv6_linklocal, -+ NI_MAXHOST); - inet_pton(AF_INET6, ipaddr_str, - &ird->ipv6_linklocal); - } - - /* For RTR on, ignore the IPv6 addr in the iface */ - if (ird->router_autocfg == IPV6_RTR_AUTOCFG_OFF) { -- if (strlen(rec->ipv6_router) > NI_MAXHOST) -- strncpy(ipaddr_str, rec->ipv6_router, -- NI_MAXHOST); -- else -- strcpy(ipaddr_str, rec->ipv6_router); -+ strlcpy(ipaddr_str, rec->ipv6_router, -+ NI_MAXHOST); - inet_pton(AF_INET6, ipaddr_str, - &ird->ipv6_router); - } -@@ -316,10 +307,7 @@ static int decode_iface(struct iface_rec - calculate_default_netmask( - ird->ipv4_addr.s_addr); - -- if (strlen(rec->gateway) > NI_MAXHOST) -- strncpy(ipaddr_str, rec->gateway, NI_MAXHOST); -- else -- strcpy(ipaddr_str, rec->gateway); -+ strlcpy(ipaddr_str, rec->gateway, NI_MAXHOST); - inet_pton(AF_INET, ipaddr_str, &ird->ipv4_gateway); - } - } else {
  74. Download patch debian/open-iscsi-udeb.dirs

    --- 2.0.874-7.1/debian/open-iscsi-udeb.dirs 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/open-iscsi-udeb.dirs 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -bin -etc/iscsi -sbin -usr/lib/finish-install.d
  75. Download patch iscsiuio/src/unix/libs/bnx2x.c

    --- 2.0.874-7.1/iscsiuio/src/unix/libs/bnx2x.c 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/iscsiuio/src/unix/libs/bnx2x.c 2020-02-26 19:07:13.000000000 +0000 @@ -36,6 +36,11 @@ * bnx2x.c - bnx2x user space driver * */ + +/* include nic.h before linux/ethtool.h to avoid redefinitions of + * eth structs +*/ +#include "nic.h" #include <errno.h> #include <stdio.h> #include <string.h> @@ -45,6 +50,7 @@ #include <linux/ethtool.h> #include <sys/mman.h> #include <sys/ioctl.h> +#include <sys/sysmacros.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/user.h> @@ -57,7 +63,6 @@ #include "bnx2x.h" #include "cnic.h" #include "logger.h" -#include "nic.h" #include "nic_id.h" #include "nic_utils.h" #include "options.h" @@ -1316,7 +1321,6 @@ void bnx2x_start_xmit(nic_t *nic, size_t if ((rx_bd->addr_hi == 0) && (rx_bd->addr_lo == 0)) { LOG_PACKET(PFX "%s: trying to transmit when device is closed", nic->log_name); - pthread_mutex_unlock(&nic->xmit_mutex); return; } @@ -1343,12 +1347,9 @@ void bnx2x_start_xmit(nic_t *nic, size_t (bp->tx_bd_prod << 16)); bnx2x_flush_doorbell(bp, bp->tx_doorbell); } else { - /* If the doorbell is not rung, the packet will not - get sent. Hence, the xmit_mutex lock will not - get freed. - */ - pthread_mutex_unlock(&nic->xmit_mutex); + LOG_ERR(PFX "Pkt transmission failed."); } + LOG_PACKET(PFX "%s: sent %d bytes using bp->tx_prod: %d", nic->log_name, len, bp->tx_prod); } @@ -1412,6 +1413,8 @@ int bnx2x_write(nic_t *nic, nic_interfac nic->log_name, pkt->buf_size, bp->tx_cons, bp->tx_prod, bp->tx_bd_prod); + pthread_mutex_unlock(&nic->xmit_mutex); + return 0; } @@ -1560,17 +1563,16 @@ static int bnx2x_clear_tx_intr(nic_t *ni hw_cons = bp->get_tx_cons(bp); if (bp->tx_cons == hw_cons) { - if (bp->tx_cons == bp->tx_prod) { - /* Make sure the xmit_mutex lock is unlock */ - if (pthread_mutex_trylock(&nic->xmit_mutex)) - LOG_ERR(PFX "bnx2x tx lock with prod == cons"); - - pthread_mutex_unlock(&nic->xmit_mutex); + if (bp->tx_cons == bp->tx_prod) return 0; - } return -EAGAIN; } + if (pthread_mutex_trylock(&nic->xmit_mutex)) { + LOG_ERR(PFX "%s: unable to get xmit_mutex.", nic->log_name); + return -EINVAL; + } + LOG_PACKET(PFX "%s: clearing tx interrupt [%d %d]", nic->log_name, bp->tx_cons, hw_cons); bp->tx_cons = hw_cons; @@ -1600,6 +1602,7 @@ static int bnx2x_clear_tx_intr(nic_t *ni nic->log_name, pkt->buf_size, bp->tx_cons, bp->tx_prod, bp->tx_bd_prod); + pthread_mutex_unlock(&nic->xmit_mutex); return 0; }
  76. Download patch debian/docs

    --- 2.0.874-7.1/debian/docs 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/docs 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -README -sysfs-documentation -THANKS
  77. Download patch include/iscsi_net_util.h

    --- 2.0.874-7.1/include/iscsi_net_util.h 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/include/iscsi_net_util.h 2020-02-26 19:07:13.000000000 +0000 @@ -2,6 +2,7 @@ #define __ISCSI_NET_UTIL_h__ #define ISCSI_HWADDRESS_BUF_SIZE 18 +#define ISCSIUIO_PATH "/sbin/iscsiuio" extern int net_get_transport_name_from_netdev(char *netdev, char *transport); extern int net_get_netdev_from_hwaddress(char *hwaddress, char *netdev);
  78. Download patch debian/open-iscsi.postrm

    --- 2.0.874-7.1/debian/open-iscsi.postrm 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/open-iscsi.postrm 2020-08-18 22:36:46.000000000 +0000 @@ -5,31 +5,23 @@ set -e case "$1" in purge) - if [ -d /etc/iscsi ] ; then + if [ -d /etc/iscsi ] + then rm -rf /etc/iscsi fi ;; remove) - for file in iscsid iscsi_discovery iscsi-iname iscsistart; do - if [ -L /usr/sbin/$file ]; then - rm /usr/sbin/$file - fi - done + for _ in iscsi-iname iscsid iscsi_discovery iscsistart + do + if [ -L /usr/sbin/$_ ] + then + rm /usr/sbin/$_ + fi + done ;; - abort-upgrade) - if dpkg --compare-versions "$2" le-nl "2.0.873+git0.3b4b4500-12" ; then - # Since we moved that away because it was no longer a conffile in - # the new version, we have to move it back now, to make sure the - # old version remains intact. - if [ -f /etc/iscsi/initiatorname.iscsi.dpkg-backup ] && ! [ -f /etc/iscsi/initiatorname.iscsi ] ; then - mv -f /etc/iscsi/initiatorname.iscsi.dpkg-backup /etc/iscsi/initiatorname.iscsi - fi - fi - ;; - - upgrade|failed-upgrade|abort-install|disappear) + abort-upgrade|upgrade|failed-upgrade|abort-install|disappear) ;; *)
  79. Download patch debian/workaround_flex_bug.sh

    --- 2.0.874-7.1/debian/workaround_flex_bug.sh 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/workaround_flex_bug.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -#!/bin/sh - -# Upstream has always used Flex 2.5.35 to regenerate the lexer it -# shipped with open-iscsi so far. Howevever, 2.5.36 introduced a bug -# (upstream commit 9ba3187a) that broke POSIX compatibility, by -# changing the type of the global yyleng variable from int to size_t, -# breaking the explicit forward declaration in prom_parse.h. This bug -# was fixed in Flex 2.6.1 (upstream commit 7a7c3dfe), but some older -# Debian versions still carry a buggy Flex. -# -# The purpose of this script is to fix the generated output of flex -# to work around this bug for the time being. -# -# This workaround should probably be removed after the release of -# Stretch, because it's only relevant for backporting to Jessie. -# -# References: -# [9ba3187a] https://github.com/westes/flex/commit/9ba3187a537d6a58d345f2874d06087fd4050399 -# [7a7c3dfe] https://github.com/westes/flex/commit/7a7c3dfe1bcb8230447ba1656f926b4b4cdfc457 - -exec perl -pe ' -s/^extern yy_size_t yyleng/extern int yyleng/; -s/^yy_size_t yyleng/int yyleng/; -s/^yy_size_t yyget_leng/int yyget_leng/; -s/yyleng = \(size_t\)/yyleng = (int)/; -/^#define ECHO/ && s/yytext, yyleng/yytext, (size_t) yyleng/; -'
  80. Download patch debian/patches/lp1755858-default-iscsid_conf-to-iscsid_socket.patch

    --- 2.0.874-7.1/debian/patches/lp1755858-default-iscsid_conf-to-iscsid_socket.patch 1970-01-01 00:00:00.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/patches/lp1755858-default-iscsid_conf-to-iscsid_socket.patch 2020-08-18 22:36:51.000000000 +0000 @@ -0,0 +1,30 @@ +Description: default in iscid.conf to use iscsid.socket + +People do not want iscsid to run if not needed. +To do so it is configured to be socket activated. +Internally iscsid code has a fallback if the service is missing to run the +command specified in iscsid.conf as "iscsid.startup". +Set this to ensure the socket is active instead of calling the binary, which +would not be what we want anyway as it would not be from the .service context. + +Forwarded: no (Downstream config) +Author: Christian Ehrhardt <christian.ehrhardt@canonical.com> +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1755858 +Reviewed-by: Rafael David Tinoco <rafaeldtinoco@ubuntu.com> +Last-Update: 2020-08-13 + +--- open-iscsi-2.1.1.orig/etc/iscsid.conf ++++ open-iscsi-2.1.1/etc/iscsid.conf +@@ -18,9 +18,9 @@ + # maintainers. If you leave the iscsid daemon running all + # the time then leave this attribute commented out. + # +-# Default for Fedora and RHEL. (uncomment to activate). +-# iscsid.startup = /bin/systemctl start iscsid.socket iscsiuio.soccket +-# ++# iscsid.startup = /bin/systemctl start iscsid.socket iscsiuio.socket ++iscsid.startup = /bin/systemctl start iscsid.socket ++# + # Default if you are not using systemd (uncomment to activate) + # iscsid.startup = /usr/bin/service start iscsid +
  81. Download patch debian/open-iscsi.service

    --- 2.0.874-7.1/debian/open-iscsi.service 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/open-iscsi.service 2020-08-18 22:34:49.000000000 +0000 @@ -1,12 +1,16 @@ [Unit] Description=Login to default iSCSI targets Documentation=man:iscsiadm(8) man:iscsid(8) -Wants=network-online.target remote-fs-pre.target iscsid.service +Wants=network-online.target remote-fs-pre.target After=network-online.target iscsid.service Before=remote-fs-pre.target DefaultDependencies=no Conflicts=shutdown.target Before=shutdown.target +# Must have some pre-defined targets to login to +ConditionDirectoryNotEmpty=|/etc/iscsi/nodes +# or have a session to use via iscsid +ConditionDirectoryNotEmpty=|/sys/class/iscsi_session [Service] Type=oneshot @@ -15,11 +19,7 @@ RemainAfterExit=true # and 15 if a session is alread logged in (which we do not # consider an error) SuccessExitStatus=15 21 -# iscsiadm will only work if iscsid is running. But we can't use a -# Requires= dependency, since restarts of iscsid would then be -# propagated to this service - and that would cause all sorts of -# mayhem. Therefore, check it in ExecStartPre. -ExecStartPre=/bin/systemctl --quiet is-active iscsid.service +# Note: iscsid will be socket activated by iscsiadm ExecStart=/sbin/iscsiadm -m node --loginall=automatic ExecStart=/lib/open-iscsi/activate-storage.sh ExecStop=/lib/open-iscsi/umountiscsi.sh
  82. Download patch debian/extra/net-interface-handler

    --- 2.0.874-7.1/debian/extra/net-interface-handler 1970-01-01 00:00:00.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/extra/net-interface-handler 2020-08-18 22:36:51.000000000 +0000 @@ -0,0 +1,80 @@ +#!/bin/sh -e +# suppress configuration of network interface used +# by iSCSI root device +# +# If the root filesystem is on iSCSI, then we must take care to avoid +# changing the state of its network interface. To this end, the initramfs +# leaves a note for us which interface was used, and we mangle +# /run/network/ifstate manually to stop it being brought up or down +# automatically. This is a slight layering violation, but, unfortunately, +# ifupdown appears to have no way to do this without also running +# /etc/network/*.d/ scripts. + +assert_interface() { + # udev sets INTERFACE to the name of the currently-processed nic. + [ -n "$INTERFACE" ] && return 0 + echo "environment variable INTERFACE not set." 1>&2; + return 1 +} + +start() { + CR=" +" + assert_interface || return + ifile=/run/initramfs/open-iscsi.interface + + [ -f "$ifile" ] && read iface < "$ifile" || return 0 + [ "$INTERFACE" = "$iface" ] || return + + if ! grep -qs "^$iface=" /run/network/ifstate; then + mkdir -p /run/network + echo "$iface=$iface" >>/run/network/ifstate + + if [ -f /run/net-$iface.conf ]; then + conf=/run/net-$iface.conf + elif [ -f /run/net6-$iface.conf ]; then + conf=/run/net6-$iface.conf + else + conf="" + fi + if command -v resolvconf >/dev/null && + [ -n "$conf" ]; then + . "$conf" + R="" + [ -n "$DOMAINSEARCH" ] && R="$R${CR}search $DOMAINSEARCH" + [ -n "$IPV6DOMAINSEARCH" ] && R="$R${CR}search $IPV6DOMAINSEARCH" + for ns in "$IPV4DNS0" "$IPV4DNS1" "$IPV6DNS0" "$IPV6DNS1"; do + [ -n "$ns" -a "$ns" != "0.0.0.0" ] && R="$R${CR}nameserver $ns" + done + if [ -n "$R" ]; then + # create the dir in case resolvconf did not start yet + mkdir -p /run/resolvconf/interface + resolvconf -a $iface.iscsi-network <<EOF +${R#${CR}} +EOF + fi + fi + fi +} + +stop() { + assert_interface || return + ifile=/run/initramfs/open-iscsi.interface + [ -f "$ifile" ] && read iface < "$ifile" || return 0 + [ "$INTERFACE" = "$iface" ] || return + + if grep -qs "^$iface=" /run/network/ifstate; then + grep -v "^$iface=" /run/network/ifstate >/run/network/.ifstate.tmp || true + mv /run/network/.ifstate.tmp /run/network/ifstate + + if command -v resolvconf >/dev/null; then + resolvconf -d $iface.iscsi-network + fi + fi +} + +case "$1" in + start) start ;; + stop) stop ;; + *) echo "ERROR: must be called with 'start' or 'stop'" >&2; exit 1 ;; +esac
  83. Download patch iscsiuio/Makefile.am

    --- 2.0.874-7.1/iscsiuio/Makefile.am 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/iscsiuio/Makefile.am 2020-02-26 19:07:13.000000000 +0000 @@ -19,11 +19,15 @@ install-am: all-am install-man: cat docs/iscsiuio.8 | GZIP=$(GZIP_ENV) gzip -c > iscsiuio.8.gz - $(INSTALL_PROGRAM) iscsiuio.8.gz $(mandir)/man8 + $(INSTALL) -d $(DESTDIR)$(mandir)/man8/ + $(INSTALL_DATA) iscsiuio.8.gz $(DESTDIR)$(mandir)/man8/ install-log: - $(INSTALL_PROGRAM) iscsiuiolog $(logdir) + $(INSTALL) -d $(DESTDIR)$(logdir)/ + $(INSTALL_DATA) iscsiuiolog $(DESTDIR)$(logdir)/ install-brcm: - -rm -f $(sbindir)/brcm_iscsiuio - -ln -s $(sbindir)/iscsiuio $(sbindir)/brcm_iscsiuio + $(RM) $(DESTDIR)$(sbindir)/brcm_iscsiuio + (cd $(DESTDIR)/$(sbindir); \ + $(RM) brcm_iscsiuio; \ + $(LN_S) iscsiuio brcm_iscsiuio)
  84. Download patch debian/patches/bugfixes/need_iscsiuio_for_hardware_offload.patch

    --- 2.0.874-7.1/debian/patches/bugfixes/need_iscsiuio_for_hardware_offload.patch 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/patches/bugfixes/need_iscsiuio_for_hardware_offload.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -Description: iscsiuio must be present to use hardware offload for bnx2x -Author: Andrew Patterson <andrew.patterson@hpe.com> -Bug: https://groups.google.com/forum/?_escaped_fragment_=msg/open-iscsi/PsT65Z4Gx3I/GUObdlVvCQAJ#!msg/open-iscsi/PsT65Z4Gx3I/GUObdlVvCQAJ -Bug-Debian: https://bugs.debian.org/850057 -Last-Update: 2017-01-24 ---- -This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ ---- a/include/iscsi_net_util.h -+++ b/include/iscsi_net_util.h -@@ -2,6 +2,7 @@ - #define __ISCSI_NET_UTIL_h__ - - #define ISCSI_HWADDRESS_BUF_SIZE 18 -+#define ISCSIUIO_PATH "/sbin/iscsiuio" - - extern int net_get_transport_name_from_netdev(char *netdev, char *transport); - extern int net_get_netdev_from_hwaddress(char *hwaddress, char *netdev); ---- a/usr/iscsi_net_util.c -+++ b/usr/iscsi_net_util.c -@@ -27,6 +27,7 @@ - #include <sys/socket.h> - #include <sys/ioctl.h> - #include <sys/socket.h> -+#include <sys/stat.h> - #include <linux/sockios.h> - #include <linux/if_vlan.h> - #include <net/if_arp.h> -@@ -81,6 +82,22 @@ int net_get_transport_name_from_netdev(c - goto close_sock; - } - -+ /* -+ * iSCSI hardware offload for bnx2{,x} is only supported if the -+ * iscsiuio executable is available. -+ */ -+ if (!strcmp(drvinfo.driver, "bnx2x") || -+ !strcmp(drvinfo.driver, "bnx2")) { -+ struct stat buf; -+ -+ if (stat(ISCSIUIO_PATH, &buf) < 0) { -+ log_debug(1, "ISCSI offload not supported " -+ "(%s not found).", ISCSIUIO_PATH); -+ err = ENODEV; -+ goto close_sock; -+ } -+ } -+ - for (i = 0; net_drivers[i].net_drv_name != NULL; i++) { - struct iscsi_net_driver *net_driver = &net_drivers[i]; -
  85. Download patch debian/open-iscsi.postinst
  86. Download patch debian/open-iscsi.init

    --- 2.0.874-7.1/debian/open-iscsi.init 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/open-iscsi.init 2020-08-18 22:36:46.000000000 +0000 @@ -94,9 +94,6 @@ restarttargets() { } status() { - #XXX FIXME: what to do here? - #status iscsid - # list active sessions echo Current active iSCSI sessions: $ADM -m session }
  87. Download patch debian/iscsid.service

    --- 2.0.874-7.1/debian/iscsid.service 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/iscsid.service 2020-08-18 22:34:08.000000000 +0000 @@ -7,13 +7,13 @@ After=network.target network-online.targ DefaultDependencies=no Conflicts=shutdown.target Before=shutdown.target +ConditionVirtualization=!private-users [Service] Type=forking PIDFile=/run/iscsid.pid ExecStartPre=/lib/open-iscsi/startup-checks.sh ExecStart=/sbin/iscsid -ExecStop=/sbin/iscsiadm -k 0 2 [Install] WantedBy=sysinit.target
  88. Download patch etc/systemd/iscsiuio.socket

    --- 2.0.874-7.1/etc/systemd/iscsiuio.socket 1970-01-01 00:00:00.000000000 +0000 +++ 2.1.1-1ubuntu2/etc/systemd/iscsiuio.socket 2020-02-26 19:07:13.000000000 +0000 @@ -0,0 +1,9 @@ +[Unit] +Description=Open-iSCSI iscsiuio Socket +Documentation=man:iscsiuio(8) + +[Socket] +ListenStream=@ISCSID_UIP_ABSTRACT_NAMESPACE + +[Install] +WantedBy=sockets.target
  89. Download patch debian/iscsiuio.docs

    --- 2.0.874-7.1/debian/iscsiuio.docs 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/iscsiuio.docs 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -iscsiuio/RELEASE.TXT -iscsiuio/README
  90. Download patch debian/gbp.conf

    --- 2.0.874-7.1/debian/gbp.conf 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/gbp.conf 2020-08-18 22:36:46.000000000 +0000 @@ -1,6 +1,7 @@ [DEFAULT] pristine-tar = True color = auto +debian-branch = experimental [import-orig] dch = True
  91. Download patch doc/iscsi-iname.8

    --- 2.0.874-7.1/doc/iscsi-iname.8 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/doc/iscsi-iname.8 2020-02-26 19:07:13.000000000 +0000 @@ -14,7 +14,7 @@ generates a unique iSCSI node name on ev Display help .TP .BI [-p=]\fIprefix\fP -Use the prefix passed in instead of the default "iqn.2005-03.org.open-iscsi" +Use the prefix passed in instead of the default "iqn.2016-04.com.open-iscsi" .SH AUTHORS Open-iSCSI project <http://www.open-iscsi.com/>
  92. Download patch etc/initd/initd.debian

    --- 2.0.874-7.1/etc/initd/initd.debian 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/etc/initd/initd.debian 2020-02-26 19:07:13.000000000 +0000 @@ -11,7 +11,7 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/sbin/iscsid ADM=/sbin/iscsiadm -PIDFILE=/var/run/iscsid.pid +PIDFILE=/run/iscsid.pid [ -x "$DAEMON" ] || exit 0
  93. Download patch etc/systemd/iscsiuio.service

    --- 2.0.874-7.1/etc/systemd/iscsiuio.service 1970-01-01 00:00:00.000000000 +0000 +++ 2.1.1-1ubuntu2/etc/systemd/iscsiuio.service 2020-02-26 19:07:13.000000000 +0000 @@ -0,0 +1,19 @@ +[Unit] +Description=iSCSI UserSpace I/O driver +Documentation=man:iscsiuio(8) +DefaultDependencies=no +Conflicts=shutdown.target +Requires=iscsid.service +BindTo=iscsid.service +After=network.target +Before=remote-fs-pre.target iscsid.service + +[Service] +Type=notify +NotifyAccess=main +ExecStart=/sbin/iscsiuio -f +KillMode=mixed +Restart=on-failure + +[Install] +WantedBy=multi-user.target
  94. Download patch debian/copyright
  95. Download patch etc/systemd/iscsid.service

    --- 2.0.874-7.1/etc/systemd/iscsid.service 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/etc/systemd/iscsid.service 2020-02-26 19:07:13.000000000 +0000 @@ -1,13 +1,17 @@ [Unit] Description=Open-iSCSI Documentation=man:iscsid(8) man:iscsiuio(8) man:iscsiadm(8) -After=network.target NetworkManager-wait-online.service iscsiuio.service tgtd.service targetcli.service +DefaultDependencies=no +After=network.target iscsiuio.service +Before=remote-fs-pre.target [Service] -Type=forking -PIDFile=/var/run/iscsid.pid -ExecStart=/usr/sbin/iscsid -ExecStop=/sbin/iscsiadm -k 0 2 +Type=notify +NotifyAccess=main +ExecStart=/sbin/iscsid -f +KillMode=mixed +Restart=on-failure [Install] WantedBy=multi-user.target +Also=iscsid.socket
  96. Download patch doc/iscsiadm.8
  97. Download patch iscsiuio/README

    --- 2.0.874-7.1/iscsiuio/README 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/iscsiuio/README 2020-02-26 19:07:13.000000000 +0000 @@ -1,6 +1,6 @@ Iscsiuio Userspace Tool -Version 0.7.8.2 -Dec 10, 2013 +Version 0.7.8.6 +Jun 27, 2019 ------------------------------------------------------ This tool is to be used in conjunction with the QLogic NetXtreme II Linux
  98. Download patch debian/patches/bugfixes/no-make-clean-kernel.patch

    --- 2.0.874-7.1/debian/patches/bugfixes/no-make-clean-kernel.patch 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/patches/bugfixes/no-make-clean-kernel.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -Description: Don't run make -C kernel clean - The kernel modules are no longer built (part of mainline), so don't - run make -C kernel clean on make clean. -Author: Christian Seiler <christian@iwakd.de> -Forwarded: not-yet -Last-Update: 2016-07-27 ---- -This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ ---- a/Makefile -+++ b/Makefile -@@ -75,7 +75,6 @@ clean: - $(MAKE) -C utils/fwparam_ibft clean - $(MAKE) -C utils clean - $(MAKE) -C usr clean -- $(MAKE) -C kernel clean - [ ! -f iscsiuio/Makefile ] || $(MAKE) -C iscsiuio clean - [ ! -f iscsiuio/Makefile ] || $(MAKE) -C iscsiuio distclean -
  99. Download patch debian/extra/initramfs.local-bottom

    --- 2.0.874-7.1/debian/extra/initramfs.local-bottom 2018-12-11 18:05:42.000000000 +0000 +++ 2.1.1-1ubuntu2/debian/extra/initramfs.local-bottom 2020-08-18 22:34:49.000000000 +0000 @@ -7,4 +7,24 @@ if [ -x /sbin/iscsiuio ] && [ -e /run/in --name iscsiuio --exec /sbin/iscsiuio || : fi +# Remove the interface file if no disks are present +if [ -f /run/initramfs/open-iscsi.interface ] ; then + found=0 + for disk in /dev/disk/by-path/*-iscsi-*; do + if [ ! -e "$disk" ] ; then + # If we have no matches, we stil go through the for loop once with + # the pattern as a string + continue + fi + if ! readlink -f "$disk" > /dev/null ; then + continue + fi + found=1 + break; + done + if [ $found = 0 ] ; then + rm /run/initramfs/open-iscsi.interface + fi +fi + exit 0
  100. Download patch etc/initd/initd.redhat

    --- 2.0.874-7.1/etc/initd/initd.redhat 2016-09-29 18:33:24.000000000 +0000 +++ 2.1.1-1ubuntu2/etc/initd/initd.redhat 2020-02-26 19:07:13.000000000 +0000 @@ -4,7 +4,7 @@ # description: Starts and stops the iSCSI initiator # # processname: iscsid -# pidfile: /var/run/iscsid.pid +# pidfile: /run/iscsid.pid # config: /etc/iscsi/iscsid.conf # Source function library. @@ -23,7 +23,7 @@ start() echo [ $RETVAL -eq 0 ] || return - touch /var/lock/subsys/open-iscsi + touch /run/lock/subsys/open-iscsi echo -n $"Setting up iSCSI targets: " iscsiadm -m node --loginall=automatic @@ -43,8 +43,8 @@ stop() return $RETVAL fi iscsiadm -k 0 - rm -f /var/run/iscsid.pid - [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/open-iscsi + rm -f /run/iscsid.pid + [ $RETVAL -eq 0 ] && rm -f /run/lock/subsys/open-iscsi status=0 modprobe -r iscsi_tcp 2>/dev/null if [ "$?" -ne "0" -a "$?" -ne "1" ]; then @@ -94,7 +94,7 @@ case "$1" in RETVAL=$? ;; condrestart) - [ -f /var/lock/subsys/open-iscsi ] && restart + [ -f /run/lock/subsys/open-iscsi ] && restart ;; *) echo $"Usage: $0 {start|stop|restart|status|condrestart}"
  101. ...

Debian ( Changelog | PTS | Bugs ) Ubuntu ( Changelog | txt | LP | Bugs ) | Diff from Ubuntu

Source: python-configshell-fb

python-configshell-fb (1:1.1.28-1ubuntu1) groovy; urgency=medium * New upstream release. -- Rafael David Tinoco <rafaeldtinoco@ubuntu.com> Fri, 24 Jul 2020 20:24:41 +0000

Modifications :
  1. Download patch configshell_fb/node.py
  2. Download patch configshell_fb/console.py

    --- 1.1.fb25-1.1/configshell_fb/console.py 2018-08-31 11:02:32.000000000 +0000 +++ 1:1.1.28-1ubuntu1/configshell_fb/console.py 2020-04-06 08:24:13.000000000 +0000 @@ -26,12 +26,6 @@ import tty from .prefs import Prefs -# avoid requiring epydoc at runtime -try: - import epydoc.markup.epytext -except ImportError: - pass - class Console(object): ''' Implements various utility methods providing a console UI support toolkit, @@ -166,20 +160,6 @@ class Console(object): Renders and print and epytext-formatted text on the console. ''' text = self.dedent(text) - try: - dom_tree = epydoc.markup.epytext.parse(text, None) - except NameError: - # epydoc not installed, strip markup - dom_tree = text - dom_tree = dom_tree.replace("B{", "") - dom_tree = dom_tree.replace("I{", "") - dom_tree = dom_tree.replace("C{", "") - dom_tree = dom_tree.replace("}", "") - dom_tree += "\n" - except: - self.display(text) - raise - text = self.render_domtree(dom_tree) # We need to remove the last line feed, but there might be # escape characters after it... clean_text = '' @@ -191,7 +171,7 @@ class Console(object): break else: clean_text = text - self.raw_write(clean_text) + self.raw_write(clean_text, output=self._stdout) def indent(self, text, margin=2): ''' @@ -264,7 +244,7 @@ class Console(object): that any lines that are longer than terminal width or max_width are broken into shorter lines (at the first whitespace sequence that occurs before the limit. If the given string contains newlines, they - will I{not} be removed. Any lines that begin with whitespace will not + will not be removed. Any lines that begin with whitespace will not be wordwrapped. This version takes into account ANSI escape characters: @@ -275,14 +255,14 @@ class Console(object): @param indent: If specified, then indent each line by this number of spaces. - @type indent: C{int} + @type indent: int @param startindex: If specified, then assume that the first line - is already preceeded by C{startindex} characters. - @type startindex: C{int} + is already preceded by startindex characters. + @type startindex: int @param splitchars: A list of non-whitespace characters which can be used to split a line. (E.g., use '/\\' to allow path names to be split over multiple lines.) - @rtype: C{str} + @rtype: str ''' right = self.get_width() if splitchars: @@ -322,104 +302,3 @@ class Console(object): current_style = next_style.split(self._ansi_reset)[-1] return ''.join(result).rstrip()+'\n' - - def render_domtree(self, tree, indent=0, seclevel=0): - ''' - Convert a DOM document encoding epytext to an 8-bits ascii string with - ANSI formating for simpler styles. - - @param tree: A DOM document encoding of an epytext string. - @type tree: C{Element} - @param indent: The indentation for the string representation of - C{tree}. Each line of the returned string will begin with - C{indent} space characters. - @type indent: C{int} - @param seclevel: The section level that C{tree} appears at. This - is used to generate section headings. - @type seclevel: C{int} - @return: The formated string. - @rtype: C{string} - ''' - if isinstance(tree, six.string_types): - return tree - - if tree.tag == 'section': - seclevel += 1 - - # Figure out the child indent level. - if tree.tag == 'epytext': - cindent = indent - elif tree.tag == 'li' and tree.attribs.get('bullet'): - cindent = indent + 1 + len(tree.attribs.get('bullet')) - else: - cindent = indent + 2 - - variables = [self.render_domtree(c, cindent, seclevel) - for c in tree.children] - childstr = ''.join(variables) - - if tree.tag == 'para': - text = self.render_text(childstr) - text = self.wordwrap(text, indent)+'\n' - elif tree.tag == 'li': - # We should be able to use getAttribute here; but there's no - # convenient way to test if an element has an attribute.. - bullet = tree.attribs.get('bullet') or '-' - text = indent*' ' + bullet + ' ' + childstr.lstrip() - elif tree.tag == 'heading': - text = ((indent-2)*' ' + self.render_text( - childstr, styles=['bold'], todefault=True) \ - + '\n') - elif tree.tag == 'doctestblock': - lines = [(indent+2)*' '+line for line in childstr.split('\n')] - text = '\n'.join(lines) + '\n\n' - elif tree.tag == 'literalblock': - lines = [(indent+1)*' '+ self.render_text( - line, todefault=True) - for line in childstr.split('\n')] - text = '\n'.join(lines) + '\n\n' - elif tree.tag == 'fieldlist': - text = childstr - elif tree.tag == 'field': - numargs = 0 - while tree.children[numargs+1].tag == 'arg': - numargs += 1 - args = variables[1:1+numargs] - body = variables[1+numargs:] - text = (indent)*' '+'@'+variables[0] - if args: - text += '(' + ', '.join(args) + ')' - text = text + ':\n' + ''.join(body) - elif tree.tag == 'uri': - if len(variables) != 2: - raise ValueError('Bad URI ') - elif variables[0] == variables[1]: - text = self.render_text( - '%s' % variables[1], - 'blue', styles=['underline'], todefault=True) - else: - text = '%r<%s>' % (variables[0], variables[1]) - elif tree.tag == 'link': - if len(variables) != 2: - raise ValueError('Bad Link') - text = '%s' % variables[0] - elif tree.tag in ('olist', 'ulist'): - text = childstr.replace('\n\n', '\n')+'\n' - elif tree.tag == 'bold': - text = self.render_text( - childstr, styles=['bold'], todefault=True) - elif tree.tag == 'italic': - text = self.render_text( - childstr, styles=['underline'], todefault=True) - elif tree.tag == 'symbol': - text = '%s' \ - % epydoc.markup.epytext.SYMBOL_TO_PLAINTEXT.get( - childstr, childstr) - elif tree.tag == 'graph': - text = '<<%s graph: %s>>' \ - % (variables[0], ', '.join(variables[1:])) - else: - # Assume that anything else can be passed through. - text = self.render_text(childstr) - - return text
  3. Download patch configshell_fb/shell.py

    --- 1.1.fb25-1.1/configshell_fb/shell.py 2018-08-31 11:02:32.000000000 +0000 +++ 1:1.1.28-1ubuntu1/configshell_fb/shell.py 2020-04-06 08:24:13.000000000 +0000 @@ -18,8 +18,9 @@ under the License. import os import six import sys -from pyparsing import (alphanums, Empty, Group, OneOrMore, Optional, - ParseResults, Regex, Suppress, Word) +from pyparsing import (alphanums, Empty, Group, locatedExpr, + OneOrMore, Optional, ParseResults, Regex, + Suppress, Word) from . import console from . import log @@ -48,7 +49,7 @@ if sys.stdout.isatty(): tty=True else: tty=False - + # remember the original setting oldTerm = os.environ.get('TERM') os.environ['TERM'] = '' @@ -59,12 +60,6 @@ else: if oldTerm != None: os.environ['TERM'] = oldTerm del oldTerm - -# Pyparsing helper to group the location of a token and its value -# http://stackoverflow.com/questions/18706631/pyparsing-get-token-location-in-results-name -locator = Empty().setParseAction(lambda s, l, t: l) -def locatedExpr(expr): - return Group(locator('location') + expr('value')) class ConfigShell(object): ''' @@ -118,7 +113,7 @@ class ConfigShell(object): # Grammar of the command line command = locatedExpr(Word(alphanums + '_'))('command') - var = Word(alphanums + ';,=_\+/.<>()~@:-%[]') + var = Word(alphanums + '?;&*$!#,=_\+/.<>()~@:-%[]') value = var keyword = Word(alphanums + '_\-') kparam = locatedExpr(keyword + Suppress('=') + Optional(value, default=''))('kparams*') @@ -608,13 +603,13 @@ class ConfigShell(object): current_token = 'pparam' elif 'x' in [x.value for x in parse_results.kparams]: current_token = 'kparam' - elif path and beg == parse_results.path.location: + elif path and beg == parse_results.path.locn_start: current_token = 'path' - elif command and beg == parse_results.command.location: + elif command and beg == parse_results.command.locn_start: current_token = 'command' - elif pparams and beg in [p.location for p in parse_results.pparams]: + elif pparams and beg in [p.locn_start for p in parse_results.pparams]: current_token = 'pparam' - elif kparams and beg in [k.location for k in parse_results.kparams]: + elif kparams and beg in [k.locn_start for k in parse_results.kparams]: current_token = 'kparam' self._current_completions = \
  4. Download patch debian/tests/control

    --- 1.1.fb25-1.1/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 +++ 1:1.1.28-1ubuntu1/debian/tests/control 2020-07-24 20:19:46.000000000 +0000 @@ -0,0 +1,9 @@ +Tests: lscpu +Test-Command: printf "cd /system/\nhelp\nexit\n" | python3 examples/myshell | grep lscpu +Restrictions: allow-stderr +Depends: python3-configshell-fb + +Tests: lsscsi +Test-Command: printf "cd /system/storage/\nhelp\nexit\n" | python3 examples/myshell | grep lsscsi +Restrictions: allow-stderr +Depends: python3-configshell-fb
  5. Download patch debian/python-configshell-fb.install

    --- 1.1.fb25-1.1/debian/python-configshell-fb.install 1970-01-01 00:00:00.000000000 +0000 +++ 1:1.1.28-1ubuntu1/debian/python-configshell-fb.install 2020-07-24 20:19:46.000000000 +0000 @@ -0,0 +1 @@ +usr/lib/python2*
  6. Download patch debian/rules

    --- 1.1.fb25-1.1/debian/rules 2019-12-23 03:07:04.000000000 +0000 +++ 1:1.1.28-1ubuntu1/debian/rules 2020-07-24 20:19:46.000000000 +0000 @@ -1,9 +1,27 @@ #!/usr/bin/make -f +export DH_VERBOSE=1 + +include /usr/share/dpkg/default.mk + %: dh $@ --with python3 --buildsystem=pybuild +override_dh_auto_build: + pybuild --configure + pybuild --build + +override_dh_auto_install: + pybuild --install + override_dh_auto_clean: - dh_auto_clean - rm -rf build - rm -rf *.egg-info + rm -rf .pybuild/ + rm -rf build/ + rm -rf *.egg-info/ + +override_dh_installdocs: + dh_installdocs README.md + dh_installdocs COPYING + +override_dh_installexamples: + dh_installexamples examples/myshell
  7. Download patch configshell_fb/__init__.py

    --- 1.1.fb25-1.1/configshell_fb/__init__.py 2018-08-31 11:02:32.000000000 +0000 +++ 1:1.1.28-1ubuntu1/configshell_fb/__init__.py 2020-04-06 08:24:13.000000000 +0000 @@ -15,7 +15,7 @@ License for the specific language govern under the License. ''' -if __name__ == "configshell": +if __name__ == 'configshell-fb': from warnings import warn warn("'configshell' package name for configshell-fb is deprecated, please" + " instead import 'configshell_fb'", UserWarning, stacklevel=2) @@ -25,3 +25,8 @@ from .log import Log from .node import ConfigNode, ExecutionError from .prefs import Prefs from .shell import ConfigShell + +__version__ = '1.1.28' +__url__ = 'http://github.com/open-iscsi/configshell-fb' +__description__ = 'A framework to implement simple but nice CLIs.' +__license__ = 'Apache 2.0'
  8. Download patch debian/control

    --- 1.1.fb25-1.1/debian/control 2019-12-23 03:06:36.000000000 +0000 +++ 1:1.1.28-1ubuntu1/debian/control 2020-07-24 20:24:41.000000000 +0000 @@ -1,7 +1,8 @@ Source: python-configshell-fb Section: python Priority: optional -Maintainer: Linux Block Storage Team <team+linux-blocks@tracker.debian.org> +Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> +XSBC-Original-Maintainer: Linux Block Storage Team <team+linux-blocks@tracker.debian.org> Uploaders: Christophe Vu-Brugier <cvubrugier@fastmail.fm>, Ritesh Raj Sarraf <rrs@debian.org>, Christian Seiler <christian@iwakd.de>
  9. Download patch debian/python3-configshell-fb.install

    --- 1.1.fb25-1.1/debian/python3-configshell-fb.install 1970-01-01 00:00:00.000000000 +0000 +++ 1:1.1.28-1ubuntu1/debian/python3-configshell-fb.install 2020-07-24 20:19:46.000000000 +0000 @@ -0,0 +1 @@ +usr/lib/python3*
  10. Download patch configshell/node.py
  11. Download patch configshell/__init__.py

    --- 1.1.fb25-1.1/configshell/__init__.py 2018-08-31 11:02:32.000000000 +0000 +++ 1:1.1.28-1ubuntu1/configshell/__init__.py 2020-04-06 08:24:13.000000000 +0000 @@ -15,7 +15,7 @@ License for the specific language govern under the License. ''' -if __name__ == "configshell": +if __name__ == 'configshell-fb': from warnings import warn warn("'configshell' package name for configshell-fb is deprecated, please" + " instead import 'configshell_fb'", UserWarning, stacklevel=2) @@ -25,3 +25,8 @@ from .log import Log from .node import ConfigNode, ExecutionError from .prefs import Prefs from .shell import ConfigShell + +__version__ = '1.1.28' +__url__ = 'http://github.com/open-iscsi/configshell-fb' +__description__ = 'A framework to implement simple but nice CLIs.' +__license__ = 'Apache 2.0'
  12. Download patch debian/watch

    --- 1.1.fb25-1.1/debian/watch 2019-08-01 08:36:56.000000000 +0000 +++ 1:1.1.28-1ubuntu1/debian/watch 2020-07-24 20:19:46.000000000 +0000 @@ -1,3 +1,3 @@ version=4 -opts=uversionmangle=s/fb//,filenamemangle=s/.+\/v?(\d\S+)\.tar\.gz/configshell-fb-$1\.tar\.gz/ \ - https://github.com/open-iscsi/configshell-fb/releases .*/v?(\d\S+)\.tar\.gz +opts=uversionmangle=s/fb//,dversionmangle=s/fb//,filenamemangle=s/.+\/v?(\d\S+)\.tar\.gz/configshell-fb-$1\.tar\.gz/ \ + https://github.com/open-iscsi/configshell-fb/releases .*/v?(\d\S+)\.tar\.gz
  13. Download patch debian/tests/basic.py

    --- 1.1.fb25-1.1/debian/tests/basic.py 1970-01-01 00:00:00.000000000 +0000 +++ 1:1.1.28-1ubuntu1/debian/tests/basic.py 2020-07-24 20:19:46.000000000 +0000 @@ -0,0 +1,157 @@ +#!/usr/bin/env python + +import os +import configshell_fb as configshell + +class MySystemRoot(configshell.node.ConfigNode): + def __init__(self, shell): + configshell.node.ConfigNode.__init__(self, '/', shell=shell) + Interpreters(self) + System(self) + for level in range(1,20): + configshell.node.ConfigNode("level%d" % level, self) + +class Interpreters(configshell.node.ConfigNode): + def __init__(self, parent): + configshell.node.ConfigNode.__init__(self, 'interpreters', parent) + + def ui_command_python(self): + ''' + python - an interpreted object-oriented programming language + ''' + os.system("python") + + def ui_command_ipython(self): + ''' + ipython - An Enhanced Interactive Python + ''' + os.system("ipython") + + def ui_command_bash(self): + ''' + bash - GNU Bourne-Again SHell + ''' + os.system("bash") + +class System(configshell.node.ConfigNode): + def __init__(self, parent): + configshell.node.ConfigNode.__init__(self, 'system', parent) + Processes(self) + Storage(self) + + def ui_command_uname(self): + ''' + Displays the system uname information. + ''' + os.system("uname -a") + + def ui_command_lsmod(self): + ''' + lsmod - program to show the status of modules in the Linux Kernel + ''' + os.system("lsmod") + + def ui_command_lspci(self): + ''' + lspci - list all PCI devices + ''' + os.system("lspci") + + def ui_command_lsusb(self): + ''' + lsusb - list USB devices + ''' + os.system("lsusb") + + def ui_command_lscpu(self): + ''' + lscpu - CPU architecture information helper + ''' + os.system("lscpu") + + def ui_command_uptime(self): + ''' + uptime - Tell how long the system has been running. + ''' + os.system("uptime") + + +class Storage(configshell.node.ConfigNode): + def __init__(self, parent): + configshell.node.ConfigNode.__init__(self, 'storage', parent) + + def ui_command_lsscsi(self): + ''' + lsscsi - list SCSI devices (or hosts) and their attributes + ''' + os.system("lsscsi") + + def ui_command_du(self): + ''' + du - estimate file space usage + ''' + os.system("du -hs /") + + def ui_command_df(self): + ''' + df - report file system disk space usage + ''' + os.system("df -h") + + def ui_command_uuidgen(self): + ''' + uuidgen - command-line utility to create a new UUID value. + ''' + os.system("uuidgen") + +class Processes(configshell.node.ConfigNode): + def __init__(self, parent): + configshell.node.ConfigNode.__init__(self, 'processes', parent) + + def ui_command_top(self): + ''' + top - display Linux tasks + ''' + os.system("top") + + def ui_command_ps(self): + ''' + ps - report a snapshot of the current processes. + ''' + os.system("ps aux") + + def ui_command_pstree(self): + ''' + pstree - display a tree of processes + ''' + os.system("pstree") + +class Users(configshell.node.ConfigNode): + def __init__(self, parent): + configshell.node.ConfigNode.__init__(self, 'users', parent) + + def ui_command_who(self): + ''' + who - show who is logged on + ''' + os.system("who") + + def ui_command_whoami(self): + ''' + whoami - print effective userid + ''' + os.system("whoami") + + def ui_command_users(self): + ''' + users - print the user names of users currently logged in. + ''' + os.system("users") + +def main(): + shell = configshell.shell.ConfigShell('~/.cfgshell') + root_node = MySystemRoot(shell) + shell.run_interactive() + +if __name__ == "__main__": + main()
  14. Download patch setup.py

    --- 1.1.fb25-1.1/setup.py 2018-08-31 11:02:32.000000000 +0000 +++ 1:1.1.28-1ubuntu1/setup.py 2020-04-06 08:24:13.000000000 +0000 @@ -16,11 +16,25 @@ License for the specific language govern under the License. ''' +import os +import re from setuptools import setup +# Get version without importing. +init_file_path = os.path.join(os.path.dirname(__file__), 'configshell/__init__.py') + +with open(init_file_path) as f: + for line in f: + match = re.match(r"__version__.*'([0-9.]+)'", line) + if match: + version = match.group(1) + break + else: + raise Exception("Couldn't find version in setup.py") + setup( name = 'configshell-fb', - version = '1.1.25', + version = '1.1.28', description = 'A framework to implement simple but nice CLIs.', license = 'Apache 2.0', maintainer = 'Andy Grover', @@ -28,8 +42,9 @@ setup( url = 'http://github.com/open-iscsi/configshell-fb', packages = ['configshell', 'configshell_fb'], install_requires = [ - 'pyparsing', + 'pyparsing >= 2.0.2', 'six', + 'urwid', ], classifiers = [ "Programming Language :: Python",
  15. Download patch configshell/console.py

    --- 1.1.fb25-1.1/configshell/console.py 2018-08-31 11:02:32.000000000 +0000 +++ 1:1.1.28-1ubuntu1/configshell/console.py 2020-04-06 08:24:13.000000000 +0000 @@ -26,12 +26,6 @@ import tty from .prefs import Prefs -# avoid requiring epydoc at runtime -try: - import epydoc.markup.epytext -except ImportError: - pass - class Console(object): ''' Implements various utility methods providing a console UI support toolkit, @@ -166,20 +160,6 @@ class Console(object): Renders and print and epytext-formatted text on the console. ''' text = self.dedent(text) - try: - dom_tree = epydoc.markup.epytext.parse(text, None) - except NameError: - # epydoc not installed, strip markup - dom_tree = text - dom_tree = dom_tree.replace("B{", "") - dom_tree = dom_tree.replace("I{", "") - dom_tree = dom_tree.replace("C{", "") - dom_tree = dom_tree.replace("}", "") - dom_tree += "\n" - except: - self.display(text) - raise - text = self.render_domtree(dom_tree) # We need to remove the last line feed, but there might be # escape characters after it... clean_text = '' @@ -191,7 +171,7 @@ class Console(object): break else: clean_text = text - self.raw_write(clean_text) + self.raw_write(clean_text, output=self._stdout) def indent(self, text, margin=2): ''' @@ -264,7 +244,7 @@ class Console(object): that any lines that are longer than terminal width or max_width are broken into shorter lines (at the first whitespace sequence that occurs before the limit. If the given string contains newlines, they - will I{not} be removed. Any lines that begin with whitespace will not + will not be removed. Any lines that begin with whitespace will not be wordwrapped. This version takes into account ANSI escape characters: @@ -275,14 +255,14 @@ class Console(object): @param indent: If specified, then indent each line by this number of spaces. - @type indent: C{int} + @type indent: int @param startindex: If specified, then assume that the first line - is already preceeded by C{startindex} characters. - @type startindex: C{int} + is already preceded by startindex characters. + @type startindex: int @param splitchars: A list of non-whitespace characters which can be used to split a line. (E.g., use '/\\' to allow path names to be split over multiple lines.) - @rtype: C{str} + @rtype: str ''' right = self.get_width() if splitchars: @@ -322,104 +302,3 @@ class Console(object): current_style = next_style.split(self._ansi_reset)[-1] return ''.join(result).rstrip()+'\n' - - def render_domtree(self, tree, indent=0, seclevel=0): - ''' - Convert a DOM document encoding epytext to an 8-bits ascii string with - ANSI formating for simpler styles. - - @param tree: A DOM document encoding of an epytext string. - @type tree: C{Element} - @param indent: The indentation for the string representation of - C{tree}. Each line of the returned string will begin with - C{indent} space characters. - @type indent: C{int} - @param seclevel: The section level that C{tree} appears at. This - is used to generate section headings. - @type seclevel: C{int} - @return: The formated string. - @rtype: C{string} - ''' - if isinstance(tree, six.string_types): - return tree - - if tree.tag == 'section': - seclevel += 1 - - # Figure out the child indent level. - if tree.tag == 'epytext': - cindent = indent - elif tree.tag == 'li' and tree.attribs.get('bullet'): - cindent = indent + 1 + len(tree.attribs.get('bullet')) - else: - cindent = indent + 2 - - variables = [self.render_domtree(c, cindent, seclevel) - for c in tree.children] - childstr = ''.join(variables) - - if tree.tag == 'para': - text = self.render_text(childstr) - text = self.wordwrap(text, indent)+'\n' - elif tree.tag == 'li': - # We should be able to use getAttribute here; but there's no - # convenient way to test if an element has an attribute.. - bullet = tree.attribs.get('bullet') or '-' - text = indent*' ' + bullet + ' ' + childstr.lstrip() - elif tree.tag == 'heading': - text = ((indent-2)*' ' + self.render_text( - childstr, styles=['bold'], todefault=True) \ - + '\n') - elif tree.tag == 'doctestblock': - lines = [(indent+2)*' '+line for line in childstr.split('\n')] - text = '\n'.join(lines) + '\n\n' - elif tree.tag == 'literalblock': - lines = [(indent+1)*' '+ self.render_text( - line, todefault=True) - for line in childstr.split('\n')] - text = '\n'.join(lines) + '\n\n' - elif tree.tag == 'fieldlist': - text = childstr - elif tree.tag == 'field': - numargs = 0 - while tree.children[numargs+1].tag == 'arg': - numargs += 1 - args = variables[1:1+numargs] - body = variables[1+numargs:] - text = (indent)*' '+'@'+variables[0] - if args: - text += '(' + ', '.join(args) + ')' - text = text + ':\n' + ''.join(body) - elif tree.tag == 'uri': - if len(variables) != 2: - raise ValueError('Bad URI ') - elif variables[0] == variables[1]: - text = self.render_text( - '%s' % variables[1], - 'blue', styles=['underline'], todefault=True) - else: - text = '%r<%s>' % (variables[0], variables[1]) - elif tree.tag == 'link': - if len(variables) != 2: - raise ValueError('Bad Link') - text = '%s' % variables[0] - elif tree.tag in ('olist', 'ulist'): - text = childstr.replace('\n\n', '\n')+'\n' - elif tree.tag == 'bold': - text = self.render_text( - childstr, styles=['bold'], todefault=True) - elif tree.tag == 'italic': - text = self.render_text( - childstr, styles=['underline'], todefault=True) - elif tree.tag == 'symbol': - text = '%s' \ - % epydoc.markup.epytext.SYMBOL_TO_PLAINTEXT.get( - childstr, childstr) - elif tree.tag == 'graph': - text = '<<%s graph: %s>>' \ - % (variables[0], ', '.join(variables[1:])) - else: - # Assume that anything else can be passed through. - text = self.render_text(childstr) - - return text
  16. Download patch configshell/shell.py

    --- 1.1.fb25-1.1/configshell/shell.py 2018-08-31 11:02:32.000000000 +0000 +++ 1:1.1.28-1ubuntu1/configshell/shell.py 2020-04-06 08:24:13.000000000 +0000 @@ -18,8 +18,9 @@ under the License. import os import six import sys -from pyparsing import (alphanums, Empty, Group, OneOrMore, Optional, - ParseResults, Regex, Suppress, Word) +from pyparsing import (alphanums, Empty, Group, locatedExpr, + OneOrMore, Optional, ParseResults, Regex, + Suppress, Word) from . import console from . import log @@ -48,7 +49,7 @@ if sys.stdout.isatty(): tty=True else: tty=False - + # remember the original setting oldTerm = os.environ.get('TERM') os.environ['TERM'] = '' @@ -59,12 +60,6 @@ else: if oldTerm != None: os.environ['TERM'] = oldTerm del oldTerm - -# Pyparsing helper to group the location of a token and its value -# http://stackoverflow.com/questions/18706631/pyparsing-get-token-location-in-results-name -locator = Empty().setParseAction(lambda s, l, t: l) -def locatedExpr(expr): - return Group(locator('location') + expr('value')) class ConfigShell(object): ''' @@ -118,7 +113,7 @@ class ConfigShell(object): # Grammar of the command line command = locatedExpr(Word(alphanums + '_'))('command') - var = Word(alphanums + ';,=_\+/.<>()~@:-%[]') + var = Word(alphanums + '?;&*$!#,=_\+/.<>()~@:-%[]') value = var keyword = Word(alphanums + '_\-') kparam = locatedExpr(keyword + Suppress('=') + Optional(value, default=''))('kparams*') @@ -608,13 +603,13 @@ class ConfigShell(object): current_token = 'pparam' elif 'x' in [x.value for x in parse_results.kparams]: current_token = 'kparam' - elif path and beg == parse_results.path.location: + elif path and beg == parse_results.path.locn_start: current_token = 'path' - elif command and beg == parse_results.command.location: + elif command and beg == parse_results.command.locn_start: current_token = 'command' - elif pparams and beg in [p.location for p in parse_results.pparams]: + elif pparams and beg in [p.locn_start for p in parse_results.pparams]: current_token = 'pparam' - elif kparams and beg in [k.location for k in parse_results.kparams]: + elif kparams and beg in [k.locn_start for k in parse_results.kparams]: current_token = 'kparam' self._current_completions = \

Debian ( Changelog | PTS | Bugs ) Ubuntu ( Changelog | txt | LP | Bugs ) | Diff from Ubuntu

Source: rabbitvcs

rabbitvcs (0.18-1ubuntu1) focal; urgency=medium * Drop rabbitvcs-thunar since it depends on python2 (Closes: #955346) -- Jeremy Bicha <jbicha@ubuntu.com> Mon, 30 Mar 2020 06:49:07 -0400

Modifications :
  1. Download patch debian/control

    --- 0.18-1/debian/control 2020-03-25 13:42:00.000000000 +0000 +++ 0.18-1ubuntu1/debian/control 2020-03-30 10:49:07.000000000 +0000 @@ -1,5 +1,6 @@ Source: rabbitvcs -Maintainer: Python Applications Packaging Team <python-apps-team@lists.alioth.debian.org> +Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> +XSBC-Original-Maintainer: Python Applications Packaging Team <python-apps-team@lists.alioth.debian.org> Uploaders: Ritesh Raj Sarraf <rrs@debian.org> Section: vcs Priority: optional @@ -56,15 +57,15 @@ Description: Gedit extension for RabbitV straightforward access to the version control systems SVN (Subversion) and Git. This is the extension for gedit text editor. -Package: rabbitvcs-thunar -Architecture: all -Depends: ${misc:Depends}, - thunarx-python, - rabbitvcs-core (>= 0.15) -Description: Thunar extension for RabbitVCS - RabbitVCS is a set of graphical tools written to provide simple and - straightforward access to the version control systems SVN (Subversion) - and Git. This is the extension for thunar file manager +#Package: rabbitvcs-thunar +#Architecture: all +#Depends: ${misc:Depends}, +# thunarx-python, +# rabbitvcs-core (>= 0.15) +#Description: Thunar extension for RabbitVCS +# RabbitVCS is a set of graphical tools written to provide simple and +# straightforward access to the version control systems SVN (Subversion) +# and Git. This is the extension for thunar file manager Package: rabbitvcs-nautilus Conflicts: rabbitvcs-nautilus3

Debian ( Changelog | PTS | Bugs ) Ubuntu ( Changelog | txt | LP | Bugs ) | Diff from Ubuntu

Source: targetcli-fb

targetcli-fb (1:2.1.53-1ubuntu1) groovy; urgency=medium * New upstream version 2.1.53 * Dropped changes (no more needed): - d/manpages: install targetclid man page - d/rules: install and enable targetclid service and socket -- Rafael David Tinoco <rafaeldtinoco@ubuntu.com> Sat, 25 Jul 2020 05:28:40 +0000

Modifications :
  1. Download patch targetcli/ui_backstore.py

    --- 2.1.fb49-1/targetcli/ui_backstore.py 2018-09-05 12:08:11.000000000 +0000 +++ 1:2.1.53-1ubuntu1/targetcli/ui_backstore.py 2020-06-24 08:14:04.000000000 +0000 @@ -59,14 +59,14 @@ def human_to_bytes(hsize, kilo=1024): ''' This function converts human-readable amounts of bytes to bytes. It understands the following units : - - I{B} or no unit present for Bytes - - I{k}, I{K}, I{kB}, I{KB} for kB (kilobytes) - - I{m}, I{M}, I{mB}, I{MB} for MB (megabytes) - - I{g}, I{G}, I{gB}, I{GB} for GB (gigabytes) - - I{t}, I{T}, I{tB}, I{TB} for TB (terabytes) + - B or no unit present for Bytes + - k, K, kB, KB for kB (kilobytes) + - m, M, mB, MB for MB (megabytes) + - g, G, gB, GB for GB (gigabytes) + - t, T, tB, TB for TB (terabytes) - Note: The definition of I{kilo} defaults to 1kB = 1024Bytes. - Strictly speaking, those should not be called I{kB} but I{kiB}. + Note: The definition of kilo defaults to 1kB = 1024Bytes. + Strictly speaking, those should not be called "kB" but "kiB". You can override that with the optional kilo parameter. @param hsize: The human-readable version of the Bytes amount to convert @@ -286,13 +286,13 @@ class UIBackstore(UINode): def ui_command_delete(self, name, save=None): ''' - Recursively deletes the storage object having the specified I{name}. If + Recursively deletes the storage object having the specified name. If there are LUNs using this storage object, they will be deleted too. EXAMPLE ======= - B{delete mystorage} - ------------------- + delete mystorage + ---------------- Deletes the storage object named mystorage, and all associated LUNs. ''' self.assert_root() @@ -354,7 +354,7 @@ class UIPSCSIBackstore(UIBackstore): def ui_command_create(self, name, dev): ''' Creates a PSCSI storage object, with supplied name and SCSI device. The - SCSI device I{dev} can either be a path name to the device, in which + SCSI device "dev" can either be a path name to the device, in which case it is recommended to use the /dev/disk/by-id hierarchy to have consistent naming should your physical SCSI system be modified, or an SCSI device ID in the H:C:T:L format, which is not recommended as SCSI @@ -383,17 +383,17 @@ class UIRDMCPBackstore(UIBackstore): def ui_command_create(self, name, size, nullio=None, wwn=None): ''' - Creates an RDMCP storage object. I{size} is the size of the ramdisk. + Creates an RDMCP storage object. "size" is the size of the ramdisk. SIZE SYNTAX =========== - If size is an int, it represents a number of bytes. - If size is a string, the following units can be used: - - B{B} or no unit present for bytes - - B{k}, B{K}, B{kB}, B{KB} for kB (kilobytes) - - B{m}, B{M}, B{mB}, B{MB} for MB (megabytes) - - B{g}, B{G}, B{gB}, B{GB} for GB (gigabytes) - - B{t}, B{T}, B{tB}, B{TB} for TB (terabytes) + - B or no unit present for bytes + - k, K, kB, KB for kB (kilobytes) + - m, M, mB, MB for MB (megabytes) + - g, G, gB, GB for GB (gigabytes) + - t, T, tB, TB for TB (terabytes) ''' self.assert_root() @@ -445,14 +445,14 @@ class UIFileIOBackstore(UIBackstore): def ui_command_create(self, name, file_or_dev, size=None, write_back=None, sparse=None, wwn=None): ''' - Creates a FileIO storage object. If I{file_or_dev} is a path - to a regular file to be used as backend, then the I{size} - parameter is mandatory. Else, if I{file_or_dev} is a path to a - block device, the size parameter B{must} be ommited. If - present, I{size} is the size of the file to be used, I{file} - the path to the file or I{dev} the path to a block device. The - I{write_back} parameter is a boolean controlling write - caching. It is enabled by default. The I{sparse} parameter is + Creates a FileIO storage object. If "file_or_dev" is a path + to a regular file to be used as backend, then the "size" + parameter is mandatory. Else, if "file_or_dev" is a path to a + block device, the size parameter must be omitted. If + present, "size" is the size of the file to be used, "file" + the path to the file or "dev" the path to a block device. The + "write_back" parameter is a boolean controlling write + caching. It is enabled by default. The "sparse" parameter is only applicable when creating a new backing file. It is a boolean stating if the created file should be created as a sparse file (the default), or fully initialized. @@ -461,11 +461,11 @@ class UIFileIOBackstore(UIBackstore): =========== - If size is an int, it represents a number of bytes. - If size is a string, the following units can be used: - - B{B} or no unit present for bytes - - B{k}, B{K}, B{kB}, B{KB} for kB (kilobytes) - - B{m}, B{M}, B{mB}, B{MB} for MB (megabytes) - - B{g}, B{G}, B{gB}, B{GB} for GB (gigabytes) - - B{t}, B{T}, B{tB}, B{TB} for TB (terabytes) + - B or no unit present for bytes + - k, K, kB, KB for kB (kilobytes) + - m, M, mB, MB for MB (megabytes) + - g, G, gB, GB for GB (gigabytes) + - t, T, tB, TB for TB (terabytes) ''' self.assert_root() @@ -557,7 +557,7 @@ class UIBlockBackstore(UIBackstore): def ui_command_create(self, name, dev, readonly=None, wwn=None): ''' - Creates an Block Storage object. I{dev} is the path to the TYPE_DISK + Creates an Block Storage object. "dev" is the path to the TYPE_DISK block device to use. ''' self.assert_root() @@ -628,11 +628,11 @@ class UIUserBackedBackstore(UIBackstore) =========== - If size is an int, it represents a number of bytes. - If size is a string, the following units can be used: - - B{B} or no unit present for bytes - - B{k}, B{K}, B{kB}, B{KB} for kB (kilobytes) - - B{m}, B{M}, B{mB}, B{MB} for MB (megabytes) - - B{g}, B{G}, B{gB}, B{GB} for GB (gigabytes) - - B{t}, B{T}, B{tB}, B{TB} for TB (terabytes) + - B or no unit present for bytes + - k, K, kB, KB for kB (kilobytes) + - m, M, mB, MB for MB (megabytes) + - g, G, gB, GB for GB (gigabytes) + - t, T, tB, TB for TB (terabytes) ''' size = human_to_bytes(size) @@ -689,6 +689,7 @@ class UIStorageObject(UIRTSLibNode): 'emulate_tpws': ('number', 'If set to 1, enable Thin Provisioning Write Same.'), 'emulate_ua_intlck_ctrl': ('number', 'If set to 1, enable Unit Attention Interlock.'), 'emulate_write_cache': ('number', 'If set to 1, turn on Write Cache Enable.'), + 'emulate_pr': ('number', 'If set to 1, enable SCSI Reservations.'), 'enforce_pr_isids': ('number', 'If set to 1, enforce persistent reservation ISIDs.'), 'force_pr_aptpl': ('number', 'If set to 1, force SPC-3 PR Activate Persistence across Target Power Loss operation.'), 'fabric_max_sectors': ('number', 'Maximum number of sectors the fabric can transfer at once.'),
  2. Download patch targetcli/ui_root.py

    --- 2.1.fb49-1/targetcli/ui_root.py 2018-09-05 12:08:11.000000000 +0000 +++ 1:2.1.53-1ubuntu1/targetcli/ui_root.py 2020-06-24 08:14:04.000000000 +0000 @@ -24,6 +24,7 @@ import re import shutil import stat import filecmp +import gzip from configshell_fb import ExecutionError from rtslib_fb import RTSRoot @@ -62,6 +63,58 @@ class UIRoot(UINode): if fm.wwns == None or any(fm.wwns): UIFabricModule(fm, self) + def _compare_files(self, backupfile, savefile): + ''' + Compare backfile and saveconfig file + ''' + if (os.path.splitext(backupfile)[1] == '.gz'): + try: + with gzip.open(backupfile, 'rb') as fbkp: + fdata_bkp = fbkp.read() + except IOError as e: + self.shell.log.warning("Could not gzip open backupfile %s: %s" + % (backupfile, e.strerror)) + + else: + try: + with open(backupfile, 'rb') as fbkp: + fdata_bkp = fbkp.read() + except IOError as e: + self.shell.log.warning("Could not open backupfile %s: %s" + % (backupfile, e.strerror)) + + try: + with open(savefile, 'rb') as f: + fdata = f.read() + except IOError as e: + self.shell.log.warning("Could not open saveconfig file %s: %s" + % (savefile, e.strerror)) + + if fdata_bkp == fdata: + return True + else: + return False + + def _create_dir(self, dirname): + ''' + create directory with permissions 0o600 set + if directory already exists, set right perms + ''' + mode = stat.S_IRUSR | stat.S_IWUSR # 0o600 + if not os.path.exists(dirname): + umask = 0o777 ^ mode # Prevents always downgrading umask to 0 + umask_original = os.umask(umask) + try: + os.makedirs(dirname, mode) + except OSError as exe: + raise ExecutionError("Cannot create directory [%s] %s." + % (dirname, exe.strerror)) + finally: + os.umask(umask_original) + else: + if (os.stat(dirname).st_mode & 0o777) != mode: + os.chmod(dirname, mode) + def _save_backups(self, savefile): ''' Take backup of config-file if needed. @@ -72,31 +125,32 @@ class UIRoot(UINode): backup_dir = os.path.dirname(savefile) + "/backup/" backup_name = "saveconfig-" + \ - datetime.now().strftime("%Y%m%d-%H:%M:%S") + ".json" + datetime.now().strftime("%Y%m%d-%H:%M:%S") + "-json.gz" backupfile = backup_dir + backup_name backup_error = None - if not os.path.exists(backup_dir): - try: - os.makedirs(backup_dir); - except OSError as exe: - raise ExecutionError("Cannot create backup directory [%s] %s." - % (backup_dir, exc.strerror)) + self._create_dir(backup_dir) # Only save backups if savefile exits if not os.path.exists(savefile): return backed_files_list = sorted(glob(os.path.dirname(savefile) + \ - "/backup/*.json")) + "/backup/saveconfig-*json*")) # Save backup if backup dir is empty, or savefile is differnt from recent backup copy - if not backed_files_list or not filecmp.cmp(backed_files_list[-1], savefile): + if not backed_files_list or not self._compare_files(backed_files_list[-1], savefile): + mode = stat.S_IRUSR | stat.S_IWUSR # 0o600 + umask = 0o777 ^ mode # Prevents always downgrading umask to 0 + umask_original = os.umask(umask) try: - shutil.copy(savefile, backupfile) - + with open(savefile, 'rb') as f_in, gzip.open(backupfile, 'wb') as f_out: + shutil.copyfileobj(f_in, f_out) + f_out.flush() except IOError as ioe: backup_error = ioe.strerror or "Unknown error" + finally: + os.umask(umask_original) if backup_error == None: # remove excess backups @@ -133,13 +187,16 @@ class UIRoot(UINode): savefile = os.path.expanduser(savefile) + save_dir = os.path.dirname(savefile) + self._create_dir(save_dir) self._save_backups(savefile) self.rtsroot.save_to_file(savefile) self.shell.log.info("Configuration saved to %s" % savefile) - def ui_command_restoreconfig(self, savefile=default_save_file, clear_existing=False): + def ui_command_restoreconfig(self, savefile=default_save_file, clear_existing=False, + target=None, storage_object=None): ''' Restores configuration from a file. ''' @@ -151,7 +208,10 @@ class UIRoot(UINode): self.shell.log.info("Restore file %s not found" % savefile) return - errors = self.rtsroot.restore_from_file(savefile, clear_existing) + target = self.ui_eval_param(target, 'string', None) + storage_object = self.ui_eval_param(storage_object, 'string', None) + errors = self.rtsroot.restore_from_file(savefile, clear_existing, + target, storage_object) self.refresh() @@ -202,15 +262,15 @@ class UIRoot(UINode): PARAMETERS ========== - I{action} - --------- - The I{action} is one of: - - B{list} gives a short session list - - B{detail} gives a detailed list - - I{sid} + action ------ - You can specify an I{sid} to only list this one, + The action is one of: + - `list`` gives a short session list + - `detail` gives a detailed list + + sid + --- + You can specify an "sid" to only list this one, with or without details. SEE ALSO @@ -283,4 +343,3 @@ class UIRoot(UINode): indent_print("(no open sessions)", base_steps) else: raise ExecutionError("no session found with sid %i" % int(sid)) -
  3. Download patch debian/tests/saveconfig.sh

    --- 2.1.fb49-1/debian/tests/saveconfig.sh 1970-01-01 00:00:00.000000000 +0000 +++ 1:2.1.53-1ubuntu1/debian/tests/saveconfig.sh 2020-07-24 21:34:04.000000000 +0000 @@ -0,0 +1,20 @@ +#!/bin/bash + +configdir="/etc/rtslib-fb-target" +configfile="${configdir}/saveconfig.json" + +set -e + +targetcli /iscsi create + +targetcli saveconfig + +if [[ ! -d ${configdir} || ! -f ${configfile} ]] +then + echo "targetcli should use $configdir" + exit 1 +fi + +targetcli clearconfig confirm=True + +exit 0
  4. Download patch debian/tests/control

    --- 2.1.fb49-1/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 +++ 1:2.1.53-1ubuntu1/debian/tests/control 2020-07-24 21:34:04.000000000 +0000 @@ -0,0 +1,7 @@ +Tests: ramdiskluns.sh +Restrictions: needs-root, isolation-machine +Depends: targetcli-fb + +Tests: saveconfig.sh +Restrictions: needs-root, isolation-machine +Depends: targetcli-fb
  5. Download patch debian/tests/ramdiskluns.sh

    --- 2.1.fb49-1/debian/tests/ramdiskluns.sh 1970-01-01 00:00:00.000000000 +0000 +++ 1:2.1.53-1ubuntu1/debian/tests/ramdiskluns.sh 2020-07-24 21:34:04.000000000 +0000 @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e + +targetcli /backstores/ramdisk create lun01 10240k + +targetcli /backstores/ramdisk create lun02 50m + +targetcli /iscsi create + +iqn=$(targetcli /iscsi/ ls . 1 | tail -1 | awk '{print $2}') + +targetcli /iscsi/${iqn}/tpg1/luns create lun=lun01 /backstores/ramdisk/lun01 + +targetcli /iscsi/${iqn}/tpg1/luns create lun=lun02 /backstores/ramdisk/lun02 + +targetcli clearconfig confirm=True + +exit 0
  6. Download patch debian/rules

    --- 2.1.fb49-1/debian/rules 2019-08-02 15:09:26.000000000 +0000 +++ 1:2.1.53-1ubuntu1/debian/rules 2020-07-24 21:34:04.000000000 +0000 @@ -1,4 +1,34 @@ #!/usr/bin/make -f +export DH_VERBOSE=1 + +include /usr/share/dpkg/default.mk + %: - dh $@ --with python3 -Spybuild + dh $@ --with python3 --buildsystem=pybuild + +override_dh_auto_build: + pybuild --configure + pybuild --build + +override_dh_auto_install: + pybuild --install + +override_dh_auto_clean: + rm -rf .pybuild/ + rm -rf build/ + rm -rf *.egg-info/ + +override_dh_installman: + dh_installman targetcli.8 + dh_installman targetclid.8 + +override_dh_installdocs: + dh_installdocs README.md + dh_installdocs THANKS + dh_installdocs COPYING + +override_dh_installsystemd: + dh_installsystemd \ + --no-stop-on-upgrade --no-enable --no-start \ + targetclid.service
  7. Download patch targetcli/ui_node.py

    --- 2.1.fb49-1/targetcli/ui_node.py 2018-09-05 12:08:11.000000000 +0000 +++ 1:2.1.53-1ubuntu1/targetcli/ui_node.py 2020-06-24 08:14:04.000000000 +0000 @@ -49,6 +49,12 @@ class UINode(ConfigNode): self.define_config_group_param( 'global', 'max_backup_files', 'string', 'Max no. of configurations to be backed up in /etc/target/backup/ directory.') + self.define_config_group_param( + 'global', 'auto_use_daemon', 'bool', + 'If true, commands will be sent to targetclid.') + self.define_config_group_param( + 'global', 'daemon_use_batch_mode', 'bool', + 'If true, use batch mode for daemonized approach.') def assert_root(self): ''' @@ -95,7 +101,7 @@ class UINode(ConfigNode): SEE ALSO ======== - B{ls} + ls ''' description, is_healthy = self.summary() self.shell.log.info("Status for %s: %s" % (self.path, description))
  8. Download patch debian/control

    --- 2.1.fb49-1/debian/control 2019-08-02 15:15:40.000000000 +0000 +++ 1:2.1.53-1ubuntu1/debian/control 2020-07-25 05:28:40.000000000 +0000 @@ -1,7 +1,8 @@ Source: targetcli-fb Section: admin Priority: optional -Maintainer: Debian LIO Target Packagers <team+linux-blocks@tracker.debian.org> +Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> +XSBC-Original-Maintainer: Debian LIO Target Packagers <team+linux-blocks@tracker.debian.org> Uploaders: Christophe Vu-Brugier <cvubrugier@fastmail.fm>, Ritesh Raj Sarraf <rrs@debian.org>, Christian Seiler <christian@iwakd.de>
  9. Download patch debian/targetcli-fb.install

    --- 2.1.fb49-1/debian/targetcli-fb.install 1970-01-01 00:00:00.000000000 +0000 +++ 1:2.1.53-1ubuntu1/debian/targetcli-fb.install 2020-07-24 21:34:04.000000000 +0000 @@ -0,0 +1,5 @@ +usr/bin/targetclid /usr/bin +usr/bin/targetcli /usr/bin +usr/lib/python3.8/dist-packages/targetcli /usr/lib/python3/dist-packages +systemd/targetclid.service /lib/systemd/system +systemd/targetclid.socket /lib/systemd/system
  10. Download patch systemd/targetclid.socket

    --- 2.1.fb49-1/systemd/targetclid.socket 1970-01-01 00:00:00.000000000 +0000 +++ 1:2.1.53-1ubuntu1/systemd/targetclid.socket 2020-06-24 08:14:04.000000000 +0000 @@ -0,0 +1,10 @@ +[Unit] +Description=targetclid socket +Documentation=man:targetclid(8) + +[Socket] +ListenStream=/var/run/targetclid.sock +SocketMode=0600 + +[Install] +WantedBy=sockets.target
  11. Download patch targetcli/version.py

    --- 2.1.fb49-1/targetcli/version.py 2018-09-05 12:08:11.000000000 +0000 +++ 1:2.1.53-1ubuntu1/targetcli/version.py 2020-06-24 08:14:04.000000000 +0000 @@ -15,4 +15,4 @@ License for the specific language govern under the License. ''' -__version__ = '2.1.fb49' +__version__ = '2.1.53'
  12. Download patch targetcli/ui_target.py
  13. Download patch scripts/targetcli
  14. Download patch targetcli.8

    --- 2.1.fb49-1/targetcli.8 2018-09-05 12:08:11.000000000 +0000 +++ 1:2.1.53-1ubuntu1/targetcli.8 2020-06-24 08:14:04.000000000 +0000 @@ -10,6 +10,11 @@ administrator to assign local storage re files, volumes, local SCSI devices, or ramdisk, and export them to remote systems via network fabrics, such as iSCSI or FCoE. .P +There is a daemon component for targetcli, which will greatly improve +the overall execution time taken by targetcli commands at scale. For +more details about switching to daemonized mode refer to targetclid(8) +man page. +.P The configuration layout is tree-based, similar to a filesystem, and is navigated in a similar manner. .SH USAGE @@ -458,8 +463,9 @@ the userid and password for full-feature .B /etc/target/backup/* .SH ENVIRONMENT .SS TARGETCLI_HOME -If set, this variable points to a directory that should be used instead of ~/.targetctl +If set, this variable points to a directory that should be used instead of ~/.targetcli .SH SEE ALSO +.BR targetclid (8), .BR targetctl (8), .BR tcmu-runner (8) .SH AUTHOR
  15. Download patch debian/watch

    --- 2.1.fb49-1/debian/watch 2019-08-02 15:09:26.000000000 +0000 +++ 1:2.1.53-1ubuntu1/debian/watch 2020-07-24 21:34:04.000000000 +0000 @@ -1,3 +1,3 @@ version=4 -opts=uversionmangle=s/fb//,filenamemangle=s/.+\/v?(\d\S+)\.tar\.gz/targetcli-fb-$1\.tar\.gz/ \ - https://github.com/open-iscsi/targetcli-fb/releases .*/v?(\d\S+)\.tar\.gz +opts=uversionmangle=s/fb//,dversionmangle=s/fb//,filenamemangle=s/.+\/v?(\d\S+)\.tar\.gz/targetcli-fb-$1\.tar\.gz/ \ + https://github.com/open-iscsi/targetcli-fb/releases .*/v?(\d\S+)\.tar\.gz
  16. Download patch debian/patches/series

    --- 2.1.fb49-1/debian/patches/series 2019-08-02 15:15:33.000000000 +0000 +++ 1:2.1.53-1ubuntu1/debian/patches/series 2020-07-24 21:34:04.000000000 +0000 @@ -1 +1 @@ -0003-Use-etc-rtslib-fb-target-instead-of-etc-target.patch +use-rtslib-fb-target-instead-of-etc-target.patch
  17. Download patch systemd/targetclid.service

    --- 2.1.fb49-1/systemd/targetclid.service 1970-01-01 00:00:00.000000000 +0000 +++ 1:2.1.53-1ubuntu1/systemd/targetclid.service 2020-06-24 08:14:04.000000000 +0000 @@ -0,0 +1,13 @@ +[Unit] +Description=Targetcli daemon +Documentation=man:targetclid(8) +After=network.target + +[Service] +Type=simple +ExecStart=/usr/bin/targetclid +Restart=on-failure + +[Install] +WantedBy=multi-user.target +Also=targetclid.socket
  18. Download patch setup.py

    --- 2.1.fb49-1/setup.py 2018-09-05 12:08:11.000000000 +0000 +++ 1:2.1.53-1ubuntu1/setup.py 2020-06-24 08:14:04.000000000 +0000 @@ -30,7 +30,11 @@ setup( maintainer_email = 'agrover@redhat.com', url = 'http://github.com/open-iscsi/targetcli-fb', packages = ['targetcli'], - scripts = ['scripts/targetcli'], + scripts = [ + 'scripts/targetcli', + 'daemon/targetclid' + ], + data_files = [('/lib/systemd/system', ['systemd/targetclid.socket', 'systemd/targetclid.service'])], classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3",
  19. Download patch debian/patches/0003-Use-etc-rtslib-fb-target-instead-of-etc-target.patch

    --- 2.1.fb49-1/debian/patches/0003-Use-etc-rtslib-fb-target-instead-of-etc-target.patch 2019-08-02 15:15:40.000000000 +0000 +++ 1:2.1.53-1ubuntu1/debian/patches/0003-Use-etc-rtslib-fb-target-instead-of-etc-target.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -From: Christian Seiler <christian@iwakd.de> -Date: Sun, 2 Oct 2016 19:14:17 +0200 -Subject: Use /etc/rtslib-fb-target instead of /etc/target - -Debian's python-rtslib-fb package changes /etc/target to -/etc/rtslib-fb-target. Follow suite for now to make sure that targetcli -is compatible with the startup logic in python-rtslib-fb and will work -out of the box. ---- - targetcli.8 | 8 ++++---- - targetcli/ui_root.py | 4 ++-- - 2 files changed, 6 insertions(+), 6 deletions(-) - ---- a/targetcli.8 -+++ b/targetcli.8 -@@ -355,7 +355,7 @@ - Save the current configuration settings to a file, from which settings - will be restored if the system is rebooted. By default, this will save - the configuration to --.IR /etc/target/saveconfig.json . -+.IR /etc/rtslib-fb-target/saveconfig.json . - .P - This command is executed from the configuration root node. - .P -@@ -415,7 +415,7 @@ - to change working path to newly-created nodes. Global settings - are user-specific and are saved to ~/.targetcli/ upon exit, unlike - other groups, which are system-wide and kept in --.BR /etc/target/saveconfig.json . -+.BR /etc/rtslib-fb-target/saveconfig.json . - .SS BACKSTORE-SPECIFIC - .B attribute - .br -@@ -453,9 +453,9 @@ - /iscsi/<target_iqn>/tpgX/acls/<initiator_iqn> configuration node. Set - the userid and password for full-feature phase for this ACL. - .SH FILES --.B /etc/target/saveconfig.json -+.B /etc/rtslib-fb-target/saveconfig.json - .br --.B /etc/target/backup/* -+.B /etc/rtslib-fb-target/backup/* - .SH ENVIRONMENT - .SS TARGETCLI_HOME - If set, this variable points to a directory that should be used instead of ~/.targetctl ---- a/targetcli/ui_root.py -+++ b/targetcli/ui_root.py -@@ -33,8 +33,8 @@ - from .ui_node import UINode - from .ui_target import UIFabricModule - --default_save_file = "/etc/target/saveconfig.json" --universal_prefs_file = "/etc/target/targetcli.conf" -+default_save_file = "/etc/rtslib-fb-target/saveconfig.json" -+universal_prefs_file = "/etc/rtslib-fb-target/targetcli.conf" - - class UIRoot(UINode): - '''
  20. Download patch daemon/targetclid
  21. Download patch debian/patches/use-rtslib-fb-target-instead-of-etc-target.patch

    --- 2.1.fb49-1/debian/patches/use-rtslib-fb-target-instead-of-etc-target.patch 1970-01-01 00:00:00.000000000 +0000 +++ 1:2.1.53-1ubuntu1/debian/patches/use-rtslib-fb-target-instead-of-etc-target.patch 2020-07-24 21:34:04.000000000 +0000 @@ -0,0 +1,100 @@ +From: Christian Seiler <christian@iwakd.de> +Date: Sun, 2 Oct 2016 19:14:17 +0200 +Subject: Use /etc/rtslib-fb-target instead of /etc/target + +Debian's python-rtslib-fb package changes /etc/target to /etc/rtslib-fb-target. +Follow suite for now to make sure that targetcli is compatible with the startup +logic in python-rtslib-fb and will work out of the box. + +Reviewed-By: Rafael David Tinoco <rafaeldtinoco@ubuntu.com> +Last-Update: 2020-06-24 + +--- + targetcli.8 | 8 ++++---- + targetcli/ui_backstore.py | 2 +- + targetcli/ui_node.py | 2 +- + targetcli/ui_root.py | 4 ++-- + targetclid.8 | 4 ++-- + 5 files changed, 10 insertions(+), 10 deletions(-) + +--- a/targetcli.8 ++++ b/targetcli.8 +@@ -360,7 +360,7 @@ + Save the current configuration settings to a file, from which settings + will be restored if the system is rebooted. By default, this will save + the configuration to +-.IR /etc/target/saveconfig.json . ++.IR /etc/rtslib-fb-target/saveconfig.json . + .P + This command is executed from the configuration root node. + .P +@@ -420,7 +420,7 @@ + to change working path to newly-created nodes. Global settings + are user-specific and are saved to ~/.targetcli/ upon exit, unlike + other groups, which are system-wide and kept in +-.BR /etc/target/saveconfig.json . ++.BR /etc/rtslib-fb-target/saveconfig.json . + .SS BACKSTORE-SPECIFIC + .B attribute + .br +@@ -458,9 +458,9 @@ + /iscsi/<target_iqn>/tpgX/acls/<initiator_iqn> configuration node. Set + the userid and password for full-feature phase for this ACL. + .SH FILES +-.B /etc/target/saveconfig.json ++.B /etc/rtslib-fb-target/saveconfig.json + .br +-.B /etc/target/backup/* ++.B /etc/rtslib-fb-target/backup/* + .SH ENVIRONMENT + .SS TARGETCLI_HOME + If set, this variable points to a directory that should be used instead of ~/.targetcli +--- a/targetcli/ui_backstore.py ++++ b/targetcli/ui_backstore.py +@@ -36,7 +36,7 @@ + + from .ui_node import UINode, UIRTSLibNode + +-default_save_file = "/etc/target/saveconfig.json" ++default_save_file = "/etc/rtslib-fb-target/saveconfig.json" + + alua_rw_params = ['alua_access_state', 'alua_access_status', + 'alua_write_metadata', 'alua_access_type', 'preferred', +--- a/targetcli/ui_node.py ++++ b/targetcli/ui_node.py +@@ -48,7 +48,7 @@ + 'If true, adds a portal listening on all IPs to new targets.') + self.define_config_group_param( + 'global', 'max_backup_files', 'string', +- 'Max no. of configurations to be backed up in /etc/target/backup/ directory.') ++ 'Max no. of configurations to be backed up in /etc/rtslib-fb-target/backup/ directory.') + self.define_config_group_param( + 'global', 'auto_use_daemon', 'bool', + 'If true, commands will be sent to targetclid.') +--- a/targetcli/ui_root.py ++++ b/targetcli/ui_root.py +@@ -34,8 +34,8 @@ + from .ui_node import UINode + from .ui_target import UIFabricModule + +-default_save_file = "/etc/target/saveconfig.json" +-universal_prefs_file = "/etc/target/targetcli.conf" ++default_save_file = "/etc/rtslib-fb-target/saveconfig.json" ++universal_prefs_file = "/etc/rtslib-fb-target/targetcli.conf" + + class UIRoot(UINode): + ''' +--- a/targetclid.8 ++++ b/targetclid.8 +@@ -80,9 +80,9 @@ + .br + $ targetcli --disable-daemon + .SH FILES +-.B /etc/target/saveconfig.json ++.B /etc/rtslib-fb-target/saveconfig.json + .br +-.B /etc/target/backup/* ++.B /etc/rtslib-fb-target/backup/* + .br + .B /var/run/targetclid.sock + .br
  22. Download patch targetclid.8

    --- 2.1.fb49-1/targetclid.8 1970-01-01 00:00:00.000000000 +0000 +++ 1:2.1.53-1ubuntu1/targetclid.8 2020-06-24 08:14:04.000000000 +0000 @@ -0,0 +1,104 @@ +.TH targetclid 8 +.SH NAME +.B targetclid +\- daemon component for targetcli +.SH DESCRIPTION +.B targetclid +is the daemon component of targetcli, which will help retain state of various +configfs object in memory, hence any new request/command can directly use the +in memory objects instead of reconstructing them by parsing through the entire +configfs files again and again for each and every single command. This will +greatly improve the overall execution time taken by targetcli commands at scale. + +.SH USAGE +.B targetclid [cmd] +.br +.B "--help" +for additional usage information. +.br +.B "--version" +for version information. +.SH QUICKSTART & EXAMPLES +.TP +To start using the daemon, one need to enable targetclid socket, +.br +$ systemctl enable targetclid.socket +.TP +If you would like to use the daemonized approach as default method then, +.br +$ targetcli set global auto_use_daemon=true +.br +$ targetcli ls +.TP +You can use interactive mode, +.br +$ targetcli <hit-enter> +.br +targetcli shell version 2.1.51 +.br +Entering targetcli interactive mode for daemonized approach. +.br +Type 'exit' to quit. +.br +/> pwd +.br +/ +.br +/> cd /iscsi +.br +/> pwd +.br +/iscsi +.br +/> exit +.br +.TP +You can also use batch mode for sending multiple commands in one go, +.br +$ targetcli set global daemon_use_batch_mode=true +.br +Parameter daemon_use_batch_mode is now 'true'. +.br +$ targetcli <hit-enter> +.br +targetcli shell version 2.1.51 +.br +Entering targetcli batch mode for daemonized approach. +.br +Enter multiple commands separated by newline and type 'exit' to run them all in one go. +.br +/> ls +.br +/> pwd +.br +/> get global loglevel_file +.br +/> exit +.br +.TP +You can set preference to stop using daemonized mode even when the daemon is not running, +.br +$ targetcli --disable-daemon +.SH FILES +.B /etc/target/saveconfig.json +.br +.B /etc/target/backup/* +.br +.B /var/run/targetclid.sock +.br +.B /var/run/targetclid.pid +.SH ENVIRONMENT +.SS TARGETCLI_HOME +If set, this variable points to a directory that should be used instead of ~/.targetcli +.SH SEE ALSO +.BR targetcli (8), +.BR targetctl (8), +.BR tcmu-runner (8) +.SH AUTHOR +Written by Prasanna Kumar Kalever <prasanna.kalever@redhat.com> +.br +Man page written by Prasanna Kumar Kalever <prasanna.kalever@redhat.com> +.SH REPORTING BUGS +Report bugs via <targetcli-fb-devel@lists.fedorahosted.org> +.br +or <https://github.com/open-iscsi/targetcli-fb/issues>
  1. multipath-tools
  2. open-iscsi
  3. python-configshell-fb
  4. rabbitvcs
  5. targetcli-fb