From e2f4edc81e966dd9b53aafc682f455d77aac8355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Thu, 12 Oct 2017 13:25:45 +0200 Subject: [PATCH] zfs: add various small fixes --- ...ake-module-setup.sh-shebang-explicit.patch | 75 +++++++++++++++ ...-man-add-references-to-systemd-units.patch | 92 +++++++++++++++++++ ...-fix-install-path-of-zpool.d-scripts.patch | 70 ++++++++++++++ ...008-zfsutils-linux-install-new-files.patch | 42 +++++++++ ...09-dh_install-switch-to-fail-missing.patch | 45 +++++++++ zfs-patches/series | 5 + 6 files changed, 329 insertions(+) create mode 100644 zfs-patches/0004-dracut-make-module-setup.sh-shebang-explicit.patch create mode 100644 zfs-patches/0005-man-add-references-to-systemd-units.patch create mode 100644 zfs-patches/0007-fix-install-path-of-zpool.d-scripts.patch create mode 100644 zfs-patches/0008-zfsutils-linux-install-new-files.patch create mode 100644 zfs-patches/0009-dh_install-switch-to-fail-missing.patch diff --git a/zfs-patches/0004-dracut-make-module-setup.sh-shebang-explicit.patch b/zfs-patches/0004-dracut-make-module-setup.sh-shebang-explicit.patch new file mode 100644 index 0000000..c0dc1f4 --- /dev/null +++ b/zfs-patches/0004-dracut-make-module-setup.sh-shebang-explicit.patch @@ -0,0 +1,75 @@ +From 32939d5a4aed18160e508f029e5d26cf62e37ac6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= +Date: Wed, 11 Oct 2017 14:28:07 +0200 +Subject: [PATCH 04/11] dracut: make module-setup.sh shebang explicit +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Fabian Grünbichler +--- + ...cut-make-module-setup.sh-shebang-explicit.patch | 42 ++++++++++++++++++++++ + debian/patches/series | 1 + + 2 files changed, 43 insertions(+) + create mode 100644 debian/patches/0008-dracut-make-module-setup.sh-shebang-explicit.patch + +diff --git a/debian/patches/0008-dracut-make-module-setup.sh-shebang-explicit.patch b/debian/patches/0008-dracut-make-module-setup.sh-shebang-explicit.patch +new file mode 100644 +index 000000000..3114035dc +--- /dev/null ++++ b/debian/patches/0008-dracut-make-module-setup.sh-shebang-explicit.patch +@@ -0,0 +1,42 @@ ++From: Fabian-Gruenbichler ++Date: Mon, 14 Aug 2017 19:56:04 +0200 ++Subject: dracut: make module-setup.sh shebang explicit ++MIME-Version: 1.0 ++Content-Type: text/plain; charset="utf-8" ++Content-Transfer-Encoding: 8bit ++ ++while these are source by dracut (which is a bash script) ++the practical difference is small, but it is more correct: ++ ++/bin/sh is not bash on all systems (e.g. Debian and its ++derivatives use /bin/dash as /bin/sh by default). ++ ++Reviewed-by: Brian Behlendorf ++Signed-off-by: Fabian Grünbichler ++Closes #6491 ++(cherry picked from commit 42a76fc8d757ab82fc1ce8e5e1f2079e07a5b9d4) ++--- ++ contrib/dracut/02zfsexpandknowledge/module-setup.sh.in | 2 +- ++ contrib/dracut/90zfs/module-setup.sh.in | 2 +- ++ 2 files changed, 2 insertions(+), 2 deletions(-) ++ ++diff --git a/contrib/dracut/02zfsexpandknowledge/module-setup.sh.in b/contrib/dracut/02zfsexpandknowledge/module-setup.sh.in ++index 981beb3..c22141f 100755 ++--- a/contrib/dracut/02zfsexpandknowledge/module-setup.sh.in +++++ b/contrib/dracut/02zfsexpandknowledge/module-setup.sh.in ++@@ -1,4 +1,4 @@ ++-#!/bin/sh +++#!/bin/bash ++ ++ get_devtype() { ++ local typ ++diff --git a/contrib/dracut/90zfs/module-setup.sh.in b/contrib/dracut/90zfs/module-setup.sh.in ++index 9bbee0e..7632cbc 100755 ++--- a/contrib/dracut/90zfs/module-setup.sh.in +++++ b/contrib/dracut/90zfs/module-setup.sh.in ++@@ -1,4 +1,4 @@ ++-#!/bin/sh +++#!/bin/bash ++ ++ check() { ++ # We depend on udev-rules being loaded +diff --git a/debian/patches/series b/debian/patches/series +index 5714ff20c..ca6cf6657 100644 +--- a/debian/patches/series ++++ b/debian/patches/series +@@ -4,3 +4,4 @@ + enable-zed.patch + 1001-cmd-python-exec-path.patch + 1004-zed-service-bindir.patch ++0008-dracut-make-module-setup.sh-shebang-explicit.patch +-- +2.14.1 + diff --git a/zfs-patches/0005-man-add-references-to-systemd-units.patch b/zfs-patches/0005-man-add-references-to-systemd-units.patch new file mode 100644 index 0000000..20dfbe1 --- /dev/null +++ b/zfs-patches/0005-man-add-references-to-systemd-units.patch @@ -0,0 +1,92 @@ +From 08b9f2876aaf844c995c9eb461d6eee4589b2ca1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= +Date: Wed, 11 Oct 2017 14:28:31 +0200 +Subject: [PATCH 05/11] man: add references to systemd units +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Fabian Grünbichler +--- + ...9-add-man-page-reference-to-systemd-units.patch | 59 ++++++++++++++++++++++ + debian/patches/series | 1 + + 2 files changed, 60 insertions(+) + create mode 100644 debian/patches/0009-add-man-page-reference-to-systemd-units.patch + +diff --git a/debian/patches/0009-add-man-page-reference-to-systemd-units.patch b/debian/patches/0009-add-man-page-reference-to-systemd-units.patch +new file mode 100644 +index 000000000..523d52f48 +--- /dev/null ++++ b/debian/patches/0009-add-man-page-reference-to-systemd-units.patch +@@ -0,0 +1,59 @@ ++From: =?utf-8?q?Fabian_Gr=C3=BCnbichler?= ++Date: Mon, 4 Sep 2017 10:59:32 +0200 ++Subject: add man page reference to systemd units ++MIME-Version: 1.0 ++Content-Type: text/plain; charset="utf-8" ++Content-Transfer-Encoding: 8bit ++ ++Signed-off-by: Fabian Grünbichler ++--- ++ etc/systemd/system/zfs-import-cache.service.in | 1 + ++ etc/systemd/system/zfs-import-scan.service.in | 1 + ++ etc/systemd/system/zfs-mount.service.in | 1 + ++ etc/systemd/system/zfs-share.service.in | 1 + ++ 4 files changed, 4 insertions(+) ++ ++diff --git a/etc/systemd/system/zfs-import-cache.service.in b/etc/systemd/system/zfs-import-cache.service.in ++index 02184a6..6170676 100644 ++--- a/etc/systemd/system/zfs-import-cache.service.in +++++ b/etc/systemd/system/zfs-import-cache.service.in ++@@ -1,5 +1,6 @@ ++ [Unit] ++ Description=Import ZFS pools by cache file +++Documentation=man:zpool(8) ++ DefaultDependencies=no ++ Requires=systemd-udev-settle.service ++ After=systemd-udev-settle.service ++diff --git a/etc/systemd/system/zfs-import-scan.service.in b/etc/systemd/system/zfs-import-scan.service.in ++index 625f3a9..9254fd3 100644 ++--- a/etc/systemd/system/zfs-import-scan.service.in +++++ b/etc/systemd/system/zfs-import-scan.service.in ++@@ -1,5 +1,6 @@ ++ [Unit] ++ Description=Import ZFS pools by device scanning +++Documentation=man:zpool(8) ++ DefaultDependencies=no ++ Requires=systemd-udev-settle.service ++ After=systemd-udev-settle.service ++diff --git a/etc/systemd/system/zfs-mount.service.in b/etc/systemd/system/zfs-mount.service.in ++index 0664fd9..3da7158 100644 ++--- a/etc/systemd/system/zfs-mount.service.in +++++ b/etc/systemd/system/zfs-mount.service.in ++@@ -1,5 +1,6 @@ ++ [Unit] ++ Description=Mount ZFS filesystems +++Documentation=man:zfs(8) ++ DefaultDependencies=no ++ After=systemd-udev-settle.service ++ After=zfs-import-cache.service ++diff --git a/etc/systemd/system/zfs-share.service.in b/etc/systemd/system/zfs-share.service.in ++index 494f5cb..d0c93a3 100644 ++--- a/etc/systemd/system/zfs-share.service.in +++++ b/etc/systemd/system/zfs-share.service.in ++@@ -1,5 +1,6 @@ ++ [Unit] ++ Description=ZFS file system shares +++Documentation=man:zfs(8) ++ After=nfs-server.service nfs-kernel-server.service ++ After=smb.service ++ After=zfs-mount.service +diff --git a/debian/patches/series b/debian/patches/series +index ca6cf6657..b5e68c829 100644 +--- a/debian/patches/series ++++ b/debian/patches/series +@@ -5,3 +5,4 @@ enable-zed.patch + 1001-cmd-python-exec-path.patch + 1004-zed-service-bindir.patch + 0008-dracut-make-module-setup.sh-shebang-explicit.patch ++0009-add-man-page-reference-to-systemd-units.patch +-- +2.14.1 + diff --git a/zfs-patches/0007-fix-install-path-of-zpool.d-scripts.patch b/zfs-patches/0007-fix-install-path-of-zpool.d-scripts.patch new file mode 100644 index 0000000..5f12bbf --- /dev/null +++ b/zfs-patches/0007-fix-install-path-of-zpool.d-scripts.patch @@ -0,0 +1,70 @@ +From 0621f2d155fcf7b12498e39fdb0867748ce8c626 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= +Date: Thu, 12 Oct 2017 09:01:08 +0200 +Subject: [PATCH 07/11] fix install path of zpool.d scripts +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Fabian Grünbichler +--- + .../0010-fix-install-path-of-zpool.d-scripts.patch | 37 ++++++++++++++++++++++ + debian/patches/series | 1 + + 2 files changed, 38 insertions(+) + create mode 100644 debian/patches/0010-fix-install-path-of-zpool.d-scripts.patch + +diff --git a/debian/patches/0010-fix-install-path-of-zpool.d-scripts.patch b/debian/patches/0010-fix-install-path-of-zpool.d-scripts.patch +new file mode 100644 +index 000000000..8fc81b144 +--- /dev/null ++++ b/debian/patches/0010-fix-install-path-of-zpool.d-scripts.patch +@@ -0,0 +1,37 @@ ++From: =?utf-8?q?Fabian_Gr=C3=BCnbichler?= ++Date: Thu, 12 Oct 2017 08:57:48 +0200 ++Subject: fix install path of zpool.d scripts ++MIME-Version: 1.0 ++Content-Type: text/plain; charset="utf-8" ++Content-Transfer-Encoding: 8bit ++ ++Signed-off-by: Fabian Grünbichler ++--- ++ cmd/zpool/Makefile.am | 6 +++--- ++ 1 file changed, 3 insertions(+), 3 deletions(-) ++ ++diff --git a/cmd/zpool/Makefile.am b/cmd/zpool/Makefile.am ++index 6eff1d1..872a223 100644 ++--- a/cmd/zpool/Makefile.am +++++ b/cmd/zpool/Makefile.am ++@@ -22,11 +22,11 @@ zpool_LDADD = \ ++ -lm $(LIBBLKID) ++ ++ zpoolconfdir = $(sysconfdir)/zfs/zpool.d ++-zpoolexecdir = $(libexecdir)/zfs/zpool.d +++zpoollibdir = /usr/lib/zfs-linux/zpool.d ++ ++ EXTRA_DIST = zpool.d/README ++ ++-dist_zpoolexec_SCRIPTS = \ +++dist_zpoollib_SCRIPTS = \ ++ zpool.d/enc \ ++ zpool.d/encdev \ ++ zpool.d/fault_led \ ++@@ -107,5 +107,5 @@ install-data-hook: ++ for f in $(zpoolconfdefaults); do \ ++ test -f "$(DESTDIR)$(zpoolconfdir)/$${f}" -o \ ++ -L "$(DESTDIR)$(zpoolconfdir)/$${f}" || \ ++- ln -s "$(zpoolexecdir)/$${f}" "$(DESTDIR)$(zpoolconfdir)"; \ +++ ln -s "$(zpoollibdir)/$${f}" "$(DESTDIR)$(zpoolconfdir)"; \ ++ done +diff --git a/debian/patches/series b/debian/patches/series +index b5e68c829..d6f6f87f9 100644 +--- a/debian/patches/series ++++ b/debian/patches/series +@@ -6,3 +6,4 @@ enable-zed.patch + 1004-zed-service-bindir.patch + 0008-dracut-make-module-setup.sh-shebang-explicit.patch + 0009-add-man-page-reference-to-systemd-units.patch ++0010-fix-install-path-of-zpool.d-scripts.patch +-- +2.14.1 + diff --git a/zfs-patches/0008-zfsutils-linux-install-new-files.patch b/zfs-patches/0008-zfsutils-linux-install-new-files.patch new file mode 100644 index 0000000..9c55b1a --- /dev/null +++ b/zfs-patches/0008-zfsutils-linux-install-new-files.patch @@ -0,0 +1,42 @@ +From 63ec66eeb1aefb7b0586a5eee3c0d0288e3451d3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= +Date: Wed, 11 Oct 2017 14:33:14 +0200 +Subject: [PATCH 08/11] zfsutils-linux: install new files +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Fabian Grünbichler +--- + debian/zfsutils-linux.install | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/debian/zfsutils-linux.install b/debian/zfsutils-linux.install +index 5b7dabfa9..b355ec47e 100644 +--- a/debian/zfsutils-linux.install ++++ b/debian/zfsutils-linux.install +@@ -9,6 +9,8 @@ usr/lib/modules-load.d/ lib/ + lib/udev/ + etc/default/zfs + etc/zfs/zfs-functions ++etc/zfs/zpool.d/ ++usr/lib/zfs-linux/zpool.d/ + sbin/fsck.zfs + sbin/mount.zfs + sbin/ztest +@@ -19,6 +21,7 @@ sbin/zdb + sbin/zpios + sbin/zpool + sbin/zfs ++usr/bin/zgenhostid + usr/sbin/arc_summary + usr/sbin/arcstat + usr/sbin/dbufstat +@@ -32,3 +35,4 @@ usr/share/man/man8/zdb.8 + usr/share/man/man8/vdev_id.8 + usr/share/man/man8/mount.zfs.8 + usr/share/man/man8/fsck.zfs.8 ++usr/share/man/man8/zgenhostid.8 +-- +2.14.1 + diff --git a/zfs-patches/0009-dh_install-switch-to-fail-missing.patch b/zfs-patches/0009-dh_install-switch-to-fail-missing.patch new file mode 100644 index 0000000..8ecd5d9 --- /dev/null +++ b/zfs-patches/0009-dh_install-switch-to-fail-missing.patch @@ -0,0 +1,45 @@ +From 8732479a2f06b612fddc7df258f8c3bb97575e09 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= +Date: Wed, 11 Oct 2017 14:33:34 +0200 +Subject: [PATCH 09/11] dh_install: switch to --fail-missing +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Fabian Grünbichler +--- + debian/not-installed | 8 ++++++++ + debian/rules | 2 +- + 2 files changed, 9 insertions(+), 1 deletion(-) + create mode 100644 debian/not-installed + +diff --git a/debian/not-installed b/debian/not-installed +new file mode 100644 +index 000000000..16b1cef6c +--- /dev/null ++++ b/debian/not-installed +@@ -0,0 +1,8 @@ ++usr/share/zfs/zfs-helpers.sh ++etc/init.d ++etc/sudoers.d ++etc/zfs/vdev_id.conf.alias.example ++etc/zfs/vdev_id.conf.multipath.example ++etc/zfs/vdev_id.conf.sas_direct.example ++etc/zfs/vdev_id.conf.sas_switch.example ++usr/lib/dracut +diff --git a/debian/rules b/debian/rules +index 49da7067b..8c5beca10 100755 +--- a/debian/rules ++++ b/debian/rules +@@ -111,7 +111,7 @@ endif + + override_dh_install: + find . -name lib*.la -delete +- dh_install --list-missing ++ dh_install --fail-missing + + # ------------ + +-- +2.14.1 + diff --git a/zfs-patches/series b/zfs-patches/series index 26f918f..9c526a8 100644 --- a/zfs-patches/series +++ b/zfs-patches/series @@ -1,3 +1,8 @@ 0001-remove-DKMS-modules-and-dracut-build.patch 0002-import-with-d-dev-disk-by-id-in-scan-service.patch 0003-add-zfs-test-package.patch +0004-dracut-make-module-setup.sh-shebang-explicit.patch +0005-man-add-references-to-systemd-units.patch +0007-fix-install-path-of-zpool.d-scripts.patch +0008-zfsutils-linux-install-new-files.patch +0009-dh_install-switch-to-fail-missing.patch