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-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/initramfs/local-top

    --- 0.8.4-4/debian/initramfs/local-top 2020-08-30 01:14:10.000000000 +0000 +++ 0.8.4-4ubuntu1/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 -
  2. 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-4ubuntu1/debian/initramfs/local-bottom 2020-07-08 03:59:53.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 +
  3. 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-4ubuntu1/debian/kpartx-boot.postrm 2020-07-08 03:59:53.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 + +
  4. 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-4ubuntu1/debian/multipath-tools.dm-mpath-lvm.udev 2020-07-08 03:59:53.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"
  5. Download patch debian/rules

    --- 0.8.4-4/debian/rules 2020-08-30 01:14:10.000000000 +0000 +++ 0.8.4-4ubuntu1/debian/rules 2020-08-30 22:08:51.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
  6. 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-4ubuntu1/debian/multipath-tools.install 2020-08-30 03:39:41.000000000 +0000 @@ -14,3 +14,4 @@ /usr/include/libdmmp/libdmmp.h /lib/systemd/system/multipathd.service /lib/systemd/system/multipathd.socket +/etc/multipath.conf
  7. Download patch debian/control

    --- 0.8.4-4/debian/control 2020-08-30 01:14:10.000000000 +0000 +++ 0.8.4-4ubuntu1/debian/control 2020-08-30 22:06:43.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
  8. Download patch debian/tests/tgtbasedmpaths

    --- 0.8.4-4/debian/tests/tgtbasedmpaths 2020-08-30 01:14:10.000000000 +0000 +++ 0.8.4-4ubuntu1/debian/tests/tgtbasedmpaths 2020-08-30 03:39:41.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"
  9. 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-4ubuntu1/debian/patches/kpartx-Improve-finding-loopback-device-by-file.patch 2020-08-30 22:09:54.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; + }
  10. 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-4ubuntu1/debian/patches/disable-fexceptions-udeb.patch 2020-08-30 22:09:30.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 \
  11. 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-4ubuntu1/debian/multipath-udeb.install 2020-08-30 03:39:41.000000000 +0000 @@ -2,3 +2,4 @@ /lib/multipath/ /lib/libmultipath.so.* /lib/libmpathcmd.so* +/etc/multipath.conf \ No newline at end of file
  12. 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-4ubuntu1/debian/kpartx-boot.postinst 2020-07-08 03:59:53.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 + +
  13. 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-4ubuntu1/debian/patches/kpartx-print-loop-deleted-to-stdout-not-stderr.patch 2020-08-30 22:10:06.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 +
  14. Download patch debian/multipath.conf

    --- 0.8.4-4/debian/multipath.conf 1970-01-01 00:00:00.000000000 +0000 +++ 0.8.4-4ubuntu1/debian/multipath.conf 2020-07-08 03:59:53.000000000 +0000 @@ -0,0 +1,3 @@ +defaults { + user_friendly_names yes +}
  15. Download patch debian/patches/series

    --- 0.8.4-4/debian/patches/series 2020-08-30 01:14:10.000000000 +0000 +++ 0.8.4-4ubuntu1/debian/patches/series 2020-08-30 22:09:11.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
  16. 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-4ubuntu1/debian/patches/no-start-in-containers.patch 2020-07-08 03:59:53.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
  17. Download patch debian/kpartx.install

    --- 0.8.4-4/debian/kpartx.install 2020-08-30 01:14:10.000000000 +0000 +++ 0.8.4-4ubuntu1/debian/kpartx.install 2020-08-30 03:39:40.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
  18. 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-4ubuntu1/debian/initramfs/kpartx.hook 2020-07-08 03:59:53.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/
  19. 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-4ubuntu1/debian/patches/newer-jsonc.patch 2020-07-31 08:20:36.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
  20. 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-4ubuntu1/debian/initramfs/init-top 2020-08-30 03:39:41.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
  21. 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-4ubuntu1/debian/initramfs/local-premount 2020-07-08 03:59:53.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
  22. Download patch debian/initramfs/hooks

    --- 0.8.4-4/debian/initramfs/hooks 2020-08-30 01:14:10.000000000 +0000 +++ 0.8.4-4ubuntu1/debian/initramfs/hooks 2020-08-30 03:39:41.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
  23. 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-4ubuntu1/debian/patches/enable-find-multipaths.patch 2020-08-30 22:09:42.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
  24. 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-4ubuntu1/debian/patches/kpartx_more_loopback_fixes.patch 2020-08-30 22:10:26.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)) {
  1. multipath-tools