[Pkg-zfsonlinux-devel] [SCM] zfs branch, master, updated. debian/0.6.5.8-3-35-g024b8de

Aron Xu aron at debian.org
Fri Oct 6 16:20:03 UTC 2017


The following commit has been merged in the master branch:
commit 1c416e32700ec6472e22bad43e4eddc402b159d1
Author: Aron Xu <aron at debian.org>
Date:   Sat Oct 7 00:02:39 2017 +0800

    Drop merged patches, update remainders

diff --git a/debian/patches/0001-Prevent-manual-builds-in-the-DKMS-source.patch b/debian/patches/0001-Prevent-manual-builds-in-the-DKMS-source.patch
index 2a36884..bc00ad9 100644
--- a/debian/patches/0001-Prevent-manual-builds-in-the-DKMS-source.patch
+++ b/debian/patches/0001-Prevent-manual-builds-in-the-DKMS-source.patch
@@ -5,12 +5,12 @@ Author: unknown
 Origin: ubuntu
 Forwarded: no
 Reviewed-By: Petter Reinholdtsen <pere at hungry.com>
-Last-Update: 2016-05-12
+Last-Update: 2017-10-06
 
-Index: zfs-linux-0.6.5.6/config/dkms.m4
+Index: zfs/config/dkms.m4
 ===================================================================
 --- /dev/null
-+++ zfs-linux-0.6.5.6/config/dkms.m4
++++ zfs/config/dkms.m4
 @@ -0,0 +1,14 @@
 +dnl #
 +dnl # Prevent manual building in DKMS source tree.
@@ -26,10 +26,10 @@ Index: zfs-linux-0.6.5.6/config/dkms.m4
 +		AC_MSG_RESULT([not found])
 +        ])
 +])
-Index: zfs-linux-0.6.5.6/config/user.m4
+Index: zfs/config/user.m4
 ===================================================================
---- zfs-linux-0.6.5.6.orig/config/user.m4
-+++ zfs-linux-0.6.5.6/config/user.m4
+--- zfs.orig/config/user.m4
++++ zfs/config/user.m4
 @@ -2,6 +2,7 @@ dnl #
  dnl # Default ZFS user configuration
  dnl #
@@ -38,17 +38,17 @@ Index: zfs-linux-0.6.5.6/config/user.m4
  	ZFS_AC_CONFIG_USER_MOUNT_HELPER
  	ZFS_AC_CONFIG_USER_UDEV
  	ZFS_AC_CONFIG_USER_SYSTEMD
-Index: zfs-linux-0.6.5.6/config/zfs-build.m4
+Index: zfs/config/zfs-build.m4
 ===================================================================
---- zfs-linux-0.6.5.6.orig/config/zfs-build.m4
-+++ zfs-linux-0.6.5.6/config/zfs-build.m4
-@@ -87,8 +87,8 @@ AC_DEFUN([ZFS_AC_CONFIG], [
+--- zfs.orig/config/zfs-build.m4
++++ zfs/config/zfs-build.m4
+@@ -63,8 +63,8 @@ AC_DEFUN([ZFS_AC_CONFIG], [
  	ZFS_AC_CONFIG_ALWAYS
-
+ 
  	case "$ZFS_CONFIG" in
 -		kernel) ZFS_AC_CONFIG_KERNEL ;;
  		user)	ZFS_AC_CONFIG_USER   ;;
 +		kernel) ZFS_AC_CONFIG_KERNEL ;;
- 		all)    ZFS_AC_CONFIG_KERNEL
- 			ZFS_AC_CONFIG_USER   ;;
+ 		all)    ZFS_AC_CONFIG_USER
+ 			ZFS_AC_CONFIG_KERNEL ;;
  		srpm)                        ;;
diff --git a/debian/patches/0001-fix-booting-via-dracut-generated-initramfs.patch b/debian/patches/0001-fix-booting-via-dracut-generated-initramfs.patch
deleted file mode 100644
index eeea4e2..0000000
--- a/debian/patches/0001-fix-booting-via-dracut-generated-initramfs.patch
+++ /dev/null
@@ -1,337 +0,0 @@
-From a5a370227eb0a3daf8992a38920d54eb3b7b3c25 Mon Sep 17 00:00:00 2001
-From: Matthew Thode <mthode at mthode.org>
-Date: Wed, 30 Mar 2016 18:59:15 -0500
-Subject: [PATCH 001/530] fix booting via dracut generated initramfs
-
-Dracut and Systemd updated how they integrate with each other, because
-of this our current integrations stopped working (around the time
-4.1.13 came out).  This patch addresses that issue and gets us booting
-again.
-
-Thanks to @Rudd-O for doing the work to get dracut working again and
-letting me submit this on his behalf.
-
-Signed-off-by: Manuel Amador (Rudd-O) <rudd-o at rudd-o.com>
-Signed-off-by: Matthew Thode <mthode at mthode.org>
-Closes #3605
-Closes #4478
----
- configure.ac                                       |   1 +
- contrib/dracut/02zfsexpandknowledge/Makefile.am    |  22 ++++
- .../dracut/02zfsexpandknowledge/module-setup.sh.in | 132 +++++++++++++++++++++
- contrib/dracut/90zfs/Makefile.am                   |   3 +
- contrib/dracut/90zfs/module-setup.sh.in            |  19 ++-
- contrib/dracut/90zfs/zfs-generator.sh.in           |  39 ++++++
- contrib/dracut/Makefile.am                         |   2 +-
- 7 files changed, 216 insertions(+), 2 deletions(-)
- create mode 100644 contrib/dracut/02zfsexpandknowledge/Makefile.am
- create mode 100755 contrib/dracut/02zfsexpandknowledge/module-setup.sh.in
- create mode 100644 contrib/dracut/90zfs/zfs-generator.sh.in
-
-diff --git a/configure.ac b/configure.ac
-index 41cd007..5037ccb 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -114,6 +114,7 @@ AC_CONFIG_FILES([
- 	contrib/Makefile
- 	contrib/bash_completion.d/Makefile
- 	contrib/dracut/Makefile
-+	contrib/dracut/02zfsexpandknowledge/Makefile
- 	contrib/dracut/90zfs/Makefile
- 	contrib/initramfs/Makefile
- 	module/Makefile
-diff --git a/contrib/dracut/02zfsexpandknowledge/Makefile.am b/contrib/dracut/02zfsexpandknowledge/Makefile.am
-new file mode 100644
-index 0000000..0a2170b
---- /dev/null
-+++ b/contrib/dracut/02zfsexpandknowledge/Makefile.am
-@@ -0,0 +1,22 @@
-+pkgdracutdir = $(dracutdir)/modules.d/02zfsexpandknowledge
-+pkgdracut_SCRIPTS = \
-+	module-setup.sh
-+
-+EXTRA_DIST = \
-+	$(top_srcdir)/contrib/dracut/02zfsexpandknowledge/module-setup.sh.in
-+
-+$(pkgdracut_SCRIPTS):
-+	-$(SED) -e 's, at bindir\@,$(bindir),g' \
-+		-e 's, at sbindir\@,$(sbindir),g' \
-+		-e 's, at datadir\@,$(datadir),g' \
-+		-e 's, at dracutdir\@,$(dracutdir),g' \
-+		-e 's, at udevdir\@,$(udevdir),g' \
-+		-e 's, at udevruledir\@,$(udevruledir),g' \
-+		-e 's, at sysconfdir\@,$(sysconfdir),g' \
-+		"$(top_srcdir)/contrib/dracut/02zfsexpandknowledge/$@.in" >'$@'
-+
-+clean-local::
-+	-$(RM) $(pkgdracut_SCRIPTS)
-+
-+distclean-local::
-+	-$(RM) $(pkgdracut_SCRIPTS)
-diff --git a/contrib/dracut/02zfsexpandknowledge/module-setup.sh.in b/contrib/dracut/02zfsexpandknowledge/module-setup.sh.in
-new file mode 100755
-index 0000000..830ee42
---- /dev/null
-+++ b/contrib/dracut/02zfsexpandknowledge/module-setup.sh.in
-@@ -0,0 +1,132 @@
-+#!/bin/sh
-+
-+get_devtype() {
-+  local typ
-+  typ=$(udevadm info --query=property --name="$1" | grep "^ID_FS_TYPE=" | sed 's|^ID_FS_TYPE=||')
-+  if [ "$typ" = "" ] ; then
-+     typ=$(blkid -c /dev/null "$1" -o value -s TYPE)
-+  fi
-+  echo "$typ"
-+}
-+
-+get_pool_devices() {
-+  # also present in 99zfssystemd
-+  local poolconfigtemp
-+  local poolconfigoutput
-+  local pooldev
-+  local prefix
-+  poolconfigtemp=`mktemp`
-+  @sbindir@/zpool list -v -H "$1" > "$poolconfigtemp" 2>&1
-+  if [ "$?" != "0" ] ; then
-+    poolconfigoutput=$(cat "$poolconfigtemp")
-+    dinfo "zfsexpandknowledge: pool $1 cannot be listed: $poolconfigoutput"
-+  else
-+    while read pooldev ; do
-+      for prefix in /dev/disk/* /dev/mapper ; do
-+        if [ -e "$prefix"/"$pooldev" ] ; then
-+          dinfo "zfsexpandknowledge: pool $1 has device $prefix/$pooldev"
-+          echo `readlink -f "$prefix"/"$pooldev"`
-+          break
-+        fi
-+      done
-+    done < <(cat "$poolconfigtemp" | awk -F '\t' 'NR>1 { print $2 }')
-+  fi
-+  rm -f "$poolconfigtemp"
-+}
-+
-+find_zfs_block_devices() {
-+    local dev
-+    local blockdev
-+    local mp
-+    local fstype
-+    local pool
-+    local key
-+    local n
-+    local poolconfigoutput
-+    numfields=`head -1 /proc/self/mountinfo | awk '{print NF}'`
-+    if [ "$numfields" == "10" ] ; then
-+        fields="n n n n mp n n fstype dev n"
-+    else
-+        fields="n n n n mp n n n fstype dev n"
-+    fi
-+    while read $fields ; do
-+       if [ "$fstype" != "zfs" ]; then continue ; fi
-+       if [ "$mp" == "$1" ]; then
-+           pool=$(echo "$dev" | cut -d / -f 1)
-+           get_pool_devices "$pool"
-+       fi
-+    done < /proc/self/mountinfo
-+}
-+
-+array_contains () {
-+  local e
-+  for e in "${@:2}"; do [[ "$e" == "$1" ]] && return 0; done
-+  return 1
-+}
-+
-+check() {
-+    local mp
-+    local dev
-+    local blockdevs
-+    local fstype
-+    local majmin
-+    local _slavedev
-+    local _slavedevname
-+    local _slavedevtype
-+    local _slavemajmin
-+    local _dev
-+
-+if [[ $hostonly ]]; then
-+
-+    for mp in \
-+        "/" \
-+        "/etc" \
-+        "/bin" \
-+        "/sbin" \
-+        "/lib" \
-+        "/lib64" \
-+        "/usr" \
-+        "/usr/bin" \
-+        "/usr/sbin" \
-+        "/usr/lib" \
-+        "/usr/lib64" \
-+        "/boot";
-+    do
-+        mp=$(readlink -f "$mp")
-+        mountpoint "$mp" >/dev/null 2>&1 || continue
-+        blockdevs=$(find_zfs_block_devices "$mp")
-+        if [ -z "$blockdevs" ] ; then continue ; fi
-+        dinfo "zfsexpandknowledge: block devices backing ZFS dataset $mp: $blockdevs"
-+        for dev in $blockdevs
-+        do
-+            array_contains "$dev" "${host_devs[@]}" || host_devs+=("$dev")
-+            fstype=$(get_devtype "$dev")
-+            host_fs_types["$dev"]="$fstype"
-+            majmin=$(get_maj_min "$dev")
-+            if [[ -d /sys/dev/block/$majmin/slaves ]] ; then
-+                for _slavedev in /sys/dev/block/$majmin/slaves/*; do
-+                    [[ -f $_slavedev/dev ]] || continue
-+                    _slavedev=/dev/$(basename "$_slavedev")
-+                    _slavedevname=$(udevadm info --query=property --name="$_slavedev" | grep "^DEVNAME=" | sed 's|^DEVNAME=||')
-+                    _slavedevtype=$(get_devtype "$_slavedevname")
-+                    _slavemajmin=$(get_maj_min "$_slavedevname")
-+                    dinfo "zfsexpandknowledge: slave block device backing ZFS dataset $mp: $_slavedevname"
-+                    array_contains "$_slavedevname" "${host_devs[@]}" || host_devs+=("$_slavedevname")
-+                    host_fs_types["$_slavedevname"]="$_slavedevtype"
-+                done
-+            fi
-+        done
-+    done
-+    for a in "${host_devs[@]}"
-+        do
-+        dinfo "zfsexpandknowledge: host device $a"
-+    done
-+    for a in "${!host_fs_types[@]}"
-+        do
-+        dinfo "zfsexpandknowledge: device $a of type ${host_fs_types[$a]}"
-+    done
-+
-+fi
-+
-+return 1
-+}
-diff --git a/contrib/dracut/90zfs/Makefile.am b/contrib/dracut/90zfs/Makefile.am
-index b778a27..f81d6c3 100644
---- a/contrib/dracut/90zfs/Makefile.am
-+++ b/contrib/dracut/90zfs/Makefile.am
-@@ -4,6 +4,7 @@ pkgdracut_SCRIPTS = \
- 	module-setup.sh \
- 	mount-zfs.sh \
- 	parse-zfs.sh \
-+	zfs-generator.sh \
- 	zfs-lib.sh
- 
- EXTRA_DIST = \
-@@ -11,6 +12,7 @@ EXTRA_DIST = \
- 	$(top_srcdir)/contrib/dracut/90zfs/module-setup.sh.in \
- 	$(top_srcdir)/contrib/dracut/90zfs/mount-zfs.sh.in \
- 	$(top_srcdir)/contrib/dracut/90zfs/parse-zfs.sh.in \
-+	$(top_srcdir)/contrib/dracut/90zfs/zfs-generator.sh.in \
- 	$(top_srcdir)/contrib/dracut/90zfs/zfs-lib.sh.in
- 
- $(pkgdracut_SCRIPTS):
-@@ -19,6 +21,7 @@ $(pkgdracut_SCRIPTS):
- 		-e 's, at udevdir\@,$(udevdir),g' \
- 		-e 's, at udevruledir\@,$(udevruledir),g' \
- 		-e 's, at sysconfdir\@,$(sysconfdir),g' \
-+		-e 's, at systemdunitdir\@,$(systemdunitdir),g' \
- 		"$(top_srcdir)/contrib/dracut/90zfs/$@.in" >'$@'
- 
- distclean-local::
-diff --git a/contrib/dracut/90zfs/module-setup.sh.in b/contrib/dracut/90zfs/module-setup.sh.in
-index 9eb9f57..301375a 100755
---- a/contrib/dracut/90zfs/module-setup.sh.in
-+++ b/contrib/dracut/90zfs/module-setup.sh.in
-@@ -40,16 +40,22 @@ install() {
- 	dracut_install awk
- 	dracut_install head
- 	inst_hook cmdline 95 "${moddir}/parse-zfs.sh"
--	inst_hook mount 98 "${moddir}/mount-zfs.sh"
-+	if [ -n "$systemdutildir" ] ; then
-+		inst_script "${moddir}/zfs-generator.sh" "$systemdutildir"/system-generators/dracut-zfs-generator
-+	else
-+		inst_hook mount 98 "${moddir}/mount-zfs.sh"
-+	fi
- 	inst_hook shutdown 30 "${moddir}/export-zfs.sh"
- 
- 	inst_simple "${moddir}/zfs-lib.sh" "/lib/dracut-zfs-lib.sh"
- 	if [ -e @sysconfdir@/zfs/zpool.cache ]; then
- 		inst @sysconfdir@/zfs/zpool.cache
-+		type mark_hostonly >/dev/null 2>&1 && mark_hostonly @sysconfdir@/zfs/zpool.cache
- 	fi
- 
- 	if [ -e @sysconfdir@/zfs/vdev_id.conf ]; then
- 		inst @sysconfdir@/zfs/vdev_id.conf
-+		type mark_hostonly >/dev/null 2>&1 && mark_hostonly @sysconfdir@/zfs/vdev_id.conf
- 	fi
- 
- 	# Synchronize initramfs and system hostid
-@@ -58,4 +64,15 @@ install() {
- 	CC=`hostid | cut -b 5,6`
- 	DD=`hostid | cut -b 7,8`
- 	printf "\x${DD}\x${CC}\x${BB}\x${AA}" > "${initdir}/etc/hostid"
-+
-+	if dracut_module_included "systemd"; then
-+		mkdir -p "${initdir}/$systemdsystemunitdir/initrd.target.wants"
-+		for _item in scan cache ; do
-+			dracut_install @systemdunitdir@/zfs-import-$_item.service
-+			if ! [ -L "${initdir}/$systemdsystemunitdir/initrd.target.wants"/zfs-import-$_item.service ]; then
-+				ln -s ../zfs-import-$_item.service "${initdir}/$systemdsystemunitdir/initrd.target.wants"/zfs-import-$_item.service
-+				type mark_hostonly >/dev/null 2>&1 && mark_hostonly @systemdunitdir@/zfs-import-$_item.service
-+			fi
-+		done
-+	fi
- }
-diff --git a/contrib/dracut/90zfs/zfs-generator.sh.in b/contrib/dracut/90zfs/zfs-generator.sh.in
-new file mode 100644
-index 0000000..0e0664d
---- /dev/null
-+++ b/contrib/dracut/90zfs/zfs-generator.sh.in
-@@ -0,0 +1,39 @@
-+#!/bin/bash
-+
-+GENERATOR_DIR="$1"
-+[ -z "$GENERATOR_DIR" ] && exit 1
-+
-+[ -f /lib/dracut-lib.sh ] && dracutlib=/lib/dracut-lib.sh
-+[ -f /usr/lib/dracut/modules.d/99base/dracut-lib.sh ] && dracutlib=/usr/lib/dracut/modules.d/99base/dracut-lib.sh
-+
-+type getarg >/dev/null 2>&1 || . "$dracutlib"
-+
-+[ -z "$root" ]       && root=$(getarg root=)
-+[ -z "$rootfstype" ] && rootfstype=$(getarg rootfstype=)
-+[ -z "$rootflags" ]  && rootflags=$(getarg rootflags=)
-+
-+[ "${root##zfs:}" = "${root}" -a "${root##ZFS=}" = "${root}" -a "$rootfstype" != "zfs" ] && exit 0
-+
-+rootfstype=zfs
-+if echo "${rootflags}" | grep -q zfsutil ; then
-+    true
-+else
-+    rootflags=zfsutil
-+fi
-+
-+root="${root##zfs:}"
-+root="${root##ZFS=}"
-+
-+[ -d "$GENERATOR_DIR" ] || mkdir "$GENERATOR_DIR"
-+[ -d "$GENERATOR_DIR/sysroot.mount.d" ] || mkdir "$GENERATOR_DIR/sysroot.mount.d"
-+
-+{
-+    echo "[Unit]"
-+    echo "After=zfs-import-scan.service"
-+    echo "After=zfs-import-cache.service"
-+    echo ""
-+    echo "[Mount]"
-+    echo "What=${root}"
-+    echo "Type=${rootfstype}"
-+    echo "Options=${rootflags}"
-+} > "$GENERATOR_DIR/sysroot.mount.d/zfs-enhancement.conf"
-diff --git a/contrib/dracut/Makefile.am b/contrib/dracut/Makefile.am
-index 35b88c3..1065e5e 100644
---- a/contrib/dracut/Makefile.am
-+++ b/contrib/dracut/Makefile.am
-@@ -1,3 +1,3 @@
--SUBDIRS = 90zfs
-+SUBDIRS = 02zfsexpandknowledge 90zfs
- 
- EXTRA_DIST = README.dracut.markdown
--- 
-2.1.4
-
diff --git a/debian/patches/0020-Fix-initramfs-hook-for-merged-usr-lib-and-lib.patch b/debian/patches/0020-Fix-initramfs-hook-for-merged-usr-lib-and-lib.patch
deleted file mode 100644
index 19efd63..0000000
--- a/debian/patches/0020-Fix-initramfs-hook-for-merged-usr-lib-and-lib.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From: Matt Kemp <matt at mattikus.com>
-Date: Mon, 27 Feb 2017 14:03:23 -0600
-Subject: Fix initramfs hook for merged /usr/lib and /lib
-
-Under a merged `/lib` -> `/usr/lib` which renders `/lib` as a symlink,
-`find /lib -type f -name libgcc_s.so.1` will not return a result as
-`find` will not traverse the symlink. Modifying it to `find /lib/ -type
-f -name libgcc_s.so.1` should work for both symlinked and non-symlinked
-`/lib` directories.
-
-Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
-Signed-off-by: Matt Kemp <matt at mattikus.com>
-Closes #5834
-Applied-Upstream: https://github.com/zfsonlinux/zfs/commit/912e2ba92f45b61df476e7e15da33e0ea3eb0ae5
----
- contrib/initramfs/hooks/zfs | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/contrib/initramfs/hooks/zfs b/contrib/initramfs/hooks/zfs
-index 53e876d..dd796b6 100755
---- a/contrib/initramfs/hooks/zfs
-+++ b/contrib/initramfs/hooks/zfs
-@@ -55,7 +55,7 @@ mkdir -p "$DESTDIR/etc/"
- # automatically detected. The `find` utility and extended `cp` options are
- # used here because libgcc_s.so could be in a subdirectory of /lib for
- # multi-arch installations.
--cp --target-directory="$DESTDIR" --parents $(find /lib -type f -name libgcc_s.so.1)
-+cp --target-directory="$DESTDIR" --parents $(find /lib/ -type f -name libgcc_s.so.1)
- 
- for ii in $COPY_EXEC_LIST
- do
diff --git a/debian/patches/0032-A-collection-of-dracut-fixes.patch b/debian/patches/0032-A-collection-of-dracut-fixes.patch
deleted file mode 100644
index a9886d4..0000000
--- a/debian/patches/0032-A-collection-of-dracut-fixes.patch
+++ /dev/null
@@ -1,235 +0,0 @@
-From d402c18dd60124525b253b27c5018f54a030928d Mon Sep 17 00:00:00 2001
-From: "Manuel Amador (Rudd-O)" <rudd-o at rudd-o.com>
-Date: Sun, 24 Apr 2016 11:35:44 +0000
-Subject: [PATCH 032/530] A collection of dracut fixes
-
-- In older systems without sysroot.mount, import before dracut-mount,
-  and re-enable old dracut mount hook
-- rootflags MUST be present even if the administrator neglected to
-  specify it explicitly
-- Check that mount.zfs exists in sbindir
-- Remove awk and head as (now unused) requirements, add grep, and
-  install the right mount.zfs
-- Eliminate one use of grep in Dracut
-- Use a more accurate grepping statement to identify zfsutil in rootflags
-- Ensure that pooldev is nonempty
-- Properly handle /dev/sd* devices and more
-- Use new -P to get list of zpool devices
-- Bail out of the generator when zfs:AUTO is on the root command line
-- Ignore errors from systemctl trying to load sysroot.mount, we only
-  care about the output
-- Determine which one is the correct initqueuedir at run time.
-- Add a compatibility getargbool for our detection / setup script.
-- Update dracut .gitignore files
-
-Signed-off-by: <Matthew Thode mthode at mthode.org>
-Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
-Closes #4558
-Closes #4562
----
- contrib/dracut/02zfsexpandknowledge/module-setup.sh.in    | 19 +++++++++++--------
- contrib/dracut/90zfs/.gitignore                       |  1 +
- contrib/dracut/90zfs/module-setup.sh.in               | 17 +++++++++--------
- contrib/dracut/90zfs/mount-zfs.sh.in                  | 10 ++++++++++
- contrib/dracut/90zfs/parse-zfs.sh.in                  |  6 +++++-
- contrib/dracut/90zfs/zfs-generator.sh.in              | 10 +++++++++-
- contrib/dracut/90zfs/zfs-lib.sh.in                    | 18 ++++++++++++++++++
- etc/systemd/system/zfs-import-cache.service.in        |  1 +
- etc/systemd/system/zfs-import-scan.service.in         |  1 +
- 10 files changed, 66 insertions(+), 18 deletions(-)
- create mode 100644 contrib/dracut/02zfsexpandknowledge/.gitignore
- mode change 100644 => 100755 contrib/dracut/90zfs/zfs-generator.sh.in
-
-Index: zfs/contrib/dracut/02zfsexpandknowledge/module-setup.sh.in
-===================================================================
---- zfs.orig/contrib/dracut/02zfsexpandknowledge/module-setup.sh.in
-+++ zfs/contrib/dracut/02zfsexpandknowledge/module-setup.sh.in
-@@ -15,21 +15,24 @@ get_pool_devices() {
-   local poolconfigoutput
-   local pooldev
-   local prefix
-+  local resolved
-   poolconfigtemp=`mktemp`
--  @sbindir@/zpool list -v -H "$1" > "$poolconfigtemp" 2>&1
-+  @sbindir@/zpool list -v -H -P "$1" > "$poolconfigtemp" 2>&1
-   if [ "$?" != "0" ] ; then
-     poolconfigoutput=$(cat "$poolconfigtemp")
-     dinfo "zfsexpandknowledge: pool $1 cannot be listed: $poolconfigoutput"
-   else
-     while read pooldev ; do
--      for prefix in /dev/disk/* /dev/mapper ; do
--        if [ -e "$prefix"/"$pooldev" ] ; then
--          dinfo "zfsexpandknowledge: pool $1 has device $prefix/$pooldev"
--          echo `readlink -f "$prefix"/"$pooldev"`
--          break
-+        if [ -n "$pooldev" -a -e "$pooldev" ] ; then
-+          if [ -h "$pooldev" ] ; then
-+              resolved=`readlink -f "$pooldev"`
-+          else
-+              resolved="$pooldev"
-+          fi
-+          dinfo "zfsexpandknowledge: pool $1 has device $pooldev (which resolves to $resolved)"
-+          echo "$resolved"
-         fi
--      done
--    done < <(cat "$poolconfigtemp" | awk -F '\t' 'NR>1 { print $2 }')
-+    done < <(cat "$poolconfigtemp" |  awk -F '\t' '/\t\/dev/ { print $2 }')
-   fi
-   rm -f "$poolconfigtemp"
- }
-Index: zfs/contrib/dracut/90zfs/module-setup.sh.in
-===================================================================
---- zfs.orig/contrib/dracut/90zfs/module-setup.sh.in
-+++ zfs/contrib/dracut/90zfs/module-setup.sh.in
-@@ -5,8 +5,11 @@ check() {
- 	[ "${1}" = "-d" ] && return 0
- 
- 	# Verify the zfs tool chain
--	which zpool >/dev/null 2>&1 || return 1
--	which zfs >/dev/null 2>&1 || return 1
-+	for tool in "@sbindir@/zpool" "@sbindir@/zfs" "@sbindir@/mount.zfs" ; do
-+		test -x "$tool" || return 1
-+	done
-+	# Verify grep exists
-+	which grep >/dev/null 2>&1 || return 1
- 
- 	return 0
- }
-@@ -31,20 +34,18 @@ install() {
- 	inst_rules @udevruledir@/90-zfs.rules
- 	inst_rules @udevruledir@/69-vdev.rules
- 	inst_rules @udevruledir@/60-zvol.rules
-+	dracut_install hostid
-+	dracut_install grep
- 	dracut_install @sbindir@/zfs
- 	dracut_install @sbindir@/zpool
-+	dracut_install @sbindir@/mount.zfs
- 	dracut_install @udevdir@/vdev_id
- 	dracut_install @udevdir@/zvol_id
--	dracut_install mount.zfs
--	dracut_install hostid
--	dracut_install awk
--	dracut_install head
- 	inst_hook cmdline 95 "${moddir}/parse-zfs.sh"
- 	if [ -n "$systemdutildir" ] ; then
- 		inst_script "${moddir}/zfs-generator.sh" "$systemdutildir"/system-generators/dracut-zfs-generator
--	else
--		inst_hook mount 98 "${moddir}/mount-zfs.sh"
- 	fi
-+	inst_hook mount 98 "${moddir}/mount-zfs.sh"
- 	inst_hook shutdown 30 "${moddir}/export-zfs.sh"
- 
- 	inst_simple "${moddir}/zfs-lib.sh" "/lib/dracut-zfs-lib.sh"
-Index: zfs/contrib/dracut/90zfs/mount-zfs.sh.in
-===================================================================
---- zfs.orig/contrib/dracut/90zfs/mount-zfs.sh.in
-+++ zfs/contrib/dracut/90zfs/mount-zfs.sh.in
-@@ -10,6 +10,16 @@ case "${root}" in
- 	*) return ;;
- esac
- 
-+# If sysroot.mount exists, the initial RAM disk configured
-+# it to mount ZFS on root.  In that case, we bail early.
-+loadstate="$(systemctl --system --show -p LoadState sysroot.mount || true)"
-+if [ "${loadstate}" = "LoadState=not-found" -o "${loadstate}" = "" ] ; then
-+	info "ZFS: sysroot.mount absent, mounting root with mount-zfs.sh"
-+else
-+	info "ZFS: sysroot.mount present, delegating root mount to it"
-+	return
-+fi
-+
- # Delay until all required block devices are present.
- udevadm settle
- 
-Index: zfs/contrib/dracut/90zfs/parse-zfs.sh.in
-===================================================================
---- zfs.orig/contrib/dracut/90zfs/parse-zfs.sh.in
-+++ zfs/contrib/dracut/90zfs/parse-zfs.sh.in
-@@ -55,5 +55,9 @@ esac
- # modules to settle before mounting.
- if [ ${wait_for_zfs} -eq 1 ]; then
- 	ln -s /dev/null /dev/root 2>/dev/null
--	echo '[ -e /dev/zfs ]' > "${hookdir}/initqueue/finished/zfs.sh"
-+	initqueuedir="${hookdir}/initqueue/finished"
-+	test -d initqueuedir || {
-+		initqueuedir="${hookdir}/initqueue-finished"
-+	}
-+	echo '[ -e /dev/zfs ]' > "${initqueuedir}/zfs.sh"
- fi
-Index: zfs/contrib/dracut/90zfs/zfs-generator.sh.in
-===================================================================
---- zfs.orig/contrib/dracut/90zfs/zfs-generator.sh.in
-+++ zfs/contrib/dracut/90zfs/zfs-generator.sh.in
-@@ -13,10 +13,18 @@ type getarg >/dev/null 2>&1 || . "$dracu
- [ -z "$rootflags" ]  && rootflags=$(getarg rootflags=)
- 
- [ "${root##zfs:}" = "${root}" -a "${root##ZFS=}" = "${root}" -a "$rootfstype" != "zfs" ] && exit 0
-+# If root is set to zfs:AUTO, then we know sysroot.mount will not be generated
-+# so we have no need to enhance it.
-+# See https://github.com/zfsonlinux/zfs/pull/4558#discussion_r61118952 for details.
-+if [ "${root}" = "zfs:AUTO" ] ; then
-+  exit 0
-+fi
- 
- rootfstype=zfs
--if echo "${rootflags}" | grep -q zfsutil ; then
-+if echo "${rootflags}" | grep -Eq '^zfsutil$|^zfsutil,|,zfsutil$|,zfsutil,' ; then
-     true
-+elif test -n "${rootflags}" ; then
-+    rootflags="zfsutil,${rootflags}"
- else
-     rootflags=zfsutil
- fi
-Index: zfs/contrib/dracut/90zfs/zfs-lib.sh.in
-===================================================================
---- zfs.orig/contrib/dracut/90zfs/zfs-lib.sh.in
-+++ zfs/contrib/dracut/90zfs/zfs-lib.sh.in
-@@ -1,6 +1,24 @@
- #!/bin/sh
- 
- command -v getarg >/dev/null || . /lib/dracut-lib.sh
-+command -v getargbool >/dev/null || {
-+    # Compatibility with older Dracut versions.
-+    # With apologies to the Dracut developers.
-+    getargbool() {
-+        local _b
-+        unset _b
-+        local _default
-+        _default="$1"; shift
-+        _b=$(getarg "$@")
-+        [ $? -ne 0 -a -z "$_b" ] && _b="$_default"
-+        if [ -n "$_b" ]; then
-+            [ $_b = "0" ] && return 1
-+            [ $_b = "no" ] && return 1
-+            [ $_b = "off" ] && return 1
-+        fi
-+        return 0
-+    }
-+}
- 
- OLDIFS="${IFS}"
- NEWLINE="
-Index: zfs/etc/systemd/system/zfs-import-cache.service.in
-===================================================================
---- zfs.orig/etc/systemd/system/zfs-import-cache.service.in
-+++ zfs/etc/systemd/system/zfs-import-cache.service.in
-@@ -4,6 +4,7 @@ DefaultDependencies=no
- Requires=systemd-udev-settle.service
- After=systemd-udev-settle.service
- After=cryptsetup.target
-+Before=dracut-mount.service
- After=systemd-remount-fs.service
- ConditionPathExists=@sysconfdir@/zfs/zpool.cache
- 
-Index: zfs/etc/systemd/system/zfs-import-scan.service.in
-===================================================================
---- zfs.orig/etc/systemd/system/zfs-import-scan.service.in
-+++ zfs/etc/systemd/system/zfs-import-scan.service.in
-@@ -4,6 +4,7 @@ DefaultDependencies=no
- Requires=systemd-udev-settle.service
- After=systemd-udev-settle.service
- After=cryptsetup.target
-+Before=dracut-mount.service
- ConditionPathExists=!@sysconfdir@/zfs/zpool.cache
- 
- [Service]
diff --git a/debian/patches/0034-Fix-the-test-to-use-the-variable.patch b/debian/patches/0034-Fix-the-test-to-use-the-variable.patch
deleted file mode 100644
index 89b6aef..0000000
--- a/debian/patches/0034-Fix-the-test-to-use-the-variable.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From dabe1c42f9724ab030dea7fc1db1c924d21a8a6a Mon Sep 17 00:00:00 2001
-From: jyxent <jordanp at gmail.com>
-Date: Fri, 13 May 2016 21:44:03 -0600
-Subject: [PATCH 034/530] Fix the test to use the variable
-
-Signed-off-by: Manuel Amador (Rudd-O) <rudd-o at rudd-o.com>
-Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
-Closes #4645
----
- contrib/dracut/90zfs/parse-zfs.sh.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/contrib/dracut/90zfs/parse-zfs.sh.in b/contrib/dracut/90zfs/parse-zfs.sh.in
-index 74a426e..6ca3165 100755
---- a/contrib/dracut/90zfs/parse-zfs.sh.in
-+++ b/contrib/dracut/90zfs/parse-zfs.sh.in
-@@ -56,7 +56,7 @@ esac
- if [ ${wait_for_zfs} -eq 1 ]; then
- 	ln -s /dev/null /dev/root 2>/dev/null
- 	initqueuedir="${hookdir}/initqueue/finished"
--	test -d initqueuedir || {
-+	test -d "${initqueuedir}" || {
- 		initqueuedir="${hookdir}/initqueue-finished"
- 	}
- 	echo '[ -e /dev/zfs ]' > "${initqueuedir}/zfs.sh"
--- 
-2.1.4
-
diff --git a/debian/patches/0159-Set-proper-dependency-for-string-replacement-targets.patch b/debian/patches/0159-Set-proper-dependency-for-string-replacement-targets.patch
deleted file mode 100644
index 4d42301..0000000
--- a/debian/patches/0159-Set-proper-dependency-for-string-replacement-targets.patch
+++ /dev/null
@@ -1,151 +0,0 @@
-From 5b1bc1a1d8ae284f834f239ab0309c6ce96ab74f Mon Sep 17 00:00:00 2001
-From: Chunwei Chen <david.chen at osnexus.com>
-Date: Fri, 29 Jul 2016 16:35:33 -0700
-Subject: [PATCH 159/530] Set proper dependency for string replacement targets
-
-A lot of string replacement target don't have dependency or incorrect
-dependency. We setup proper dependency by pattern rules.
-
-Signed-off-by: Chunwei Chen <david.chen at osnexus.com>
-Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
-Closes #4908
----
- contrib/dracut/02zfsexpandknowledge/Makefile.am |  4 ++--
- contrib/dracut/90zfs/Makefile.am                |  4 ++--
- etc/init.d/Makefile.am                          |  4 ++--
- etc/modules-load.d/Makefile.am                  |  4 ++--
- etc/systemd/system/Makefile.am                  | 11 ++---------
- udev/rules.d/Makefile.am                        |  4 ++--
- 6 files changed, 12 insertions(+), 19 deletions(-)
-
-diff --git a/contrib/dracut/02zfsexpandknowledge/Makefile.am b/contrib/dracut/02zfsexpandknowledge/Makefile.am
-index 0a2170b..a5c567c 100644
---- a/contrib/dracut/02zfsexpandknowledge/Makefile.am
-+++ b/contrib/dracut/02zfsexpandknowledge/Makefile.am
-@@ -5,7 +5,7 @@ pkgdracut_SCRIPTS = \
- EXTRA_DIST = \
- 	$(top_srcdir)/contrib/dracut/02zfsexpandknowledge/module-setup.sh.in
- 
--$(pkgdracut_SCRIPTS):
-+$(pkgdracut_SCRIPTS):%:%.in
- 	-$(SED) -e 's, at bindir\@,$(bindir),g' \
- 		-e 's, at sbindir\@,$(sbindir),g' \
- 		-e 's, at datadir\@,$(datadir),g' \
-@@ -13,7 +13,7 @@ $(pkgdracut_SCRIPTS):
- 		-e 's, at udevdir\@,$(udevdir),g' \
- 		-e 's, at udevruledir\@,$(udevruledir),g' \
- 		-e 's, at sysconfdir\@,$(sysconfdir),g' \
--		"$(top_srcdir)/contrib/dracut/02zfsexpandknowledge/$@.in" >'$@'
-+		$< >'$@'
- 
- clean-local::
- 	-$(RM) $(pkgdracut_SCRIPTS)
-diff --git a/contrib/dracut/90zfs/Makefile.am b/contrib/dracut/90zfs/Makefile.am
-index f81d6c3..2777a81 100644
---- a/contrib/dracut/90zfs/Makefile.am
-+++ b/contrib/dracut/90zfs/Makefile.am
-@@ -15,14 +15,14 @@ EXTRA_DIST = \
- 	$(top_srcdir)/contrib/dracut/90zfs/zfs-generator.sh.in \
- 	$(top_srcdir)/contrib/dracut/90zfs/zfs-lib.sh.in
- 
--$(pkgdracut_SCRIPTS):
-+$(pkgdracut_SCRIPTS):%:%.in
- 	-$(SED) -e 's, at bindir\@,$(bindir),g' \
- 		-e 's, at sbindir\@,$(sbindir),g' \
- 		-e 's, at udevdir\@,$(udevdir),g' \
- 		-e 's, at udevruledir\@,$(udevruledir),g' \
- 		-e 's, at sysconfdir\@,$(sysconfdir),g' \
- 		-e 's, at systemdunitdir\@,$(systemdunitdir),g' \
--		"$(top_srcdir)/contrib/dracut/90zfs/$@.in" >'$@'
-+		$< >'$@'
- 
- distclean-local::
- 	-$(RM) $(pkgdracut_SCRIPTS)
-diff --git a/etc/init.d/Makefile.am b/etc/init.d/Makefile.am
-index c6e29d1..247db0a 100644
---- a/etc/init.d/Makefile.am
-+++ b/etc/init.d/Makefile.am
-@@ -15,7 +15,7 @@ EXTRA_DIST = \
- 	$(top_srcdir)/etc/init.d/zfs-zed.in \
- 	$(top_srcdir)/etc/init.d/zfs.in
- 
--$(init_SCRIPTS) $(initconf_SCRIPTS) $(initcommon_SCRIPTS): $(EXTRA_DIST)
-+$(init_SCRIPTS) $(initconf_SCRIPTS) $(initcommon_SCRIPTS):%:%.in
- 	-(if [ -e /etc/debian_version ]; then \
- 		NFS_SRV=nfs-kernel-server; \
- 	  else \
-@@ -36,7 +36,7 @@ $(init_SCRIPTS) $(initconf_SCRIPTS) $(initcommon_SCRIPTS): $(EXTRA_DIST)
- 		 -e 's, at runstatedir\@,$(runstatedir),g' \
- 		 -e "s, at SHELL\@,$$SHELL,g" \
- 		 -e "s, at NFS_SRV\@,$$NFS_SRV,g" \
--		 "$(top_srcdir)/etc/init.d/$@.in" >'$@'; \
-+		 $< >'$@'; \
- 	  [ '$@' = 'zfs-functions' -o '$@' = 'zfs' ] || \
- 		chmod +x '$@')
- 
-diff --git a/etc/modules-load.d/Makefile.am b/etc/modules-load.d/Makefile.am
-index a6780e1..58c7acd 100644
---- a/etc/modules-load.d/Makefile.am
-+++ b/etc/modules-load.d/Makefile.am
-@@ -4,10 +4,10 @@ modulesload_DATA = \
- EXTRA_DIST = \
- 	$(top_srcdir)/etc/modules-load.d/zfs.conf.in
- 
--$(modulesload_DATA):
-+$(modulesload_DATA):%:%.in
- 	-$(SED) \
- 		-e '' \
--		"$(top_srcdir)/etc/modules-load.d/$@.in" >'$@'
-+		$< >'$@'
- 
- distclean-local::
- 	-$(RM) $(modulesload_DATA)
-diff --git a/etc/systemd/system/Makefile.am b/etc/systemd/system/Makefile.am
-index f7023df..b097497 100644
---- a/etc/systemd/system/Makefile.am
-+++ b/etc/systemd/system/Makefile.am
-@@ -18,19 +18,12 @@ EXTRA_DIST = \
- 	$(top_srcdir)/etc/systemd/system/zfs.target.in \
- 	$(top_srcdir)/etc/systemd/system/50-zfs.preset.in
- 
--$(systemdunit_DATA):
-+$(systemdunit_DATA) $(systemdpreset_DATA):%:%.in
- 	-$(SED) -e 's, at bindir\@,$(bindir),g' \
- 		-e 's, at runstatedir\@,$(runstatedir),g' \
- 		-e 's, at sbindir\@,$(sbindir),g' \
- 		-e 's, at sysconfdir\@,$(sysconfdir),g' \
--		"$(top_srcdir)/etc/systemd/system/$@.in" >'$@'
--
--$(systemdpreset_DATA):
--	-$(SED) -e 's, at bindir\@,$(bindir),g' \
--		-e 's, at runstatedir\@,$(runstatedir),g' \
--		-e 's, at sbindir\@,$(sbindir),g' \
--		-e 's, at sysconfdir\@,$(sysconfdir),g' \
--		"$(top_srcdir)/etc/systemd/system/$@.in" >'$@'
-+		$< >'$@'
- 
- distclean-local::
- 	-$(RM) $(systemdunit_DATA) $(systemdpreset_DATA)
-diff --git a/udev/rules.d/Makefile.am b/udev/rules.d/Makefile.am
-index febbb48..f79ea4b 100644
---- a/udev/rules.d/Makefile.am
-+++ b/udev/rules.d/Makefile.am
-@@ -8,13 +8,13 @@ EXTRA_DIST = \
- 	$(top_srcdir)/udev/rules.d/60-zvol.rules.in \
- 	$(top_srcdir)/udev/rules.d/90-zfs.rules.in
- 
--$(udevrule_DATA):
-+$(udevrule_DATA):%:%.in
- 	-$(SED) -e 's, at bindir\@,$(bindir),g' \
- 		-e 's, at sbindir\@,$(sbindir),g' \
- 		-e 's, at udevdir\@,$(udevdir),g' \
- 		-e 's, at udevruledir\@,$(udevruledir),g' \
- 		-e 's, at sysconfdir\@,$(sysconfdir),g' \
--		"$(top_srcdir)/udev/rules.d/$@.in" > '$@'
-+		$< > '$@'
- 
- distclean-local::
- 	-$(RM) $(udevrule_DATA)
--- 
-2.1.4
-
diff --git a/debian/patches/0219-Adapt-genkernel-fix-for-zfsonlinux-zfs-4749-to-zfs-d.patch b/debian/patches/0219-Adapt-genkernel-fix-for-zfsonlinux-zfs-4749-to-zfs-d.patch
deleted file mode 100644
index 8cea16b..0000000
--- a/debian/patches/0219-Adapt-genkernel-fix-for-zfsonlinux-zfs-4749-to-zfs-d.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 61c73494394fc9de9283b3fd4f00bcdf4bd300a7 Mon Sep 17 00:00:00 2001
-From: Moritz Maxeiner <moritz at ucworks.org>
-Date: Thu, 1 Sep 2016 18:15:10 +0200
-Subject: [PATCH 219/530] Adapt genkernel fix for zfsonlinux/zfs#4749 to zfs
- dracut module
-
-Signed-off-by: Moritz Maxeiner <moritz at ucworks.org>
-Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
-Closes #4749
-Closes #5058
----
- contrib/dracut/90zfs/module-setup.sh.in | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/contrib/dracut/90zfs/module-setup.sh.in b/contrib/dracut/90zfs/module-setup.sh.in
-index 70eac87..6dff2a8 100755
---- a/contrib/dracut/90zfs/module-setup.sh.in
-+++ b/contrib/dracut/90zfs/module-setup.sh.in
-@@ -38,6 +38,12 @@ install() {
- 	dracut_install grep
- 	dracut_install @sbindir@/zfs
- 	dracut_install @sbindir@/zpool
-+	# Include libgcc_s.so.1 to workaround zfsonlinux/zfs#4749
-+	if type gcc-config 2>&1 1>/dev/null; then
-+		dracut_install "/usr/lib/gcc/$(s=$(gcc-config -c); echo ${s%-*}/${s##*-})/libgcc_s.so.1"
-+	else
-+		dracut_install /usr/lib/gcc/*/*/libgcc_s.so.1
-+	fi
- 	dracut_install @sbindir@/mount.zfs
- 	dracut_install @udevdir@/vdev_id
- 	dracut_install @udevdir@/zvol_id
--- 
-2.1.4
-
diff --git a/debian/patches/0220-zfs-dracut-module-should-not-assume-systemd-presence.patch b/debian/patches/0220-zfs-dracut-module-should-not-assume-systemd-presence.patch
deleted file mode 100644
index dfe51a8..0000000
--- a/debian/patches/0220-zfs-dracut-module-should-not-assume-systemd-presence.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 8516203d53380bc32f62827afd0c13d16337c4e6 Mon Sep 17 00:00:00 2001
-From: Moritz Maxeiner <moritz at ucworks.org>
-Date: Thu, 1 Sep 2016 18:29:31 +0200
-Subject: [PATCH 220/530] zfs dracut module should not assume systemd presence
-
-Signed-off-by: Moritz Maxeiner <moritz at ucworks.org>
-Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
-Closes #4749
-Closes #5058
----
- contrib/dracut/90zfs/mount-zfs.sh.in | 18 ++++++++++--------
- 1 file changed, 10 insertions(+), 8 deletions(-)
-
-diff --git a/contrib/dracut/90zfs/mount-zfs.sh.in b/contrib/dracut/90zfs/mount-zfs.sh.in
-index 43862fa..51e107b 100755
---- a/contrib/dracut/90zfs/mount-zfs.sh.in
-+++ b/contrib/dracut/90zfs/mount-zfs.sh.in
-@@ -10,14 +10,16 @@ case "${root}" in
- 	*) return ;;
- esac
- 
--# If sysroot.mount exists, the initial RAM disk configured
--# it to mount ZFS on root.  In that case, we bail early.
--loadstate="$(systemctl --system --show -p LoadState sysroot.mount || true)"
--if [ "${loadstate}" = "LoadState=not-found" -o "${loadstate}" = "" ] ; then
--	info "ZFS: sysroot.mount absent, mounting root with mount-zfs.sh"
--else
--	info "ZFS: sysroot.mount present, delegating root mount to it"
--	return
-+if command -v systemctl >/dev/null; then
-+	# If sysroot.mount exists, the initial RAM disk configured
-+	# it to mount ZFS on root.  In that case, we bail early.
-+	loadstate="$(systemctl --system --show -p LoadState sysroot.mount || true)"
-+	if [ "${loadstate}" = "LoadState=not-found" -o "${loadstate}" = "" ] ; then
-+		info "ZFS: sysroot.mount absent, mounting root with mount-zfs.sh"
-+	else
-+		info "ZFS: sysroot.mount present, delegating root mount to it"
-+		return
-+	fi
- fi
- 
- # Delay until all required block devices are present.
--- 
-2.1.4
-
diff --git a/debian/patches/0246-Fix-regression-that-broke-dracut-initramfs-generatio.patch b/debian/patches/0246-Fix-regression-that-broke-dracut-initramfs-generatio.patch
deleted file mode 100644
index dcb451a..0000000
--- a/debian/patches/0246-Fix-regression-that-broke-dracut-initramfs-generatio.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From 70cc394d919fb576bc23d3dc2552a55a4c9d1c24 Mon Sep 17 00:00:00 2001
-From: Moritz Maxeiner <moritz at ucworks.org>
-Date: Wed, 21 Sep 2016 22:35:16 +0200
-Subject: [PATCH 246/530] Fix regression that broke dracut initramfs generation
-
-Based upon @ryao's initial fix for 1c73494394fc9de9283b3fd4f00bcdf4bd300a7
-( 5e9843405f63fdabe76e87b92b81a127d488abc7 ) this one also uses
-`command -v` instead of `type`, but additionally only applies the
-fix to close zfsonlinux/zfs#4749 when `libgcc_s.so.1` has not been included
-by dracut automatically (verified by whether `zpool` links directly to
-`libgcc_s.so`), as well as change the fallback option to match `libgcc_s.so*`.
-
-Tested-by: Ben Jencks <ben at bjencks.net>
-Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
-Signed-off-by: Moritz Maxeiner <moritz at ucworks.org>
-Closes #5089
-Closed #5138
----
- contrib/dracut/90zfs/module-setup.sh.in | 12 +++++++++---
- 1 file changed, 9 insertions(+), 3 deletions(-)
-
-diff --git a/contrib/dracut/90zfs/module-setup.sh.in b/contrib/dracut/90zfs/module-setup.sh.in
-index 6dff2a8..9c88b32 100755
---- a/contrib/dracut/90zfs/module-setup.sh.in
-+++ b/contrib/dracut/90zfs/module-setup.sh.in
-@@ -38,11 +38,17 @@ install() {
- 	dracut_install grep
- 	dracut_install @sbindir@/zfs
- 	dracut_install @sbindir@/zpool
--	# Include libgcc_s.so.1 to workaround zfsonlinux/zfs#4749
--	if type gcc-config 2>&1 1>/dev/null; then
-+	# Workaround for zfsonlinux/zfs#4749 by ensuring libgcc_s.so(.1) is included
-+	if [[ -n "$(ldd @sbindir@/zpool | grep -F 'libgcc_s.so')" ]]; then
-+		# Dracut will have already tracked and included it
-+		:;
-+	elif command -v gcc-config 2>&1 1>/dev/null; then
-+		# On systems with gcc-config (Gentoo, Funtoo, etc.):
-+		# Use the current profile to resolve the appropriate path
- 		dracut_install "/usr/lib/gcc/$(s=$(gcc-config -c); echo ${s%-*}/${s##*-})/libgcc_s.so.1"
- 	else
--		dracut_install /usr/lib/gcc/*/*/libgcc_s.so.1
-+		# Fallback: Guess the path and include all matches
-+		dracut_install /usr/lib/gcc/*/*/libgcc_s.so*
- 	fi
- 	dracut_install @sbindir@/mount.zfs
- 	dracut_install @udevdir@/vdev_id
--- 
-2.1.4
-
diff --git a/debian/patches/0296-Use-a-different-technique-to-detect-whether-to-mount.patch b/debian/patches/0296-Use-a-different-technique-to-detect-whether-to-mount.patch
deleted file mode 100644
index 45eb55c..0000000
--- a/debian/patches/0296-Use-a-different-technique-to-detect-whether-to-mount.patch
+++ /dev/null
@@ -1,177 +0,0 @@
-From b0f578a8073da49dd0af879944a1b8e8dfd6db56 Mon Sep 17 00:00:00 2001
-From: Rudd-O <rudd-o at rudd-o.com>
-Date: Thu, 6 Oct 2016 17:26:47 +0000
-Subject: [PATCH 296/530] Use a different technique to detect whether to
- mount-zfs
-
-The behavior of the Dracut module was very wrong before.
-
-The correct behavior: initramfs should not run `zfs-mount` to completion
-if the two generator files exist.  If, however, one of them is missing,
-it indicates one of three cases:
-
-* The kernel command line did not specify a root ZFS file system, and
-  another Dracut module is already handling root mount (via systemd).
-  `mount-zfs` can run, but it will do nothing.
-* There is no systemd to run `sysroot.mount` to begin with.
-  `mount-zfs` must run.
-* The root parameter is zfs:AUTO, which cannot be run in sysroot.mount.
-  `mount-zfs` must run.
-
-In any of these three cases, it is safe to run `zfs-mount` to completion.
-
-`zfs-mount` must also delete itself if it determines it should not run,
-or else Dracut will do the insane thing of running it over and over again.
-Literally, the definition of insanity, doing the same thing that did not
-work before, expecting different results.  Doing that may have had a great
-result before, when we had a race between devices appearing and pools
-being mounted, and `mount-zfs` was tasked with the full responsibility
-of importing the needed pool, but nowadays it is wrong behavior and
-should be suppressed.
-
-I deduced that self-deletion was the correct thing to do by looking at
-other Dracut code, because (as we all are very fully aware of) Dracut
-is entirely, ahem, "implementation-defined".
-
-Tested-by: @wphilips
-Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
-Signed-off-by: Manuel Amador (Rudd-O) <rudd-o at rudd-o.com>
-Closes #5157
-Closes #5204
----
- contrib/dracut/90zfs/mount-zfs.sh.in     | 37 ++++++++++++++++++++++----------
- contrib/dracut/90zfs/zfs-generator.sh.in | 34 ++++++++++++++++++++++-------
- 2 files changed, 52 insertions(+), 19 deletions(-)
-
-diff --git a/contrib/dracut/90zfs/mount-zfs.sh.in b/contrib/dracut/90zfs/mount-zfs.sh.in
-index 51e107b..3b6be31 100755
---- a/contrib/dracut/90zfs/mount-zfs.sh.in
-+++ b/contrib/dracut/90zfs/mount-zfs.sh.in
-@@ -10,17 +10,29 @@ case "${root}" in
- 	*) return ;;
- esac
- 
--if command -v systemctl >/dev/null; then
--	# If sysroot.mount exists, the initial RAM disk configured
--	# it to mount ZFS on root.  In that case, we bail early.
--	loadstate="$(systemctl --system --show -p LoadState sysroot.mount || true)"
--	if [ "${loadstate}" = "LoadState=not-found" -o "${loadstate}" = "" ] ; then
--		info "ZFS: sysroot.mount absent, mounting root with mount-zfs.sh"
--	else
--		info "ZFS: sysroot.mount present, delegating root mount to it"
--		return
--	fi
-+GENERATOR_FILE=/run/systemd/generator/sysroot.mount
-+GENERATOR_EXTENSION=/run/systemd/generator/sysroot.mount.d/zfs-enhancement.conf
-+
-+if [ -e "$GENERATOR_FILE" -a -e "$GENERATOR_EXTENSION" ] ; then
-+	# If the ZFS sysroot.mount flag exists, the initial RAM disk configured
-+	# it to mount ZFS on root.  In that case, we bail early.  This flag
-+	# file gets created by the zfs-generator program upon successful run.
-+	info "ZFS: There is a sysroot.mount and zfs-generator has extended it."
-+	info "ZFS: Delegating root mount to sysroot.mount."
-+	# Let us tell the initrd to run on shutdown.
-+	# We have a shutdown hook to run
-+	# because we imported the pool.
-+	need_shutdown
-+	# We now prevent Dracut from running this thing again.
-+	for zfsmounthook in "$hookdir"/mount/*zfs* ; do
-+		if [ -f "$zfsmounthook" ] ; then
-+			rm -f "$zfsmounthook"
-+		fi
-+	done
-+	return
- fi
-+info "ZFS: No sysroot.mount exists or zfs-generator did not extend it."
-+info "ZFS: Mounting root with the traditional mount-zfs.sh instead."
- 
- # Delay until all required block devices are present.
- udevadm settle
-@@ -45,6 +57,10 @@ ZFS_DATASET="${ZFS_DATASET:-${root#zfs:}}"
- ZFS_POOL="${ZFS_DATASET%%/*}"
- 
- if import_pool "${ZFS_POOL}" ; then
-+	# Let us tell the initrd to run on shutdown.
-+	# We have a shutdown hook to run
-+	# because we imported the pool.
-+	need_shutdown
- 	info "ZFS: Mounting dataset ${ZFS_DATASET}..."
- 	if mount_dataset "${ZFS_DATASET}" ; then
- 		ROOTFS_MOUNTED=yes
-@@ -53,4 +69,3 @@ if import_pool "${ZFS_POOL}" ; then
- fi
- 
- rootok=0
--need_shutdown
-diff --git a/contrib/dracut/90zfs/zfs-generator.sh.in b/contrib/dracut/90zfs/zfs-generator.sh.in
-index aa12fb8..c6384f5 100755
---- a/contrib/dracut/90zfs/zfs-generator.sh.in
-+++ b/contrib/dracut/90zfs/zfs-generator.sh.in
-@@ -1,21 +1,32 @@
- #!/bin/bash
- 
-+echo "zfs-generator: starting" >> /dev/kmsg
-+
- GENERATOR_DIR="$1"
--[ -z "$GENERATOR_DIR" ] && exit 1
-+[ -n "$GENERATOR_DIR" ] || {
-+    echo "zfs-generator: no generator directory specified, exiting" >> /dev/kmsg
-+    exit 1
-+}
- 
- [ -f /lib/dracut-lib.sh ] && dracutlib=/lib/dracut-lib.sh
- [ -f /usr/lib/dracut/modules.d/99base/dracut-lib.sh ] && dracutlib=/usr/lib/dracut/modules.d/99base/dracut-lib.sh
- 
--type getarg >/dev/null 2>&1 || . "$dracutlib"
-+type getarg >/dev/null 2>&1 || {
-+    echo "zfs-generator: loading Dracut library from $dracutlib" >> /dev/kmsg
-+    . "$dracutlib"
-+}
- 
- [ -z "$root" ]       && root=$(getarg root=)
- [ -z "$rootfstype" ] && rootfstype=$(getarg rootfstype=)
- [ -z "$rootflags" ]  && rootflags=$(getarg rootflags=)
- 
-+# If root is not ZFS= or zfs: or rootfstype is not zfs
-+# then we are not supposed to handle it.
- [ "${root##zfs:}" = "${root}" -a "${root##ZFS=}" = "${root}" -a "$rootfstype" != "zfs" ] && exit 0
--# If root is set to zfs:AUTO, then we know sysroot.mount will not be generated
--# so we have no need to enhance it.
--# See https://github.com/zfsonlinux/zfs/pull/4558#discussion_r61118952 for details.
-+# If root is set to zfs:AUTO, then we are also not
-+# supposed to handle it, and it should be handled
-+# by the traditional Dracut mount hook.
-+# See https://github.com/zfsonlinux/zfs/pull/4558#discussion_r61118952
- if [ "${root}" = "zfs:AUTO" ] ; then
-   exit 0
- fi
-@@ -32,16 +43,23 @@ fi
- root="${root##zfs:}"
- root="${root##ZFS=}"
- 
-+echo "zfs-generator: writing extension for sysroot.mount to $GENERATOR_DIR"/sysroot.mount.d/zfs-enhancement.conf >> /dev/kmsg
-+
- [ -d "$GENERATOR_DIR" ] || mkdir "$GENERATOR_DIR"
--[ -d "$GENERATOR_DIR/sysroot.mount.d" ] || mkdir "$GENERATOR_DIR/sysroot.mount.d"
-+[ -d "$GENERATOR_DIR"/sysroot.mount.d ] || mkdir "$GENERATOR_DIR"/sysroot.mount.d
- 
- {
-     echo "[Unit]"
-+    echo "Before=initrd-root-fs.target"
-     echo "After=zfs-import-scan.service"
-     echo "After=zfs-import-cache.service"
--    echo ""
-     echo "[Mount]"
-     echo "What=${root}"
-     echo "Type=${rootfstype}"
-     echo "Options=${rootflags}"
--} > "$GENERATOR_DIR/sysroot.mount.d/zfs-enhancement.conf"
-+} > "$GENERATOR_DIR"/sysroot.mount.d/zfs-enhancement.conf
-+
-+[ -d "$GENERATOR_DIR"/initrd-root-fs.target.requires ] || mkdir -p "$GENERATOR_DIR"/initrd-root-fs.target.requires
-+ln -s ../sysroot.mount "$GENERATOR_DIR"/initrd-root-fs.target.requires/sysroot.mount
-+
-+echo "zfs-generator: finished" >> /dev/kmsg
--- 
-2.1.4
-
diff --git a/debian/patches/0334-Use-F-to-export-pools-so-as-not-to-dirty-up-device-l.patch b/debian/patches/0334-Use-F-to-export-pools-so-as-not-to-dirty-up-device-l.patch
deleted file mode 100644
index 03fcbe5..0000000
--- a/debian/patches/0334-Use-F-to-export-pools-so-as-not-to-dirty-up-device-l.patch
+++ /dev/null
@@ -1,90 +0,0 @@
-From 7e8a2d0b755ea67291d3f576069706e43abc5e31 Mon Sep 17 00:00:00 2001
-From: Rudd-O <rudd-o at rudd-o.com>
-Date: Sun, 16 Oct 2016 03:30:53 +0000
-Subject: [PATCH 334/530] Use -F to export pools so as not to dirty up device
- labels
-
-Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
-Signed-off-by: Manuel Amador (Rudd-O) <rudd-o at rudd-o.com>
-Closes #5228
-Closes #5238
----
- contrib/dracut/90zfs/export-zfs.sh.in   | 15 ++++++++-------
- contrib/dracut/90zfs/module-setup.sh.in |  2 +-
- contrib/dracut/90zfs/mount-zfs.sh.in    |  2 +-
- contrib/dracut/90zfs/zfs-lib.sh.in      |  2 +-
- 4 files changed, 11 insertions(+), 10 deletions(-)
-
-diff --git a/contrib/dracut/90zfs/export-zfs.sh.in b/contrib/dracut/90zfs/export-zfs.sh.in
-index 393753f..8747c1c 100755
---- a/contrib/dracut/90zfs/export-zfs.sh.in
-+++ b/contrib/dracut/90zfs/export-zfs.sh.in
-@@ -4,18 +4,19 @@
- 
- _do_zpool_export() {
- 	local ret=0
-+	local errs=""
- 	local final="${1}"
--	local opts=""
- 
--	if [ "x${final}" != "x" ]; then
--		opts="-f"
-+	info "ZFS: Exporting ZFS storage pools..."
-+	errs=$(export_all -F 2>&1)
-+	ret=$?
-+	[ -z "${errs}" ] || echo "${errs}" | vwarn
-+	if [ "x${ret}" != "x0" ]; then
-+		info "ZFS: There was a problem exporting pools."
- 	fi
- 
--	info "Exporting ZFS storage pools."
--	export_all ${opts} || ret=$?
--
- 	if [ "x${final}" != "x" ]; then
--		info "zpool list"
-+		info "ZFS: pool list"
- 		zpool list 2>&1 | vinfo
- 	fi
- 
-diff --git a/contrib/dracut/90zfs/module-setup.sh.in b/contrib/dracut/90zfs/module-setup.sh.in
-index 9c88b32..240847a 100755
---- a/contrib/dracut/90zfs/module-setup.sh.in
-+++ b/contrib/dracut/90zfs/module-setup.sh.in
-@@ -58,7 +58,7 @@ install() {
- 		inst_script "${moddir}/zfs-generator.sh" "$systemdutildir"/system-generators/dracut-zfs-generator
- 	fi
- 	inst_hook mount 98 "${moddir}/mount-zfs.sh"
--	inst_hook shutdown 30 "${moddir}/export-zfs.sh"
-+	inst_hook shutdown 20 "${moddir}/export-zfs.sh"
- 
- 	inst_simple "${moddir}/zfs-lib.sh" "/lib/dracut-zfs-lib.sh"
- 	if [ -e @sysconfdir@/zfs/zpool.cache ]; then
-diff --git a/contrib/dracut/90zfs/mount-zfs.sh.in b/contrib/dracut/90zfs/mount-zfs.sh.in
-index 3b6be31..db5ccdd 100755
---- a/contrib/dracut/90zfs/mount-zfs.sh.in
-+++ b/contrib/dracut/90zfs/mount-zfs.sh.in
-@@ -44,7 +44,7 @@ if [ "${root}" = "zfs:AUTO" ] ; then
- 		ZFS_DATASET="$(find_bootfs)"
- 		if [ $? -ne 0 ] ; then
- 			warn "ZFS: No bootfs attribute found in importable pools."
--			export_all || export_all "-f"
-+			export_all -F
- 
- 			rootok=0
- 			return 1
-diff --git a/contrib/dracut/90zfs/zfs-lib.sh.in b/contrib/dracut/90zfs/zfs-lib.sh.in
-index c822ddb..c988dfe 100755
---- a/contrib/dracut/90zfs/zfs-lib.sh.in
-+++ b/contrib/dracut/90zfs/zfs-lib.sh.in
-@@ -90,7 +90,7 @@ mount_dataset() {
- # export_all OPTS
- #   exports all imported zfs pools.
- export_all() {
--	local opts="${1}"
-+	local opts="${@}"
- 	local ret=0
- 
- 	IFS="${NEWLINE}"
--- 
-2.1.4
-
diff --git a/debian/patches/0336-Properly-use-the-Dracut-cleanup-hook-to-order-pool-s.patch b/debian/patches/0336-Properly-use-the-Dracut-cleanup-hook-to-order-pool-s.patch
deleted file mode 100644
index e5142cb..0000000
--- a/debian/patches/0336-Properly-use-the-Dracut-cleanup-hook-to-order-pool-s.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-From f8e87e205c745c1e360230ac9c7631eb4632acfa Mon Sep 17 00:00:00 2001
-From: Rudd-O <rudd-o at rudd-o.com>
-Date: Mon, 17 Oct 2016 18:51:15 +0000
-Subject: [PATCH 336/530] Properly use the Dracut cleanup hook to order pool
- shutdown
-
-When Dracut starts up, it needs to determine whether a pool will remain
-"hanging open" before the system shuts off. In such a case, then the
-code to clean up the pool (using the previous export -F work) must
-be invoked. Since Dracut has had a recent change that makes
-mount-zfs.sh simply not run when the root dataset is already mounted,
-we must use the cleanup hook to order Dracut to do shutdown cleanup.
-
-Important note: this code will not accomplish its stated goal until this
-bug is fixed: https://bugzilla.redhat.com/show_bug.cgi?id=1385432
-
-That bug impacts more than just ZFS. It impacts LUKS, dmraid, and
-unmount during poweroff. It is a Fedora-wide bug.
-
-Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
-Signed-off-by: Manuel Amador (Rudd-O) <rudd-o at rudd-o.com>
-Closes #5287
----
- contrib/dracut/90zfs/Makefile.am            |  2 ++
- contrib/dracut/90zfs/module-setup.sh.in     |  1 +
- contrib/dracut/90zfs/mount-zfs.sh.in        |  2 --
- contrib/dracut/90zfs/zfs-needshutdown.sh.in | 10 ++++++++++
- 4 files changed, 13 insertions(+), 2 deletions(-)
- create mode 100644 contrib/dracut/90zfs/zfs-needshutdown.sh.in
-
-diff --git a/contrib/dracut/90zfs/Makefile.am b/contrib/dracut/90zfs/Makefile.am
-index 2777a81..243a520 100644
---- a/contrib/dracut/90zfs/Makefile.am
-+++ b/contrib/dracut/90zfs/Makefile.am
-@@ -5,6 +5,7 @@ pkgdracut_SCRIPTS = \
- 	mount-zfs.sh \
- 	parse-zfs.sh \
- 	zfs-generator.sh \
-+	zfs-needshutdown.sh \
- 	zfs-lib.sh
- 
- EXTRA_DIST = \
-@@ -13,6 +14,7 @@ EXTRA_DIST = \
- 	$(top_srcdir)/contrib/dracut/90zfs/mount-zfs.sh.in \
- 	$(top_srcdir)/contrib/dracut/90zfs/parse-zfs.sh.in \
- 	$(top_srcdir)/contrib/dracut/90zfs/zfs-generator.sh.in \
-+	$(top_srcdir)/contrib/dracut/90zfs/zfs-needshutdown.sh.in \
- 	$(top_srcdir)/contrib/dracut/90zfs/zfs-lib.sh.in
- 
- $(pkgdracut_SCRIPTS):%:%.in
-diff --git a/contrib/dracut/90zfs/module-setup.sh.in b/contrib/dracut/90zfs/module-setup.sh.in
-index 240847a..a653b50 100755
---- a/contrib/dracut/90zfs/module-setup.sh.in
-+++ b/contrib/dracut/90zfs/module-setup.sh.in
-@@ -58,6 +58,7 @@ install() {
- 		inst_script "${moddir}/zfs-generator.sh" "$systemdutildir"/system-generators/dracut-zfs-generator
- 	fi
- 	inst_hook mount 98 "${moddir}/mount-zfs.sh"
-+	inst_hook cleanup 99 "${moddir}/zfs-needshutdown.sh"
- 	inst_hook shutdown 20 "${moddir}/export-zfs.sh"
- 
- 	inst_simple "${moddir}/zfs-lib.sh" "/lib/dracut-zfs-lib.sh"
-diff --git a/contrib/dracut/90zfs/mount-zfs.sh.in b/contrib/dracut/90zfs/mount-zfs.sh.in
-index db5ccdd..e7f2177 100755
---- a/contrib/dracut/90zfs/mount-zfs.sh.in
-+++ b/contrib/dracut/90zfs/mount-zfs.sh.in
-@@ -22,7 +22,6 @@ if [ -e "$GENERATOR_FILE" -a -e "$GENERATOR_EXTENSION" ] ; then
- 	# Let us tell the initrd to run on shutdown.
- 	# We have a shutdown hook to run
- 	# because we imported the pool.
--	need_shutdown
- 	# We now prevent Dracut from running this thing again.
- 	for zfsmounthook in "$hookdir"/mount/*zfs* ; do
- 		if [ -f "$zfsmounthook" ] ; then
-@@ -60,7 +59,6 @@ if import_pool "${ZFS_POOL}" ; then
- 	# Let us tell the initrd to run on shutdown.
- 	# We have a shutdown hook to run
- 	# because we imported the pool.
--	need_shutdown
- 	info "ZFS: Mounting dataset ${ZFS_DATASET}..."
- 	if mount_dataset "${ZFS_DATASET}" ; then
- 		ROOTFS_MOUNTED=yes
-diff --git a/contrib/dracut/90zfs/zfs-needshutdown.sh.in b/contrib/dracut/90zfs/zfs-needshutdown.sh.in
-new file mode 100644
-index 0000000..e3d1b59
---- /dev/null
-+++ b/contrib/dracut/90zfs/zfs-needshutdown.sh.in
-@@ -0,0 +1,10 @@
-+#!/bin/sh
-+
-+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
-+
-+if zpool list 2>&1 | grep -q 'no pools available' ; then
-+    info "ZFS: No active pools, no need to export anything."
-+else
-+    info "ZFS: There is an active pool, will export it."
-+    need_shutdown
-+fi
--- 
-2.1.4
-
diff --git a/debian/patches/1000-ppc64el-endian-support.patch b/debian/patches/1000-ppc64el-endian-support.patch
deleted file mode 100644
index c7935aa..0000000
--- a/debian/patches/1000-ppc64el-endian-support.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-Description: Fix endian build problem on ppc64el
-  Drop endian override in powerpc architecture definition
-  allowing both big and little endian builds.
-
-  Upstream applied a different fix, simply removing the _BIG_ENDIAN test.
-Author: Andy Whitcroft <apw at ubuntu.com>
-Origin: ubuntu
-Forwarded: no
-Bug: https://github.com/zfsonlinux/zfs/pull/5856
-Reviewed-By: Petter Reinholdtsen <pere at hungry.com>
-Last-Update: 2016-05-12
-Applied-Upstream: https://github.com/zfsonlinux/zfs/commit/fb963d33ee0dd350143ba1c9cd35d5f7d86910d2
-
-Index: zfs-linux-0.6.5.3/lib/libspl/include/sys/isa_defs.h
-===================================================================
---- zfs-linux-0.6.5.3.orig/lib/libspl/include/sys/isa_defs.h	2015-10-27 14:36:37.904604893 -0600
-+++ zfs-linux-0.6.5.3/lib/libspl/include/sys/isa_defs.h	2015-10-27 14:36:58.008605392 -0600
-@@ -98,8 +98,8 @@
- #endif
- #endif
- 
--#if !defined(_BIG_ENDIAN)
--#define	_BIG_ENDIAN
-+#if !defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)
-+#error powerpc no endian specified
- #endif
- 
- #define	_SUNOS_VTOC_16
diff --git a/debian/patches/1002-Fix-dev-zfs-device-is-missing.patch b/debian/patches/1002-Fix-dev-zfs-device-is-missing.patch
deleted file mode 100644
index 6de6622..0000000
--- a/debian/patches/1002-Fix-dev-zfs-device-is-missing.patch
+++ /dev/null
@@ -1,265 +0,0 @@
-Description: Change /etc/mtab to /proc/self/mounts
- Fix misleading error message: "The /dev/zfs device is missing and must be created.", if /etc/mtab is missing.
-Author: Eric Desrochers <eric.desrochers at canonical.com>
-Origin: https://github.com/zfsonlinux/zfs/commit/792517389fad5c495a2738b61c2e9c65dedaaa9a
-Bug: https://github.com/zfsonlinux/zfs/issues/4680
---- a/cmd/mount_zfs/mount_zfs.c
-+++ b/cmd/mount_zfs/mount_zfs.c
-@@ -292,11 +292,11 @@
- 	struct stat st;
- 	int error, fd;
- 
--	error = lstat(MNTTAB, &st);
-+	error = lstat("/etc/mtab", &st);
- 	if (error || S_ISLNK(st.st_mode))
- 		return (0);
- 
--	fd = open(MNTTAB, O_RDWR | O_CREAT, 0644);
-+	fd = open("/etc/mtab", O_RDWR | O_CREAT, 0644);
- 	if (fd < 0)
- 		return (0);
- 
-@@ -318,21 +318,21 @@
- 	mnt.mnt_freq = 0;
- 	mnt.mnt_passno = 0;
- 
--	fp = setmntent(MNTTAB, "a+");
-+	fp = setmntent("/etc/mtab", "a+");
- 	if (!fp) {
- 		(void) fprintf(stderr, gettext(
--		    "filesystem '%s' was mounted, but %s "
-+		    "filesystem '%s' was mounted, but /etc/mtab "
- 		    "could not be opened due to error %d\n"),
--		    dataset, MNTTAB, errno);
-+		    dataset, errno);
- 		return (MOUNT_FILEIO);
- 	}
- 
- 	error = addmntent(fp, &mnt);
- 	if (error) {
- 		(void) fprintf(stderr, gettext(
--		    "filesystem '%s' was mounted, but %s "
-+		    "filesystem '%s' was mounted, but /etc/mtab "
- 		    "could not be updated due to error %d\n"),
--		    dataset, MNTTAB, errno);
-+		    dataset, errno);
- 		return (MOUNT_FILEIO);
- 	}
- 
---- a/cmd/zfs/zfs_main.c
-+++ b/cmd/zfs/zfs_main.c
-@@ -5978,9 +5978,10 @@
- 		}
- 
- 		/*
--		 * When mount is given no arguments, go through /etc/mtab and
--		 * display any active ZFS mounts.  We hide any snapshots, since
--		 * they are controlled automatically.
-+		 * When mount is given no arguments, go through
-+		 * /proc/self/mounts and display any active ZFS mounts.
-+		 * We hide any snapshots, since they are controlled
-+		 * automatically.
- 		 */
- 
- 		/* Reopen MNTTAB to prevent reading stale data from open file */
-@@ -6060,8 +6061,8 @@
- 
- /*
-  * Convenience routine used by zfs_do_umount() and manual_unmount().  Given an
-- * absolute path, find the entry /etc/mtab, verify that its a ZFS filesystem,
-- * and unmount it appropriately.
-+ * absolute path, find the entry /proc/self/mounts, verify that its a
-+ * ZFS filesystem, and unmount it appropriately.
-  */
- static int
- unshare_unmount_path(int op, char *path, int flags, boolean_t is_manual)
-@@ -6074,7 +6075,7 @@
- 	ino_t path_inode;
- 
- 	/*
--	 * Search for the path in /etc/mtab.  Rather than looking for the
-+	 * Search for the path in /proc/self/mounts.  Rather than looking for the
- 	 * specific path, which can be fooled by non-standard paths (i.e. ".."
- 	 * or "//"), we stat() the path and search for the corresponding
- 	 * (major,minor) device pair.
-@@ -6105,8 +6106,8 @@
- 			    "currently mounted\n"), cmdname, path);
- 			return (1);
- 		}
--		(void) fprintf(stderr, gettext("warning: %s not in mtab\n"),
--		    path);
-+		(void) fprintf(stderr, gettext("warning: %s not in"
-+		    "/proc/self/mounts\n"), path);
- 		if ((ret = umount2(path, flags)) != 0)
- 			(void) fprintf(stderr, gettext("%s: %s\n"), path,
- 			    strerror(errno));
-@@ -6217,9 +6218,9 @@
- 		/*
- 		 * We could make use of zfs_for_each() to walk all datasets in
- 		 * the system, but this would be very inefficient, especially
--		 * since we would have to linearly search /etc/mtab for each
--		 * one.  Instead, do one pass through /etc/mtab looking for
--		 * zfs entries and call zfs_unmount() for each one.
-+		 * since we would have to linearly search /proc/self/mounts for
-+		 * each one.  Instead, do one pass through /proc/self/mounts
-+		 * looking for zfs entries and call zfs_unmount() for each one.
- 		 *
- 		 * Things get a little tricky if the administrator has created
- 		 * mountpoints beneath other ZFS filesystems.  In this case, we
---- a/cmd/zinject/translate.c
-+++ b/cmd/zinject/translate.c
-@@ -120,7 +120,7 @@
- #else
- 	if ((fp = fopen(MNTTAB, "r")) == NULL) {
- #endif
--		(void) fprintf(stderr, "cannot open /etc/mtab\n");
-+		(void) fprintf(stderr, "cannot open %s\n", MNTTAB);
- 		return (-1);
- 	}
- 
---- a/contrib/initramfs/scripts/zfs
-+++ b/contrib/initramfs/scripts/zfs
-@@ -288,9 +288,8 @@
- 		wait_for_dev
- 	fi
- 
--	# zpool import refuse to import without a valid mtab
--	[ ! -f /proc/mounts ] && mount proc /proc
--	[ ! -f /etc/mtab ] && cat /proc/mounts > /etc/mtab
-+	# zpool import refuse to import without a valid /proc/self/mounts
-+	[ ! -f /proc/self/mounts ] && mount proc /proc
- 
- 	# Load the module
- 	load_module "zfs" || return 1
-@@ -919,7 +918,7 @@
- 	#
- 	#   but the MOUNTPOINT prefix is preserved on descendent filesystem
- 	#   after the pivot into the regular root, which later breaks things
--	#   like `zfs mount -a` and the /etc/mtab refresh.
-+	#   like `zfs mount -a` and the /proc/self/mounts refresh.
- 	#
- 	# * Mount additional filesystems required
- 	#   Such as /usr, /var, /usr/local etc.
---- a/etc/init.d/zfs-functions.in
-+++ b/etc/init.d/zfs-functions.in
-@@ -368,7 +368,7 @@
- 			# Set the variable.
- 			eval export MTAB_$mntpnt=\"$fs\"
- 		fi
--	done < /proc/mounts
-+	done < /proc/self/mounts
- }
- 
- in_mtab()
---- a/etc/init.d/zfs-mount.in
-+++ b/etc/init.d/zfs-mount.in
-@@ -39,7 +39,7 @@
- 		if [ "$2" = "/" ]; then
- 			return 0
- 		fi
--	done < /etc/mtab
-+	done < /proc/self/mounts
- 
- 	return 1
- }
-@@ -178,7 +178,7 @@
- 
- 	check_module_loaded "zfs" || exit 0
- 
--	# Ensure / exists in /etc/mtab, if not update mtab accordingly.
-+	# Ensure / exists in /proc/self/mounts.
- 	# This should be handled by rc.sysinit but lets be paranoid.
- 	if ! chkroot
- 	then
---- a/lib/libspl/include/sys/mnttab.h
-+++ b/lib/libspl/include/sys/mnttab.h
-@@ -38,7 +38,7 @@
- #undef MNTTAB
- #endif /* MNTTAB */
- 
--#define	MNTTAB		"/etc/mtab"
-+#define	MNTTAB		"/proc/self/mounts"
- #define	MNT_LINE_MAX	4096
- 
- #define	MNT_TOOLONG	1	/* entry exceeds MNT_LINE_MAX */
---- a/lib/libzfs/libzfs_dataset.c
-+++ b/lib/libzfs/libzfs_dataset.c
-@@ -1825,9 +1825,9 @@
-  * zfs_prop_get_int() are built using this interface.
-  *
-  * Certain properties can be overridden using 'mount -o'.  In this case, scan
-- * the contents of the /etc/mtab entry, searching for the appropriate options.
-- * If they differ from the on-disk values, report the current values and mark
-- * the source "temporary".
-+ * the contents of the /proc/self/mounts entry, searching for the
-+ * appropriate options. If they differ from the on-disk values, report the
-+ * current values and mark the source "temporary".
-  */
- static int
- get_numeric_property(zfs_handle_t *zhp, zfs_prop_t prop, zprop_source_t *src,
-@@ -1898,8 +1898,9 @@
- 
- 	/*
- 	 * Because looking up the mount options is potentially expensive
--	 * (iterating over all of /etc/mtab), we defer its calculation until
--	 * we're looking up a property which requires its presence.
-+	 * (iterating over all of /proc/self/mounts), we defer its
-+	 * calculation until we're looking up a property which requires
-+	 * its presence.
- 	 */
- 	if (!zhp->zfs_mntcheck &&
- 	    (mntopt_on != NULL || prop == ZFS_PROP_MOUNTED)) {
---- a/lib/libzfs/libzfs_mount.c
-+++ b/lib/libzfs/libzfs_mount.c
-@@ -346,8 +346,8 @@
- 		return (0);
- 
- 	/*
--	 * zfs_prop_get_int() to not used to ensure our mount options
--	 * are not influenced by the current /etc/mtab contents.
-+	 * zfs_prop_get_int() is not used to ensure our mount options
-+	 * are not influenced by the current /proc/self/mounts contents.
- 	 */
- 	value = getprop_uint64(zhp, prop, &source);
- 
-@@ -1162,8 +1162,8 @@
-  * Unshare and unmount all datasets within the given pool.  We don't want to
-  * rely on traversing the DSL to discover the filesystems within the pool,
-  * because this may be expensive (if not all of them are mounted), and can fail
-- * arbitrarily (on I/O error, for example).  Instead, we walk /etc/mtab and
-- * gather all the filesystems that are currently mounted.
-+ * arbitrarily (on I/O error, for example).  Instead, we walk /proc/self/mounts
-+ * and gather all the filesystems that are currently mounted.
-  */
- int
- zpool_disable_datasets(zpool_handle_t *zhp, boolean_t force)
---- a/lib/libzfs/libzfs_util.c
-+++ b/lib/libzfs/libzfs_util.c
-@@ -67,9 +67,9 @@
- 		    "loaded.\nTry running '/sbin/modprobe zfs' as root "
- 		    "to load them.\n"));
- 	case ENOENT:
--		return (dgettext(TEXT_DOMAIN, "The /dev/zfs device is "
--		    "missing and must be created.\nTry running 'udevadm "
--		    "trigger' as root to create it.\n"));
-+		return (dgettext(TEXT_DOMAIN, "/dev/zfs and /proc/self/mounts "
-+		    "are required.\nTry running 'udevadm trigger' and 'mount "
-+		    "-t proc proc /proc' as root.\n"));
- 	case ENOEXEC:
- 		return (dgettext(TEXT_DOMAIN, "The ZFS modules cannot be "
- 		    "auto-loaded.\nTry running '/sbin/modprobe zfs' as "
---- a/scripts/ziltest.sh
-+++ b/scripts/ziltest.sh
-@@ -185,7 +185,11 @@
- #
- # TX_WRITE (small file with ordering)
- #
--cp /etc/mtab $ROOT/small_file
-+if is_linux; then
-+	cp /proc/self/mounts $ROOT/small_file
-+else
-+	cp /etc/mtab $ROOT/small_file
-+fi
- cp /etc/profile $ROOT/small_file
- 
- #
diff --git a/debian/patches/1002-fix-mips-build.patch b/debian/patches/1002-fix-mips-build.patch
deleted file mode 100644
index 0df899d..0000000
--- a/debian/patches/1002-fix-mips-build.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-Description: Fix build problem on mips*
-  Make sure required defines are set on mips.
-Author: YunQiang Su <wzssyqa at gmail.com>
-Bug-Debian: https://bugs.debian.org/824190
-Bug: https://github.com/zfsonlinux/zfs/pull/4712
-Reviewed-By: Petter Reinholdtsen <pere at hungry.com>
-Last-Update: 2016-05-25
-Applied-upstream: https://github.com/zfsonlinux/zfs/commit/2493dca54e18b24bcd8b7ff5432f4dc51dddc472
-
-Index: zfs-linux-0.6.5.6/lib/libspl/include/sys/isa_defs.h
-===================================================================
---- zfs-linux-0.6.5.6.orig/lib/libspl/include/sys/isa_defs.h
-+++ zfs-linux-0.6.5.6/lib/libspl/include/sys/isa_defs.h
-@@ -172,7 +172,24 @@ extern "C" {
- #define	_BIG_ENDIAN
- #define	_SUNOS_VTOC_16
- 
--#else /* Currently x86_64, i386, arm, powerpc, s390, and sparc are supported */
-+/* MIPS arch specific defines */
-+#elif defined(__mips__)
-+
-+#if defined(__MIPSEB__)
-+#define	_BIG_ENDIAN
-+#elif defined(__MIPSEL__)
-+#define	_LITTLE_ENDIAN
-+#else
-+#error MIPS no endian specified
-+#endif
-+
-+#ifndef _LP64
-+#define _ILP32
-+#endif
-+
-+#define	_SUNOS_VTOC_16
-+
-+#else /* Currently x86_64, i386, arm, powerpc, s390, sparc and mips are supported */
- #error "Unsupported ISA type"
- #endif
- 
-Index: zfs-linux-0.6.5.6/lib/libefi/rdwr_efi.c
-===================================================================
---- zfs-linux-0.6.5.6.orig/lib/libefi/rdwr_efi.c
-+++ zfs-linux-0.6.5.6/lib/libefi/rdwr_efi.c
-@@ -88,7 +88,8 @@ struct dk_map2  default_vtoc_map[NDKMAP]
- #if defined(_SUNOS_VTOC_16)
- 
- #if defined(i386) || defined(__amd64) || defined(__arm) || \
--    defined(__powerpc) || defined(__sparc) || defined(__s390__)
-+    defined(__powerpc) || defined(__sparc) || defined(__s390__) || \
-+    defined(__mips__)
- 	{	V_BOOT,		V_UNMNT	},		/* i - 8 */
- 	{	V_ALTSCTR,	0	},		/* j - 9 */
- 
diff --git a/debian/patches/1003-fix-rm-path-in-zfs-share.service.patch b/debian/patches/1003-fix-rm-path-in-zfs-share.service.patch
deleted file mode 100644
index 2e1bde2..0000000
--- a/debian/patches/1003-fix-rm-path-in-zfs-share.service.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 190dfc116dfa539a8e1e40c120e4b961c986c2ea Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= <f.gruenbichler at proxmox.com>
-Date: Thu, 27 Oct 2016 10:18:55 +0200
-Subject: [PATCH] fix rm path in zfs-share.service
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
----
- etc/systemd/system/zfs-share.service.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/etc/systemd/system/zfs-share.service.in b/etc/systemd/system/zfs-share.service.in
-index 688731e..494f5cb 100644
---- a/etc/systemd/system/zfs-share.service.in
-+++ b/etc/systemd/system/zfs-share.service.in
-@@ -9,7 +9,7 @@ PartOf=smb.service
- [Service]
- Type=oneshot
- RemainAfterExit=yes
--ExecStartPre=- at bindir@/rm -f /etc/dfs/sharetab
-+ExecStartPre=-/bin/rm -f /etc/dfs/sharetab
- ExecStart=@sbindir@/zfs share -a
- 
- [Install]
--- 
-2.1.4
-
diff --git a/debian/patches/1003-linux-4.9-compat.patch b/debian/patches/1003-linux-4.9-compat.patch
deleted file mode 100644
index a16ccfb..0000000
--- a/debian/patches/1003-linux-4.9-compat.patch
+++ /dev/null
@@ -1,98 +0,0 @@
-Description: Fix dkms build problem with linux 2.9
- Commit 3b0ba3ba99b8a3af0fb532bf264629436b1abd84 fetched from upstream
- and refreshed to apply cleanly.
-Author: Brian Behlendorf <behlendorf1 at llnl.gov>
-Bug-Debian: https://bugs.debian.org/847018
-Forwarded: no
-Reviewed-By: Petter Reinholdtsen <pere at hungry.com>
-Last-Update: 2016-12-15
-
-commit 3b0ba3ba99b8a3af0fb532bf264629436b1abd84
-Author: Brian Behlendorf <behlendorf1 at llnl.gov>
-Date:   Tue Oct 18 23:49:23 2016 +0000
-
-    Linux 4.9 compat: inode_change_ok() renamed setattr_prepare()
-    
-    In torvalds/linux at 31051c8 the inode_change_ok() function was
-    renamed setattr_prepare() and updated to take a dentry ratheri
-    than an inode.  Update the code to call the setattr_prepare()
-    and add a wrapper function which call inode_change_ok() for
-    older kernels.
-    
-    Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
-    Signed-off-by: Chunwei Chen <david.chen at osnexus.com>
-    Requires-spl: refs/pull/581/head
-
-Index: zfs/config/kernel-setattr-prepare.m4
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ zfs/config/kernel-setattr-prepare.m4	2016-12-15 20:52:14.223657574 +0000
-@@ -0,0 +1,23 @@
-+dnl #
-+dnl # 4.9 API change
-+dnl # The inode_change_ok() function has been renamed setattr_prepare()
-+dnl # and updated to take a dentry rather than an inode.
-+dnl #
-+AC_DEFUN([ZFS_AC_KERNEL_SETATTR_PREPARE],
-+	[AC_MSG_CHECKING([whether setattr_prepare() is available])
-+	ZFS_LINUX_TRY_COMPILE_SYMBOL([
-+		#include <linux/fs.h>
-+	], [
-+		struct dentry *dentry = NULL;
-+		struct iattr *attr = NULL;
-+		int error;
-+
-+		error = setattr_prepare(dentry, attr);
-+	], [setattr_prepare], [fs/attr.c], [
-+		AC_MSG_RESULT(yes)
-+		AC_DEFINE(HAVE_SETATTR_PREPARE, 1,
-+		    [setattr_prepare() is available])
-+	], [
-+		AC_MSG_RESULT(no)
-+	])
-+])
-Index: zfs/config/kernel.m4
-===================================================================
---- zfs.orig/config/kernel.m4	2016-12-15 20:52:14.227657605 +0000
-+++ zfs/config/kernel.m4	2016-12-15 20:52:14.223657574 +0000
-@@ -71,6 +71,7 @@
- 	ZFS_AC_KERNEL_ENCODE_FH_WITH_INODE
- 	ZFS_AC_KERNEL_COMMIT_METADATA
- 	ZFS_AC_KERNEL_CLEAR_INODE
-+	ZFS_AC_KERNEL_SETATTR_PREPARE
- 	ZFS_AC_KERNEL_INSERT_INODE_LOCKED
- 	ZFS_AC_KERNEL_D_MAKE_ROOT
- 	ZFS_AC_KERNEL_D_OBTAIN_ALIAS
-Index: zfs/include/linux/vfs_compat.h
-===================================================================
---- zfs.orig/include/linux/vfs_compat.h	2016-12-15 20:52:14.227657605 +0000
-+++ zfs/include/linux/vfs_compat.h	2016-12-15 20:52:14.223657574 +0000
-@@ -362,4 +362,15 @@
- #define	zpl_follow_up(path)			follow_up(path)
- #endif
- 
-+/*
-+ * 4.9 API change
-+ */
-+#ifndef HAVE_SETATTR_PREPARE
-+static inline int
-+setattr_prepare(struct dentry *dentry, struct iattr *ia)
-+{
-+	return (inode_change_ok(dentry->d_inode, ia));
-+}
-+#endif
-+
- #endif /* _ZFS_VFS_H */
-Index: zfs/module/zfs/zpl_inode.c
-===================================================================
---- zfs.orig/module/zfs/zpl_inode.c	2016-12-15 20:52:14.227657605 +0000
-+++ zfs/module/zfs/zpl_inode.c	2016-12-15 20:52:14.223657574 +0000
-@@ -320,7 +320,7 @@
- 	int error;
- 	fstrans_cookie_t cookie;
- 
--	error = inode_change_ok(ip, ia);
-+	error = setattr_prepare(dentry, ia);
- 	if (error)
- 		return (error);
- 
diff --git a/debian/patches/series b/debian/patches/series
index daf2fab..5714ff2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,21 +1,6 @@
 0001-Prevent-manual-builds-in-the-DKMS-source.patch
 0002-Check-for-META-and-DCH-consistency-in-autoconf.patch
 0003-Add-libuutil-to-LIBADD-for-libzfs-and-libzfs_core.patch
-1000-ppc64el-endian-support.patch
-1002-fix-mips-build.patch
-1003-fix-rm-path-in-zfs-share.service.patch
 enable-zed.patch
 1001-cmd-python-exec-path.patch
 1004-zed-service-bindir.patch
-1002-Fix-dev-zfs-device-is-missing.patch
-0001-fix-booting-via-dracut-generated-initramfs.patch
-0032-A-collection-of-dracut-fixes.patch
-0034-Fix-the-test-to-use-the-variable.patch
-0159-Set-proper-dependency-for-string-replacement-targets.patch
-0219-Adapt-genkernel-fix-for-zfsonlinux-zfs-4749-to-zfs-d.patch
-0220-zfs-dracut-module-should-not-assume-systemd-presence.patch
-0246-Fix-regression-that-broke-dracut-initramfs-generatio.patch
-0296-Use-a-different-technique-to-detect-whether-to-mount.patch
-0334-Use-F-to-export-pools-so-as-not-to-dirty-up-device-l.patch
-0336-Properly-use-the-Dracut-cleanup-hook-to-order-pool-s.patch
-0020-Fix-initramfs-hook-for-merged-usr-lib-and-lib.patch

-- 
UNNAMED PROJECT



More information about the Pkg-zfsonlinux-devel mailing list