From 74c4ca4593bc38e35a3092053bf3eee54ebc240a Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Thu, 20 Nov 2014 11:37:25 -0600 Subject: [PATCH] Working on some patches to the Debian packaging system so that we can build more recent git versions of ZFS on Linux. See Also: https://github.com/zfsonlinux/zfs/issues/2863 --- debian/changelog | 8 ++ debian/control | 26 ++-- debian/gbp.conf | 4 +- debian/libzfs1.install | 1 - debian/{libzfs1.docs => libzfs2.docs} | 0 debian/libzfs2.install | 2 + debian/{libzpool1.docs => libzpool2.docs} | 0 .../{libzpool1.install => libzpool2.install} | 0 ...evert-Retire-zpool_id-infrastructure.patch | 86 +++-------- ...ent-manual-builds-in-the-DKMS-source.patch | 10 +- ...emove-all-upstream-init.d-components.patch | 135 ++++++++++-------- ...Remove-the-upstream-dracut-component.patch | 73 ++++++---- .../0005-Remove-userland-dist-rules.patch | 56 ++------ debian/patches/0006-Tag-zfs-0.6.1.patch | 66 +-------- debian/rules | 4 +- 15 files changed, 190 insertions(+), 281 deletions(-) delete mode 100644 debian/libzfs1.install rename debian/{libzfs1.docs => libzfs2.docs} (100%) create mode 100644 debian/libzfs2.install rename debian/{libzpool1.docs => libzpool2.docs} (100%) rename debian/{libzpool1.install => libzpool2.install} (100%) diff --git a/debian/changelog b/debian/changelog index b3fc82a97..110f1d15f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +zfs-linux (0.6.3-20~7b2d78a) unstable; urgency=low + + * Working on some patches to the Debian packaging system so that we can + build more recent git versions of ZFS on Linux. + See Also: https://github.com/zfsonlinux/zfs/issues/2863 + + -- Brian Kroth Wed, 19 Nov 2014 15:02:55 -0600 + zfs-linux (0.6.1-1~wheezy) wheezy; urgency=low * Initial release. diff --git a/debian/control b/debian/control index b731eaa14..0c124dd2f 100644 --- a/debian/control +++ b/debian/control @@ -71,7 +71,7 @@ Description: Debugging symbols for libuutil1 Package: libzfs-dev Section: libdevel Architecture: linux-any -Depends: ${misc:Depends}, libzfs1 (= ${binary:Version}) +Depends: ${misc:Depends}, libzfs2 (= ${binary:Version}) Provides: libnvpair-dev, libuutil-dev Replaces: libefi1, libnvpair1, @@ -80,13 +80,13 @@ Replaces: libefi1, libunicode1, libuutil1, libzavl1, - libzfs1, - libzpool1, + libzfs2, + libzpool2, Description: Native ZFS filesystem development files for Linux Header files and static libraries for compiling software against libzfs. -Package: libzfs1 +Package: libzfs2 Section: libs Architecture: linux-any Depends: ${misc:Depends}, ${shlibs:Depends} @@ -94,17 +94,17 @@ Replaces: libzfs0 Description: Native ZFS filesystem library for Linux The zfs management library. -Package: libzfs1-dbg +Package: libzfs2-dbg Section: debug Architecture: linux-any -Depends: ${misc:Depends}, libzfs1 (= ${binary:Version}) +Depends: ${misc:Depends}, libzfs2 (= ${binary:Version}) Replaces: libzfs0-dbg -Description: Debugging symbols for libzfs1 +Description: Debugging symbols for libzfs2 The zfs management library. . - This package contains the debugging symbols for libzfs1. + This package contains the debugging symbols for libzfs2. -Package: libzpool1 +Package: libzpool2 Section: libs Architecture: linux-any Depends: ${misc:Depends}, ${shlibs:Depends} @@ -112,15 +112,15 @@ Replaces: libzpool0 Description: Native ZFS pool library for Linux The zpool management library. -Package: libzpool1-dbg +Package: libzpool2-dbg Section: debug Architecture: linux-any -Depends: ${misc:Depends}, libzpool1 (= ${binary:Version}) +Depends: ${misc:Depends}, libzpool2 (= ${binary:Version}) Replaces: libzpool0-dbg -Description: Debugging symbols for libzpool1 +Description: Debugging symbols for libzpool2 The zpool management library. . - This package contains the debugging symbols for libzpool1. + This package contains the debugging symbols for libzpool2. Package: zfs-dkms Section: kernel diff --git a/debian/gbp.conf b/debian/gbp.conf index 2b19c832b..c3e9615f0 100644 --- a/debian/gbp.conf +++ b/debian/gbp.conf @@ -1,5 +1,5 @@ [DEFAULT] -debian-branch=master/debian/wheezy -debian-tag=master/debian/wheezy/%(version)s +debian-branch=debian/wheezy +debian-tag=debian/wheezy/%(version)s upstream-branch=upstream upstream-tag=zfs-%(version)s diff --git a/debian/libzfs1.install b/debian/libzfs1.install deleted file mode 100644 index ffd20dc17..000000000 --- a/debian/libzfs1.install +++ /dev/null @@ -1 +0,0 @@ -lib/libzfs.so.* diff --git a/debian/libzfs1.docs b/debian/libzfs2.docs similarity index 100% rename from debian/libzfs1.docs rename to debian/libzfs2.docs diff --git a/debian/libzfs2.install b/debian/libzfs2.install new file mode 100644 index 000000000..660dede89 --- /dev/null +++ b/debian/libzfs2.install @@ -0,0 +1,2 @@ +lib/libzfs.so.* +lib/libzfs_core.so.* diff --git a/debian/libzpool1.docs b/debian/libzpool2.docs similarity index 100% rename from debian/libzpool1.docs rename to debian/libzpool2.docs diff --git a/debian/libzpool1.install b/debian/libzpool2.install similarity index 100% rename from debian/libzpool1.install rename to debian/libzpool2.install diff --git a/debian/patches/0001-Revert-Retire-zpool_id-infrastructure.patch b/debian/patches/0001-Revert-Retire-zpool_id-infrastructure.patch index 175844067..dc26f3db5 100644 --- a/debian/patches/0001-Revert-Retire-zpool_id-infrastructure.patch +++ b/debian/patches/0001-Revert-Retire-zpool_id-infrastructure.patch @@ -50,22 +50,10 @@ This reverts commit dbf763b39b232996f0d6bb0022e4446643c18e05. create mode 100644 scripts/zpool-layout/dragon.llnl.conf create mode 100644 udev/rules.d/60-zpool.rules.in -Index: b/cmd/Makefile.am -=================================================================== ---- a/cmd/Makefile.am -+++ b/cmd/Makefile.am -@@ -1,2 +1,2 @@ - SUBDIRS = zfs zpool zdb zhack zinject zstreamdump ztest zpios --SUBDIRS += mount_zfs fsck_zfs zvol_id vdev_id -+SUBDIRS += mount_zfs fsck_zfs zpool_layout zvol_id zpool_id vdev_id -Index: b/cmd/zpool_id/Makefile.am -=================================================================== --- /dev/null +++ b/cmd/zpool_id/Makefile.am @@ -0,0 +1 @@ +dist_udev_SCRIPTS = zpool_id -Index: b/cmd/zpool_id/zpool_id -=================================================================== --- /dev/null +++ b/cmd/zpool_id/zpool_id @@ -0,0 +1,86 @@ @@ -155,14 +143,10 @@ Index: b/cmd/zpool_id/zpool_id +fi + +exit 0 -Index: b/cmd/zpool_layout/Makefile.am -=================================================================== --- /dev/null +++ b/cmd/zpool_layout/Makefile.am @@ -0,0 +1 @@ +dist_bin_SCRIPTS = zpool_layout -Index: b/cmd/zpool_layout/zpool_layout -=================================================================== --- /dev/null +++ b/cmd/zpool_layout/zpool_layout @@ -0,0 +1,281 @@ @@ -447,11 +431,9 @@ Index: b/cmd/zpool_layout/zpool_layout +fi + +exit 0 -Index: b/configure.ac -=================================================================== --- a/configure.ac +++ b/configure.ac -@@ -99,7 +99,9 @@ +@@ -106,7 +106,9 @@ cmd/zpios/Makefile cmd/mount_zfs/Makefile cmd/fsck_zfs/Makefile @@ -459,9 +441,9 @@ Index: b/configure.ac cmd/zvol_id/Makefile + cmd/zpool_id/Makefile cmd/vdev_id/Makefile - module/Makefile - module/avl/Makefile -@@ -118,6 +120,7 @@ + cmd/arcstat/Makefile + cmd/dbufstat/Makefile +@@ -130,6 +132,7 @@ scripts/zpios-profile/Makefile scripts/zpios-test/Makefile scripts/zpool-config/Makefile @@ -469,8 +451,6 @@ Index: b/configure.ac scripts/common.sh rpm/Makefile rpm/fedora/Makefile -Index: b/etc/zfs/Makefile.am -=================================================================== --- a/etc/zfs/Makefile.am +++ b/etc/zfs/Makefile.am @@ -4,6 +4,10 @@ @@ -485,8 +465,6 @@ Index: b/etc/zfs/Makefile.am + zdev.conf.x4550.example EXTRA_DIST = $(pkgsysconf_DATA) -Index: b/etc/zfs/zdev.conf -=================================================================== --- /dev/null +++ b/etc/zfs/zdev.conf @@ -0,0 +1,9 @@ @@ -499,8 +477,6 @@ Index: b/etc/zfs/zdev.conf +# +#disk1 pci-0000:61:06.1-scsi-0:0:0:0 +#disk2 pci-0000:61:06.1-scsi-0:0:0:1 -Index: b/etc/zfs/zdev.conf.dragon.example -=================================================================== --- /dev/null +++ b/etc/zfs/zdev.conf.dragon.example @@ -0,0 +1,176 @@ @@ -680,8 +656,6 @@ Index: b/etc/zfs/zdev.conf.dragon.example +j13 pci-0000:83:00.0-sas-0x5000155359dba33f-12 +j14 pci-0000:83:00.0-sas-0x5000155359dba33f-13 +j15 pci-0000:83:00.0-sas-0x5000155359dba33f-14 -Index: b/etc/zfs/zdev.conf.supermicro.example -=================================================================== --- /dev/null +++ b/etc/zfs/zdev.conf.supermicro.example @@ -0,0 +1,30 @@ @@ -715,8 +689,6 @@ Index: b/etc/zfs/zdev.conf.supermicro.example +d2 pci-0000:07:00.0-sas-0x500304800027367f-13 +d3 pci-0000:07:00.0-sas-0x500304800027367f-14 +d4 pci-0000:07:00.0-sas-0x500304800027367f-15 -Index: b/etc/zfs/zdev.conf.x4550.example -=================================================================== --- /dev/null +++ b/etc/zfs/zdev.conf.x4550.example @@ -0,0 +1,66 @@ @@ -786,24 +758,20 @@ Index: b/etc/zfs/zdev.conf.x4550.example +f6 pci-0000:43:00.0-sas-0x50062b000000000b:1:5-0xd5885781dee7de92:5 +f7 pci-0000:43:00.0-sas-0x50062b000000000c:1:6-0xd3827481d804e192:6 +f8 pci-0000:43:00.0-sas-0x50062b000000000d:1:7-0xd6806863d6f8bf92:7 -Index: b/include/libzfs.h -=================================================================== --- a/include/libzfs.h +++ b/include/libzfs.h -@@ -57,7 +57,7 @@ - #define DISK_ROOT "/dev" - #define UDISK_ROOT "/dev/disk" +@@ -64,7 +64,7 @@ + */ + #define DISK_LABEL_WAIT (30 * 1000) /* 30 seconds */ -#define DEFAULT_IMPORT_PATH_SIZE 7 +#define DEFAULT_IMPORT_PATH_SIZE 8 extern char *zpool_default_import_path[DEFAULT_IMPORT_PATH_SIZE]; /* -Index: b/lib/libzfs/libzfs_import.c -=================================================================== --- a/lib/libzfs/libzfs_import.c +++ b/lib/libzfs/libzfs_import.c -@@ -980,6 +980,7 @@ +@@ -1006,6 +1006,7 @@ char * zpool_default_import_path[DEFAULT_IMPORT_PATH_SIZE] = { "/dev/disk/by-vdev", /* Custom rules, use first if they exist */ @@ -811,22 +779,18 @@ Index: b/lib/libzfs/libzfs_import.c "/dev/mapper", /* Use multipath devices before components */ "/dev/disk/by-uuid", /* Single unique entry and persistent */ "/dev/disk/by-id", /* May be multiple entries and persistent */ -Index: b/scripts/Makefile.am -=================================================================== --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = zpool-config zpios-test zpios-profile +SUBDIRS = zpool-config zpool-layout zpios-test zpios-profile - EXTRA_DIST = dkms.mkconf dkms.postinst kmodtool + EXTRA_DIST = dkms.mkconf dkms.postbuild kmodtool zfs2zol-patch.sed cstyle.pl -Index: b/scripts/common.sh.in -=================================================================== --- a/scripts/common.sh.in +++ b/scripts/common.sh.in -@@ -40,7 +40,7 @@ - sysconfdir=@sysconfdir@ +@@ -41,7 +41,7 @@ + localstatedir=@localstatedir@ ETCDIR=${ETCDIR:-/etc} -DEVDIR=${DEVDIR:-/dev/disk/by-vdev} @@ -834,7 +798,7 @@ Index: b/scripts/common.sh.in ZPOOLDIR=${ZPOOLDIR:-${pkgdatadir}/zpool-config} ZPIOSDIR=${ZPIOSDIR:-${pkgdatadir}/zpios-test} ZPIOSPROFILEDIR=${ZPIOSPROFILEDIR:-${pkgdatadir}/zpios-profile} -@@ -49,6 +49,7 @@ +@@ -50,6 +50,7 @@ ZFS=${ZFS:-${sbindir}/zfs} ZINJECT=${ZINJECT:-${sbindir}/zinject} ZPOOL=${ZPOOL:-${sbindir}/zpool} @@ -842,7 +806,7 @@ Index: b/scripts/common.sh.in ZTEST=${ZTEST:-${sbindir}/ztest} ZPIOS=${ZPIOS:-${sbindir}/zpios} -@@ -523,7 +524,7 @@ +@@ -558,7 +559,7 @@ # # The following udev helper functions assume that the provided @@ -851,8 +815,6 @@ Index: b/scripts/common.sh.in # disk mapping. In this mapping each CHANNEL is represented by # the letters a-z, and the RANK is represented by the numbers # 1-n. A CHANNEL should identify a group of RANKS which are all -Index: b/scripts/zpool-config/zpool-raid0.sh -=================================================================== --- a/scripts/zpool-config/zpool-raid0.sh +++ b/scripts/zpool-config/zpool-raid0.sh @@ -2,9 +2,10 @@ @@ -869,8 +831,6 @@ Index: b/scripts/zpool-config/zpool-raid0.sh # # You can then use either the zpool-create.sh or the zpios.sh test script to # test various Raid-0 configurations by adjusting the following tunables. -Index: b/scripts/zpool-config/zpool-raid10.sh -=================================================================== --- a/scripts/zpool-config/zpool-raid10.sh +++ b/scripts/zpool-config/zpool-raid10.sh @@ -2,9 +2,10 @@ @@ -887,8 +847,6 @@ Index: b/scripts/zpool-config/zpool-raid10.sh # # You can then use either the zpool-create.sh or the zpios.sh test script to # test various Raid-10 configurations by adjusting the following tunables. -Index: b/scripts/zpool-config/zpool-raidz.sh -=================================================================== --- a/scripts/zpool-config/zpool-raidz.sh +++ b/scripts/zpool-config/zpool-raidz.sh @@ -2,9 +2,10 @@ @@ -905,8 +863,6 @@ Index: b/scripts/zpool-config/zpool-raidz.sh # # You can then use either the zpool-create.sh or the zpios.sh test script to # test various Raid-Z configurations by adjusting the following tunables. -Index: b/scripts/zpool-layout/Makefile.am -=================================================================== --- /dev/null +++ b/scripts/zpool-layout/Makefile.am @@ -0,0 +1,22 @@ @@ -932,8 +888,6 @@ Index: b/scripts/zpool-layout/Makefile.am + $(RM) $$link; \ + fi \ + done -Index: b/scripts/zpool-layout/dragon.ddn.conf -=================================================================== --- /dev/null +++ b/scripts/zpool-layout/dragon.ddn.conf @@ -0,0 +1,67 @@ @@ -1004,8 +958,6 @@ Index: b/scripts/zpool-layout/dragon.ddn.conf +58 36 +59 48 +60 60 -Index: b/scripts/zpool-layout/dragon.llnl.conf -=================================================================== --- /dev/null +++ b/scripts/zpool-layout/dragon.llnl.conf @@ -0,0 +1,67 @@ @@ -1076,8 +1028,6 @@ Index: b/scripts/zpool-layout/dragon.llnl.conf +58 43 +59 37 +60 31 -Index: b/udev/rules.d/60-zpool.rules.in -=================================================================== --- /dev/null +++ b/udev/rules.d/60-zpool.rules.in @@ -0,0 +1,9 @@ @@ -1090,8 +1040,6 @@ Index: b/udev/rules.d/60-zpool.rules.in +KERNEL=="*[!0-9]", ENV{SUBSYSTEM}=="block", ENV{ID_ZPOOL}=="?*", SYMLINK+="$env{ID_ZPOOL_PATH}" +KERNEL=="*[0-9]", ENV{SUBSYSTEM}=="block", ENV{DEVTYPE}=="partition", ENV{ID_ZPOOL}=="?*", SYMLINK+="$env{ID_ZPOOL_PATH}-part%n" +KERNEL=="dm-[0-9]*", ENV{SUBSYSTEM}=="block", ENV{ID_ZPOOL}=="?*", SYMLINK+="$env{ID_ZPOOL_PATH}" -Index: b/udev/rules.d/Makefile.am -=================================================================== --- a/udev/rules.d/Makefile.am +++ b/udev/rules.d/Makefile.am @@ -1,10 +1,12 @@ @@ -1107,8 +1055,6 @@ Index: b/udev/rules.d/Makefile.am $(top_srcdir)/udev/rules.d/60-zvol.rules.in \ $(top_srcdir)/udev/rules.d/90-zfs.rules.in -Index: b/zfs-script-config.sh.in -=================================================================== --- a/zfs-script-config.sh.in +++ b/zfs-script-config.sh.in @@ -24,6 +24,7 @@ @@ -1119,3 +1065,9 @@ Index: b/zfs-script-config.sh.in ZTEST=${CMDDIR}/ztest/ztest ZPIOS=${CMDDIR}/zpios/zpios +--- a/cmd/Makefile.am ++++ b/cmd/Makefile.am +@@ -1,2 +1,2 @@ + SUBDIRS = zfs zpool zdb zhack zinject zstreamdump ztest zpios +-SUBDIRS += mount_zfs fsck_zfs zvol_id vdev_id arcstat dbufstat zed ++SUBDIRS += mount_zfs fsck_zfs zpool_layout zvol_id zpool_id vdev_id arcstat dbufstat zed diff --git a/debian/patches/0002-Prevent-manual-builds-in-the-DKMS-source.patch b/debian/patches/0002-Prevent-manual-builds-in-the-DKMS-source.patch index 9189377dd..19f1917b0 100644 --- a/debian/patches/0002-Prevent-manual-builds-in-the-DKMS-source.patch +++ b/debian/patches/0002-Prevent-manual-builds-in-the-DKMS-source.patch @@ -19,8 +19,6 @@ ZFS has a DKMS registration. 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 config/dkms.m4 -Index: b/config/dkms.m4 -=================================================================== --- /dev/null +++ b/config/dkms.m4 @@ -0,0 +1,14 @@ @@ -38,8 +36,6 @@ Index: b/config/dkms.m4 + AC_MSG_RESULT([not found]) + ]) +]) -Index: b/config/user.m4 -=================================================================== --- a/config/user.m4 +++ b/config/user.m4 @@ -2,6 +2,7 @@ @@ -47,11 +43,9 @@ Index: b/config/user.m4 dnl # AC_DEFUN([ZFS_AC_CONFIG_USER], [ + ZFS_AC_DKMS_INHIBIT + ZFS_AC_CONFIG_USER_MOUNT_HELPER ZFS_AC_CONFIG_USER_UDEV - ZFS_AC_CONFIG_USER_DRACUT - ZFS_AC_CONFIG_USER_ARCH -Index: b/config/zfs-build.m4 -=================================================================== + ZFS_AC_CONFIG_USER_SYSTEMD --- a/config/zfs-build.m4 +++ b/config/zfs-build.m4 @@ -86,10 +86,10 @@ diff --git a/debian/patches/0003-Remove-all-upstream-init.d-components.patch b/debian/patches/0003-Remove-all-upstream-init.d-components.patch index 686655bb4..635439346 100644 --- a/debian/patches/0003-Remove-all-upstream-init.d-components.patch +++ b/debian/patches/0003-Remove-all-upstream-init.d-components.patch @@ -25,36 +25,23 @@ bundles init files according to Debian packaging policy. delete mode 100644 etc/init.d/zfs.lunar.in delete mode 100644 etc/init.d/zfs.redhat.in -Index: b/configure.ac -=================================================================== --- a/configure.ac +++ b/configure.ac -@@ -61,7 +61,6 @@ +@@ -62,7 +62,6 @@ udev/Makefile udev/rules.d/Makefile etc/Makefile - etc/init.d/Makefile etc/zfs/Makefile - man/Makefile - man/man1/Makefile -Index: b/etc/Makefile.am -=================================================================== ---- a/etc/Makefile.am -+++ b/etc/Makefile.am -@@ -1 +1 @@ --SUBDIRS = init.d zfs -+SUBDIRS = zfs -Index: b/etc/init.d/.gitignore -=================================================================== + etc/systemd/Makefile + etc/systemd/system/Makefile --- a/etc/init.d/.gitignore +++ /dev/null @@ -1 +0,0 @@ -zfs -Index: b/etc/init.d/zfs.fedora.in -=================================================================== --- a/etc/init.d/zfs.fedora.in +++ /dev/null -@@ -1,244 +0,0 @@ +@@ -1,243 +0,0 @@ -#!/bin/bash -# -# zfs This script will mount/umount the zfs filesystems. @@ -82,6 +69,11 @@ Index: b/etc/init.d/zfs.fedora.in - -export PATH=/usr/local/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin - +-if [ -z "$init" ]; then +- # Not interactive +- grep -qE '(^|[^\\](\\\\)* )zfs=(off|no)( |$)' /proc/cmdline && exit 3 +-fi +- -# Source function library & LSB routines -. /etc/rc.d/init.d/functions - @@ -178,12 +170,6 @@ Index: b/etc/init.d/zfs.fedora.in - return 5 - } - -- # Requires selinux policy which has not been written. -- if [ -r "/selinux/enforce" ] && -- [ "$(cat /selinux/enforce)" = "1" ]; then -- action $"SELinux ZFS policy required: " /bin/false || return 6 -- fi -- - # Delay until all required block devices are present. - udevadm settle - @@ -299,21 +285,32 @@ Index: b/etc/init.d/zfs.fedora.in -esac - -exit $RETVAL -Index: b/etc/init.d/zfs.gentoo.in -=================================================================== --- a/etc/init.d/zfs.gentoo.in +++ /dev/null -@@ -1,111 +0,0 @@ +@@ -1,124 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2011 Gentoo Foundation -# Released under the 2-clause BSD license. -# $Header: /var/cvsroot/gentoo-x86/sys-fs/zfs/files/zfs,v 0.9 2011/04/30 10:13:43 devsk Exp $ - +-if [ -z "$init" ]; then +- # Not interactive +- grep -qE '(^|[^\\](\\\\)* )zfs=(off|no)( |$)' /proc/cmdline && exit 3 +-fi +- -depend() -{ +- # Try to allow people to mix and match fstab with ZFS in a way that makes sense. +- if [ "$(mountinfo -s /)" = 'zfs' ] +- then +- before localmount +- else +- after localmount +- fi +- - # bootmisc will log to /var which may be a different zfs than root. -- before net bootmisc -- after udev localmount +- before bootmisc logger +- use mtab - keyword -lxc -openvz -prefix -vserver -} - @@ -415,11 +412,9 @@ Index: b/etc/init.d/zfs.gentoo.in - # show pool status and list - $ZPOOL status && echo && $ZPOOL list -} -Index: b/etc/init.d/zfs.lsb.in -=================================================================== --- a/etc/init.d/zfs.lsb.in +++ /dev/null -@@ -1,130 +0,0 @@ +@@ -1,153 +0,0 @@ -#!/bin/bash -# -# zfs This script will mount/umount the zfs filesystems. @@ -451,6 +446,10 @@ Index: b/etc/init.d/zfs.lsb.in -ZFS="@sbindir@/zfs" -ZPOOL="@sbindir@/zpool" -ZPOOL_CACHE="@sysconfdir@/zfs/zpool.cache" +-USE_DISK_BY_ID=0 +-VERBOSE_MOUNT=0 +-DO_OVERLAY_MOUNTS=0 +-MOUNT_EXTRA_OPTIONS="" - -# Source zfs configuration. -[ -r '/etc/default/zfs' ] && . /etc/default/zfs @@ -458,18 +457,15 @@ Index: b/etc/init.d/zfs.lsb.in -[ -x "$ZPOOL" ] || exit 1 -[ -x "$ZFS" ] || exit 2 - +-if [ -z "$init" ]; then +- # Not interactive +- grep -qE '(^|[^\\](\\\\)* )zfs=(off|no)( |$)' /proc/cmdline && exit 3 +-fi +- -start() -{ - [ -f "$LOCKFILE" ] && return 3 - -- # Requires selinux policy which has not been written. -- if [ -r "/selinux/enforce" ] && -- [ "$(cat /selinux/enforce)" = "1" ]; then -- -- log_failure_msg "SELinux ZFS policy required" -- return 4 -- fi -- - # Delay until all required block devices are present. - udevadm settle - @@ -486,13 +482,31 @@ Index: b/etc/init.d/zfs.lsb.in - - # Import all pools described by the cache file, and then mount - # all filesystem based on their properties. -- if [ -f "$ZPOOL_CACHE" ] ; then +- if [ "$USE_DISK_BY_ID" -eq 1 ]; then +- log_begin_msg "Importing ZFS pools" +- "$ZPOOL" import -d /dev/disk/by-id -aN 2>/dev/null +- ret=$? +- log_end_msg $ret +- [ "$ret" -eq 0 ] && POOL_IMPORTED=1 +- elif [ -f "$ZPOOL_CACHE" ] ; then - log_begin_msg "Importing ZFS pools" - "$ZPOOL" import -c "$ZPOOL_CACHE" -aN 2>/dev/null -- log_end_msg $? +- ret=$? +- log_end_msg $ret +- [ "$ret" -eq 0 ] && POOL_IMPORTED=1 +- fi +- +- if [ -n "$POOL_IMPORTED" ]; then +- if [ "$VERBOSE_MOUNT" -eq 1 ]; then +- verbose=v +- fi +- +- if [ "$DO_OVERLAY_MOUNTS" -eq 1 ]; then +- overlay=O +- fi - - log_begin_msg "Mounting ZFS filesystems" -- "$ZFS" mount -a +- "$ZFS" mount -a$verbose$overlay$MOUNT_EXTRA_OPTIONS - log_end_msg $? - - log_begin_msg "Exporting ZFS filesystems" @@ -507,6 +521,10 @@ Index: b/etc/init.d/zfs.lsb.in -{ - [ ! -f "$LOCKFILE" ] && return 3 - +- log_begin_msg "Unsharing ZFS filesystems" +- "$ZFS" unshare -a +- log_end_msg $? +- - log_begin_msg "Unmounting ZFS filesystems" - "$ZFS" umount -a - log_end_msg $? @@ -550,11 +568,9 @@ Index: b/etc/init.d/zfs.lsb.in -esac - -exit $RETVAL -Index: b/etc/init.d/zfs.lunar.in -=================================================================== --- a/etc/init.d/zfs.lunar.in +++ /dev/null -@@ -1,95 +0,0 @@ +@@ -1,100 +0,0 @@ -#!/bin/bash -# -# zfs This shell script takes care of starting (mount) and @@ -571,6 +587,11 @@ Index: b/etc/init.d/zfs.lunar.in -ZPOOL="@sbindir@/zpool" -ZPOOL_CACHE="@sysconfdir@/zfs/zpool.cache" - +-if [ -z "$init" ]; then +- # Not interactive +- grep -qE '(^|[^\\](\\\\)* )zfs=(off|no)( |$)' /proc/cmdline && exit 3 +-fi +- -case $1 in - start) echo "$1ing ZFS filesystems" - @@ -650,11 +671,9 @@ Index: b/etc/init.d/zfs.lunar.in - ;; - -esac -Index: b/etc/init.d/zfs.redhat.in -=================================================================== --- a/etc/init.d/zfs.redhat.in +++ /dev/null -@@ -1,176 +0,0 @@ +@@ -1,175 +0,0 @@ -#!/bin/bash -# -# zfs This script will mount/umount the zfs filesystems. @@ -682,6 +701,11 @@ Index: b/etc/init.d/zfs.redhat.in - -export PATH=/usr/local/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin - +-if [ -z "$init" ]; then +- # Not interactive +- grep -qE '(^|[^\\](\\\\)* )zfs=(off|no)( |$)' /proc/cmdline && exit 3 +-fi +- -# Source function library & LSB routines -. /etc/rc.d/init.d/functions - @@ -728,12 +752,6 @@ Index: b/etc/init.d/zfs.redhat.in - return 5 - } - -- # Requires selinux policy which has not been written. -- if [ -r "/selinux/enforce" ] && -- [ "$(cat /selinux/enforce)" = "1" ]; then -- action $"SELinux ZFS policy required: " /bin/false || return 6 -- fi -- - # Delay until all required block devices are present. - if [ -x /sbin/udevadm ]; then - /sbin/udevadm settle @@ -831,8 +849,6 @@ Index: b/etc/init.d/zfs.redhat.in -esac - -exit $RETVAL -Index: b/etc/init.d/Makefile.am -=================================================================== --- a/etc/init.d/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ @@ -857,3 +873,10 @@ Index: b/etc/init.d/Makefile.am - -distclean-local:: - -$(RM) $(init_SCRIPTS) +--- a/etc/Makefile.am ++++ b/etc/Makefile.am +@@ -1,2 +1,2 @@ +-SUBDIRS = zfs $(ZFS_INIT_SYSTEMD) $(ZFS_INIT_SYSV) $(ZFS_MODULE_LOAD) +-DIST_SUBDIRS = init.d zfs systemd modules-load.d ++SUBDIRS = zfs $(ZFS_INIT_SYSTEMD) $(ZFS_MODULE_LOAD) ++DIST_SUBDIRS = zfs systemd modules-load.d diff --git a/debian/patches/0004-Remove-the-upstream-dracut-component.patch b/debian/patches/0004-Remove-the-upstream-dracut-component.patch index 03b561e57..ec74157eb 100644 --- a/debian/patches/0004-Remove-the-upstream-dracut-component.patch +++ b/debian/patches/0004-Remove-the-upstream-dracut-component.patch @@ -25,24 +25,20 @@ dracut-005 package that is currently published in Debian and Ubuntu. delete mode 100644 dracut/Makefile.am delete mode 100644 dracut/README.dracut.markdown -Index: b/Makefile.am -=================================================================== --- a/Makefile.am +++ b/Makefile.am -@@ -4,7 +4,7 @@ +@@ -7,7 +7,7 @@ SUBDIRS = include rpm if CONFIG_USER --SUBDIRS += dracut udev etc man scripts lib cmd -+SUBDIRS += udev etc man scripts lib cmd +-SUBDIRS += dracut udev etc man scripts lib cmd contrib ++SUBDIRS += udev etc man scripts lib cmd contrib endif if CONFIG_KERNEL SUBDIRS += module -Index: b/configure.ac -=================================================================== --- a/configure.ac +++ b/configure.ac -@@ -56,8 +56,6 @@ +@@ -57,8 +57,6 @@ AC_CONFIG_FILES([ Makefile @@ -51,19 +47,16 @@ Index: b/configure.ac udev/Makefile udev/rules.d/Makefile etc/Makefile -Index: b/dracut/90zfs/.gitignore -=================================================================== --- a/dracut/90zfs/.gitignore -+++ /dev/null -@@ -1,3 +0,0 @@ ++++ b/dracut/90zfs/.gitignore +@@ -1,4 +1 @@ + export-zfs.sh -module-setup.sh -mount-zfs.sh -parse-zfs.sh -Index: b/dracut/90zfs/mount-zfs.sh.in -=================================================================== --- a/dracut/90zfs/mount-zfs.sh.in +++ /dev/null -@@ -1,71 +0,0 @@ +@@ -1,73 +0,0 @@ -#!/bin/sh - -. /lib/dracut-lib.sh @@ -84,13 +77,13 @@ Index: b/dracut/90zfs/mount-zfs.sh.in - - # Might be imported by the kernel module, so try searching before - # we import anything. -- zfsbootfs=`zpool list -H -o bootfs | sed -n '/-/ !p' | sed 'q'` +- zfsbootfs=`zpool list -H -o bootfs | sed -n '/^-$/ !p' | sed 'q'` - if [ "$?" != "0" ] || [ "$zfsbootfs" = "" ] || \ - [ "$zfsbootfs" = "no pools available" ] ; then - # Not there, so we need to import everything. - info "ZFS: Attempting to import additional pools." - zpool import -N -a ${ZPOOL_FORCE} -- zfsbootfs=`zpool list -H -o bootfs | sed -n '/-/ !p' | sed 'q'` +- zfsbootfs=`zpool list -H -o bootfs | sed -n '/^-$/ !p' | sed 'q'` - if [ "$?" != "0" ] || [ "$zfsbootfs" = "" ] || \ - [ "$zfsbootfs" = "no pools available" ] ; then - rootok=0 @@ -133,10 +126,10 @@ Index: b/dracut/90zfs/mount-zfs.sh.in - else - mount -o zfsutil -t zfs "$zfsbootfs" "$NEWROOT" && ROOTFS_MOUNTED=yes - fi +- +- need_shutdown - ;; -esac -Index: b/dracut/90zfs/parse-zfs.sh.in -=================================================================== --- a/dracut/90zfs/parse-zfs.sh.in +++ /dev/null @@ -1,58 +0,0 @@ @@ -198,19 +191,15 @@ Index: b/dracut/90zfs/parse-zfs.sh.in - ln -s /dev/null /dev/root 2>/dev/null - echo '[ -e /dev/zfs ]' > $hookdir/initqueue/finished/zfs.sh -fi -Index: b/dracut/Makefile.am -=================================================================== --- a/dracut/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -SUBDIRS = 90zfs - -EXTRA_DIST = README.dracut.markdown -Index: b/dracut/README.dracut.markdown -=================================================================== --- a/dracut/README.dracut.markdown +++ /dev/null -@@ -1,166 +0,0 @@ +@@ -1,191 +0,0 @@ -How to setup a zfs root filesystem using dracut ------------------------------------------------ - @@ -290,6 +279,9 @@ Index: b/dracut/README.dracut.markdown -* `mount-zfs.sh`: Run later in initramfs boot process after udev has settled -to mount the root dataset. - +-* `export-zfs.sh`: Run on shutdown after dracut has restored the initramfs +-and pivoted to it, allowing for a clean unmount and export of the ZFS root. +- -`module-setup.sh` ---------------- - @@ -377,18 +369,40 @@ Index: b/dracut/README.dracut.markdown -should be used with extreme caution. Note that even with this flag set, if -the required zpool was auto-imported by the kernel module, no additional -`zpool import` commands are run, so nothing is forced. -Index: b/dracut/90zfs/Makefile.am -=================================================================== +- +-`export-zfs.sh` +-------------- +- +-Normally the zpool containing the root dataset cannot be exported on +-shutdown as it is still in use by the init process. To work around this, +-Dracut is able to restore the initramfs on shutdown and pivot to it. +-All remaining process are then running from a ramdisk, allowing for a +-clean unmount and export of the ZFS root. The theory of operation is +-described in detail in the [Dracut manual](https://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html#_dracut_on_shutdown). +- +-This script will try to export all remaining zpools after Dracut has +-pivoted to the initramfs. If an initial regular export is not successful, +-Dracut will call this script once more with the `final` option, +-in which case a forceful export is attempted. +- +-Other Dracut modules include similar shutdown scripts and Dracut +-invokes these scripts round-robin until they succeed. In particular, +-the `90dm` module installs a script which tries to close and remove +-all device mapper targets. Thus, if there are ZVOLs containing +-dm-crypt volumes or if the zpool itself is backed by a dm-crypt +-volume, the shutdown scripts will try to untangle this. --- a/dracut/90zfs/Makefile.am +++ /dev/null -@@ -1,21 +0,0 @@ +@@ -1,23 +0,0 @@ -pkgdracutdir = $(dracutdir)/modules.d/90zfs -pkgdracut_SCRIPTS = \ +- $(top_srcdir)/dracut/90zfs/export-zfs.sh \ - $(top_srcdir)/dracut/90zfs/module-setup.sh \ - $(top_srcdir)/dracut/90zfs/mount-zfs.sh \ - $(top_srcdir)/dracut/90zfs/parse-zfs.sh - -EXTRA_DIST = \ +- $(top_srcdir)/dracut/90zfs/export-zfs.sh.in \ - $(top_srcdir)/dracut/90zfs/module-setup.sh.in \ - $(top_srcdir)/dracut/90zfs/mount-zfs.sh.in \ - $(top_srcdir)/dracut/90zfs/parse-zfs.sh.in @@ -403,11 +417,9 @@ Index: b/dracut/90zfs/Makefile.am - -distclean-local:: - -$(RM) $(pkgdracut_SCRIPTS) -Index: b/dracut/90zfs/module-setup.sh.in -=================================================================== --- a/dracut/90zfs/module-setup.sh.in +++ /dev/null -@@ -1,56 +0,0 @@ +@@ -1,57 +0,0 @@ -#!/bin/sh - -check() { @@ -449,6 +461,7 @@ Index: b/dracut/90zfs/module-setup.sh.in - dracut_install hostid - inst_hook cmdline 95 "$moddir/parse-zfs.sh" - inst_hook mount 98 "$moddir/mount-zfs.sh" +- inst_hook shutdown 30 "$moddir/export-zfs.sh" - - if [ -e @sysconfdir@/zfs/zpool.cache ]; then - inst @sysconfdir@/zfs/zpool.cache diff --git a/debian/patches/0005-Remove-userland-dist-rules.patch b/debian/patches/0005-Remove-userland-dist-rules.patch index 2c65be22c..ca63e6f12 100644 --- a/debian/patches/0005-Remove-userland-dist-rules.patch +++ b/debian/patches/0005-Remove-userland-dist-rules.patch @@ -19,28 +19,22 @@ instances of EXTRA_DIST and change dist_ to nodist_. udev/rules.d/Makefile.am | 5 ----- 9 files changed, 6 insertions(+), 15 deletions(-) -Index: b/Makefile.am -=================================================================== --- a/Makefile.am +++ b/Makefile.am -@@ -17,7 +17,7 @@ +@@ -20,7 +20,7 @@ endif AUTOMAKE_OPTIONS = foreign -EXTRA_DIST = autogen.sh copy-builtin -+EXTRA_DIST = ++EXTRA_DIST = EXTRA_DIST += config/config.awk config/rpm.am config/deb.am config/tgz.am EXTRA_DIST += META DISCLAIMER COPYRIGHT README.markdown OPENSOLARIS.LICENSE -Index: b/cmd/vdev_id/Makefile.am -=================================================================== --- a/cmd/vdev_id/Makefile.am +++ b/cmd/vdev_id/Makefile.am @@ -1 +1 @@ -dist_udev_SCRIPTS = vdev_id +nodist_udev_SCRIPTS = vdev_id -Index: b/etc/zfs/Makefile.am -=================================================================== --- a/etc/zfs/Makefile.am +++ b/etc/zfs/Makefile.am @@ -9,5 +9,3 @@ @@ -49,35 +43,6 @@ Index: b/etc/zfs/Makefile.am zdev.conf.x4550.example - -EXTRA_DIST = $(pkgsysconf_DATA) -Index: b/man/man8/Makefile.am -=================================================================== ---- a/man/man8/Makefile.am -+++ b/man/man8/Makefile.am -@@ -8,7 +8,5 @@ - zpool.8 \ - zstreamdump.8 - --EXTRA_DIST = $(man_MANS) -- - install-data-local: - $(INSTALL) -d -m 0755 "$(DESTDIR)$(mandir)/man8" -Index: b/scripts/Makefile.am -=================================================================== ---- a/scripts/Makefile.am -+++ b/scripts/Makefile.am -@@ -1,9 +1,7 @@ - SUBDIRS = zpool-config zpool-layout zpios-test zpios-profile - --EXTRA_DIST = dkms.mkconf dkms.postinst kmodtool -- - pkgdatadir = $(datadir)/@PACKAGE@ --dist_pkgdata_SCRIPTS = \ -+nodist_pkgdata_SCRIPTS = \ - $(top_builddir)/scripts/common.sh \ - $(top_srcdir)/scripts/zconfig.sh \ - $(top_srcdir)/scripts/zfault.sh \ -Index: b/scripts/zpios-profile/Makefile.am -=================================================================== --- a/scripts/zpios-profile/Makefile.am +++ b/scripts/zpios-profile/Makefile.am @@ -1,5 +1,5 @@ @@ -87,8 +52,6 @@ Index: b/scripts/zpios-profile/Makefile.am $(top_srcdir)/scripts/zpios-profile/zpios-profile-disk.sh \ $(top_srcdir)/scripts/zpios-profile/zpios-profile-pids.sh \ $(top_srcdir)/scripts/zpios-profile/zpios-profile-post.sh \ -Index: b/scripts/zpios-test/Makefile.am -=================================================================== --- a/scripts/zpios-test/Makefile.am +++ b/scripts/zpios-test/Makefile.am @@ -1,5 +1,5 @@ @@ -98,8 +61,6 @@ Index: b/scripts/zpios-test/Makefile.am $(top_srcdir)/scripts/zpios-test/16th-8192rc-4rs-1cs-4off.sh \ $(top_srcdir)/scripts/zpios-test/1th-16rc-4rs-1cs-4off.sh \ $(top_srcdir)/scripts/zpios-test/1x256th-65536rc-4rs-1cs-4off.sh \ -Index: b/scripts/zpool-config/Makefile.am -=================================================================== --- a/scripts/zpool-config/Makefile.am +++ b/scripts/zpool-config/Makefile.am @@ -1,5 +1,5 @@ @@ -109,3 +70,16 @@ Index: b/scripts/zpool-config/Makefile.am $(top_srcdir)/scripts/zpool-config/dm0-raid0.sh \ $(top_srcdir)/scripts/zpool-config/file-raid0.sh \ $(top_srcdir)/scripts/zpool-config/file-raid10.sh \ +--- a/scripts/Makefile.am ++++ b/scripts/Makefile.am +@@ -1,9 +1,8 @@ + SUBDIRS = zpool-config zpool-layout zpios-test zpios-profile + +-EXTRA_DIST = dkms.mkconf dkms.postbuild kmodtool zfs2zol-patch.sed cstyle.pl + + pkgdatadir = $(datadir)/@PACKAGE@ +-dist_pkgdata_SCRIPTS = \ ++nodist_pkgdata_SCRIPTS = \ + $(top_builddir)/scripts/common.sh \ + $(top_srcdir)/scripts/zconfig.sh \ + $(top_srcdir)/scripts/zfault.sh \ diff --git a/debian/patches/0006-Tag-zfs-0.6.1.patch b/debian/patches/0006-Tag-zfs-0.6.1.patch index a62c97887..912e5ae7e 100644 --- a/debian/patches/0006-Tag-zfs-0.6.1.patch +++ b/debian/patches/0006-Tag-zfs-0.6.1.patch @@ -14,70 +14,14 @@ Signed-off-by: Brian Behlendorf rpm/generic/zfs.spec.in | 4 ++-- 5 files changed, 10 insertions(+), 11 deletions(-) -diff --git a/META b/META -index b380123..a65dc29 100644 --- a/META +++ b/META -@@ -1,8 +1,8 @@ - Meta: 1 +@@ -2,7 +2,7 @@ Name: zfs Branch: 1.0 --Version: 0.6.0 --Release: rc14 -+Version: 0.6.1 -+Release: 1 + Version: 0.6.3 +-Release: 1 ++Release: 20 Release-Tags: relext License: CDDL - Author: Sun Microsystems/Oracle, Lawrence Livermore National Laboratory -diff --git a/rpm/fedora/zfs-kmod.spec.in b/rpm/fedora/zfs-kmod.spec.in -index 323b99f..6a8e570 100644 ---- a/rpm/fedora/zfs-kmod.spec.in -+++ b/rpm/fedora/zfs-kmod.spec.in -@@ -114,5 +114,5 @@ chmod u+x ${RPM_BUILD_ROOT}%{kmodinstdir_prefix}/*/extra/*/*/* - rm -rf $RPM_BUILD_ROOT - - %changelog --* Tue Mar 12 2013 Brian Behlendorf - 0.6.0-1 --- Initial kmods2 packaging. -+* Fri Mar 22 2013 Brian Behlendorf - 0.6.1-1 -+- First official stable release. -diff --git a/rpm/generic/zfs-dkms.spec.in b/rpm/generic/zfs-dkms.spec.in -index 07a9f6d..7d871cb 100644 ---- a/rpm/generic/zfs-dkms.spec.in -+++ b/rpm/generic/zfs-dkms.spec.in -@@ -62,6 +62,5 @@ dkms remove -m %{module} -v %{version} --all --rpm_safe_upgrade - exit 0 - - %changelog --* Tue Mar 12 2013 Brian Behlendorf - 0.6.0-1 --- Initial dkms packaging. -- -+* Fri Mar 22 2013 Brian Behlendorf - 0.6.1-1 -+- First official stable release. -diff --git a/rpm/generic/zfs-kmod.spec.in b/rpm/generic/zfs-kmod.spec.in -index d99446b..6f478f3 100644 ---- a/rpm/generic/zfs-kmod.spec.in -+++ b/rpm/generic/zfs-kmod.spec.in -@@ -127,5 +127,5 @@ chmod u+x ${RPM_BUILD_ROOT}%{kmodinstdir_prefix}/*/extra/*/*/* - rm -rf $RPM_BUILD_ROOT - - %changelog --* Tue Mar 12 2013 Brian Behlendorf - 0.6.0-1 --- Initial kmods2 packaging. -+* Fri Mar 22 2013 Brian Behlendorf - 0.6.1-1 -+- First official stable release. -diff --git a/rpm/generic/zfs.spec.in b/rpm/generic/zfs.spec.in -index 5331265..7ee4ca0 100644 ---- a/rpm/generic/zfs.spec.in -+++ b/rpm/generic/zfs.spec.in -@@ -145,5 +145,5 @@ find %{?buildroot}%{_libdir} -name '*.la' -exec rm -f {} \; - %{_dracutdir}/modules.d/* - - %changelog --* Tue Mar 12 2013 Brian Behlendorf - 0.6.0-1 --- Refreshed RPM packaging. -+* Fri Mar 22 2013 Brian Behlendorf - 0.6.1-1 -+- First official stable release. --- -1.7.10.4 - + Author: OpenZFS on Linux diff --git a/debian/rules b/debian/rules index d2f1ab5a3..d7272746d 100755 --- a/debian/rules +++ b/debian/rules @@ -93,8 +93,8 @@ override_dh_shlibdeps: override_dh_strip: dh_strip -plibnvpair1 --dbg-package=libnvpair1-dbg dh_strip -plibuutil1 --dbg-package=libuutil1-dbg - dh_strip -plibzfs1 --dbg-package=libzfs1-dbg - dh_strip -plibzpool1 --dbg-package=libzpool1-dbg + dh_strip -plibzfs2 --dbg-package=libzfs2-dbg + dh_strip -plibzpool2 --dbg-package=libzpool2-dbg dh_strip -pzfsutils --dbg-package=zfsutils-dbg override_dh_auto_clean: