+ Find kernel source in $KSRC and kernel objects in $KOBJ.
+ linux-headers-_KVERS_ is a virtual package. Instead, depend on
linux-headers-_KVERS_-common AND linux-headers-_KVERS_-amd64.
* Improve upon initramfs-tools scripts.
+ Try three times to import the pool and only if the last one fails,
drop to a shell.
+ Print out the failed commands.
+ Support booting on crypted root by adding support to initramfs hook and script.
+ Only do crypto check(s) if 'zfs key -l' command is availible.
+ Don't add the list of crypto modules by default.
* Copy the zpool.cache file to the initrd.
* Update depends in zfs-initramfs.
Conflicts:
debian/control.in
debian/rules
+zfs-linux (0.6.1-1.tf.1) UNRELEASED; urgency=low
+
+ * Build udebs.
+ * Optionally build modules package.
+ * Improve upon initramfs-tools scripts.
+
+ -- Turbo Fredriksson <turbo@bayour.com> Mon, 06 May 2013 23:48:43 +0200
+
zfs-linux (0.6.1-1) UNRELEASED; urgency=low
[ Carlos Alberto Lopez Perez ]
+++ /dev/null
-Source: zfs-linux
-Section: kernel
-Priority: optional
-Maintainer: Debian ZFS on Linux maintainers <pkg-zfsonlinux-devel@lists.alioth.debian.org>
-Uploaders: Aron Xu <aron@debian.org>, Carlos Alberto Lopez Perez <clopez@igalia.com>
-Build-Depends: autotools-dev,
- autoconf,
- autogen,
- automake,
- debhelper (>= 9),
- dkms (>> 2.1.1.2-5),
- libselinux1-dev,
- libtool,
- po-debconf,
- uuid-dev,
- zlib1g-dev,
- lsb-release
-Standards-Version: 3.9.4
-Homepage: http://www.zfsonlinux.org/
-Vcs-Git: git://anonscm.debian.org/pkg-zfsonlinux/zfs.git
-Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-zfsonlinux/spl.git
-
-Package: libnvpair1
-Section: libs
-Architecture: linux-any
-Depends: ${misc:Depends}, ${shlibs:Depends}
-Replaces: libnvpair0
-Description: Solaris name-value library for Linux
- This library provides routines for packing and unpacking nv pairs for
- transporting data across process boundaries, transporting between
- kernel and userland, and possibly saving onto disk files.
-
-Package: libnvpair1-dbg
-Section: debug
-Priority: extra
-Architecture: linux-any
-Depends: ${misc:Depends}, libnvpair1 (= ${binary:Version})
-Replaces: libnvpair0-dbg
-Description: Debugging symbols for libnvpair1
- This library provides routines for packing and unpacking nv pairs for
- transporting data across process boundaries, transporting between
- kernel and userland, and possibly saving onto disk files.
- .
- This package contains the debugging symbols for libnvpair1.
-
-Package: libuutil1
-Section: libs
-Architecture: linux-any
-Depends: ${misc:Depends}, ${shlibs:Depends}
-Replaces: libuutil0
-Description: Solaris userland utility library for Linux
- This library provides a variety of glue functions for ZFS on Linux:
- * libspl: The Solaris Porting Layer userland library, which provides APIs
- that make it possible to run Solaris user code in a Linux environment
- with relatively minimal modification.
- * libavl: The Adelson-Velskii Landis balanced binary tree manipulation
- library.
- * libefi: The Extensible Firmware Interface library for GUID disk
- partitioning.
- * libshare: NFS, SMB, and iSCSI service integration for ZFS.
-
-Package: libuutil1-dbg
-Section: debug
-Priority: extra
-Architecture: linux-any
-Depends: ${misc:Depends}, libuutil1 (= ${binary:Version})
-Replaces: libuutil0-dbg
-Description: Debugging symbols for libuutil1
- This library provides a variety of glue functions for ZFS on Linux:
- * libspl: The Solaris Porting Layer userland library, which provides APIs
- that make it possible to run Solaris user code in a Linux environment
- with relatively minimal modification.
- * libavl: The Adelson-Velskii Landis balanced binary tree manipulation
- library.
- * libefi: The Extensible Firmware Interface library for GUID disk
- partitioning.
- * libshare: NFS, SMB, and iSCSI service integration for ZFS.
- .
- This package contains the debugging symbols for libuutil1.
-
-Package: libzfs-dev
-Section: libdevel
-Architecture: linux-any
-Depends: ${misc:Depends}, libzfs1 (= ${binary:Version})
-Provides: libnvpair-dev, libuutil-dev
-Description: Native ZFS filesystem development files for Linux
- Header files and static libraries for compiling software against
- libraries of native ZFS filesystem.
- .
- This package includes the development files of libnvpair1, libuutil1,
- and libzfs1.
-
-Package: libzfs1
-Section: libs
-Architecture: linux-any
-Depends: ${misc:Depends}, ${shlibs:Depends}
-Replaces: libzfs0
-Description: Native ZFS filesystem library for Linux
- The Z file system is a pooled filesystem designed for maximum data
- integrity, supporting data snapshots, multiple copies, and data
- checksums.
- .
- The ZFS library provides support for managing ZFS filesystems.
-
-Package: libzfs1-dbg
-Section: debug
-Priority: extra
-Architecture: linux-any
-Depends: ${misc:Depends}, libzfs1 (= ${binary:Version})
-Replaces: libzfs0-dbg
-Description: Debugging symbols for libzfs1
- The Z file system is a pooled filesystem designed for maximum data
- integrity, supporting data snapshots, multiple copies, and data
- checksums.
- .
- This package contains the debugging symbols for libzfs1.
-
-Package: libzpool1
-Section: libs
-Architecture: linux-any
-Depends: ${misc:Depends}, ${shlibs:Depends}
-Replaces: libzpool0
-Description: Native ZFS pool library for Linux
- The Z file system is a pooled filesystem designed for maximum data
- integrity, supporting data snapshots, multiple copies, and data
- checksums.
- .
- This zpool library provides support for managing zpools.
-
-Package: libzpool1-dbg
-Section: debug
-Priority: extra
-Architecture: linux-any
-Depends: ${misc:Depends}, libzpool1 (= ${binary:Version})
-Replaces: libzpool0-dbg
-Description: Debugging symbols for libzpool1
- The Z file system is a pooled filesystem designed for maximum data
- integrity, supporting data snapshots, multiple copies, and data
- checksums.
- .
- This package contains the debugging symbols for libzpool1.
-
-Package: zfs-dkms
-Architecture: all
-Pre-Depends: spl-dkms (>= ${source:Upstream-Version})
-Depends: ${misc:Depends}, dkms (>> 2.1.1.2-5), lsb-release
-Replaces: lzfs, lzfs-dkms
-Provides: lustre-backend-fs, lzfs, lzfs-dkms
-Conflicts: lzfs, lzfs-dkms
-Description: Native ZFS filesystem kernel modules for Linux
- The Z file system is a pooled filesystem designed for maximum data
- integrity, supporting data snapshots, multiple copies, and data
- checksums.
- .
- This DKMS package includes the SPA, DMU, ZVOL, and ZPL components of ZFS.
-
-#Package: zfs-dracut
-#Section: kernel
-#Architecture: linux-any
-#Depends: ${misc:Depends}, dracut, zfsutils
-#Description: Native ZFS root filesystem capabilities for Linux
-# This package adds ZFS to the system initramfs with a hook
-# for the dracut infrastructure.
-
-#Package: zfs-initramfs
-#Section: kernel
-#Architecture: linux-any
-#Depends: ${misc:Depends}, zfsutils, zfs-grub
-#Description: Native ZFS root filesystem capabilities for Linux
-# This package adds ZFS to the system initramfs with a hook
-# for the initramfs-tools infrastructure.
-
-Package: zfsutils
-Section: admin
-Architecture: linux-any
-Depends: ${misc:Depends}, ${shlibs:Depends}
-Recommends: zfs-dkms
-Suggests: samba-common-bin (>= 3.0.23), nfs-kernel-server, zfs-initramfs
-Conflicts: zfs, zfs-fuse
-Replaces: zfs
-Description: command-line tools to manage ZFS filesystems
- The Z file system is a pooled filesystem designed for maximum data
- integrity, supporting data snapshots, multiple copies, and data checksums.
- .
- This package provides the zfs and zpool commands to create and administer
- ZFS filesystems.
-
-Package: zfsutils-dbg
-Section: debug
-Priority: extra
-Architecture: linux-any
-Depends: ${misc:Depends}, zfsutils (= ${binary:Version})
-Replaces: zfs-dbg
-Description: Debugging symbols for zfsutils
- The Z file system is a pooled filesystem designed for maximum data
- integrity, supporting data snapshots, multiple copies, and data checksums.
- .
- This package contains the debugging symbols for zfsutils.
--- /dev/null
+Source: zfs-linux
+Section: kernel
+Priority: optional
+Maintainer: Debian ZFS on Linux maintainers <pkg-zfsonlinux-devel@lists.alioth.debian.org>
+Uploaders: Aron Xu <aron@debian.org>, Carlos Alberto Lopez Perez <clopez@igalia.com>
+Build-Depends: autotools-dev,
+ autoconf,
+ autogen,
+ automake,
+ debhelper (>= 9),
+ dkms (>> 2.1.1.2-5),
+ libselinux1-dev,
+ libtool,
+ po-debconf,
+ uuid-dev,
+ zlib1g-dev,
+ lsb-release
+Standards-Version: 3.9.4
+Homepage: http://www.zfsonlinux.org/
+Vcs-Git: git://anonscm.debian.org/pkg-zfsonlinux/zfs.git
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-zfsonlinux/spl.git
+
+Package: libnvpair1
+Section: libs
+Architecture: linux-any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Replaces: libnvpair0
+Provides: libnvpair0
+Description: Solaris name-value library for Linux
+ This library provides routines for packing and unpacking nv pairs for
+ transporting data across process boundaries, transporting between
+ kernel and userland, and possibly saving onto disk files.
+
+Package: libnvpair1-dbg
+Section: debug
+Priority: extra
+Architecture: linux-any
+Depends: ${misc:Depends}, libnvpair1 (= ${binary:Version})
+Replaces: libnvpair0-dbg, libnvpair0
+Provides: libnvpair0-dbg, libnvpair0
+Description: Debugging symbols for libnvpair1
+ This library provides routines for packing and unpacking nv pairs for
+ transporting data across process boundaries, transporting between
+ kernel and userland, and possibly saving onto disk files.
+ .
+ This package contains the debugging symbols for libnvpair1.
+
+Package: libnvpair1-udeb
+Package-Type: udeb
+Section: debian-installer
+Architecture: linux-any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: OpenSolaris name-value pair library (debian-installer version)
+ This package contains the OpenSolaris libnvpair library, for managing
+ name-value pairs.
+ .
+ This is a minimal package for use in debian-installer.
+
+Package: libuutil1
+Section: libs
+Architecture: linux-any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Replaces: libuutil0
+Provides: libuutil0
+Description: Solaris userland utility library for Linux
+ This library provides a variety of glue functions for ZFS on Linux:
+ * libspl: The Solaris Porting Layer userland library, which provides APIs
+ that make it possible to run Solaris user code in a Linux environment
+ with relatively minimal modification.
+ * libavl: The Adelson-Velskii Landis balanced binary tree manipulation
+ library.
+ * libefi: The Extensible Firmware Interface library for GUID disk
+ partitioning.
+ * libshare: NFS, SMB, and iSCSI service integration for ZFS.
+
+Package: libuutil1-dbg
+Section: debug
+Priority: extra
+Architecture: linux-any
+Depends: ${misc:Depends}, libuutil1 (= ${binary:Version})
+Replaces: libuutil0-dbg, libuutil0
+Provides: libuutil0-dbg, libuutil0
+Description: Debugging symbols for libuutil1
+ This library provides a variety of glue functions for ZFS on Linux:
+ * libspl: The Solaris Porting Layer userland library, which provides APIs
+ that make it possible to run Solaris user code in a Linux environment
+ with relatively minimal modification.
+ * libavl: The Adelson-Velskii Landis balanced binary tree manipulation
+ library.
+ * libefi: The Extensible Firmware Interface library for GUID disk
+ partitioning.
+ * libshare: NFS, SMB, and iSCSI service integration for ZFS.
+ .
+ This package contains the debugging symbols for libuutil1.
+
+Package: libuutil1-udeb
+Package-Type: udeb
+Section: debian-installer
+Architecture: linux-any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: OpenSolaris userland utility library (debian-installer version)
+ This package contains the OpenSolaris userland utility library.
+ .
+ This is a minimal package for use in debian-installer.
+
+Package: libzfs-dev
+Section: libdevel
+Architecture: linux-any
+Depends: ${misc:Depends}, libzfs1 (= ${binary:Version})
+Provides: libnvpair-dev, libuutil-dev
+Description: Native ZFS filesystem development files for Linux
+ Header files and static libraries for compiling software against
+ libraries of native ZFS filesystem.
+ .
+ This package includes the development files of libnvpair1, libuutil1,
+ and libzfs1.
+
+Package: libzfs1
+Section: libs
+Architecture: linux-any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Replaces: libzfs0
+Provides: libzfs0
+Description: Native ZFS filesystem library for Linux
+ The Z file system is a pooled filesystem designed for maximum data
+ integrity, supporting data snapshots, multiple copies, and data
+ checksums.
+ .
+ The ZFS library provides support for managing ZFS filesystems.
+
+Package: libzfs1-dbg
+Section: debug
+Priority: extra
+Architecture: linux-any
+Depends: ${misc:Depends}, libzfs1 (= ${binary:Version})
+Replaces: libzfs0-dbg, libzfs0
+Provides: libzfs0-dbg, libzfs0
+Description: Debugging symbols for libzfs1
+ The Z file system is a pooled filesystem designed for maximum data
+ integrity, supporting data snapshots, multiple copies, and data
+ checksums.
+ .
+ This package contains the debugging symbols for libzfs1.
+
+Package: libzfs1-udeb
+Package-Type: udeb
+Section: debian-installer
+Architecture: linux-any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: OpenSolaris ZFS library (debian-installer version)
+ The Z file system is a pooled filesystem designed for maximum data integrity,
+ supporting data snapshots, multiple copies, and data checksums.
+ .
+ The ZFS library provides support for managing ZFS filesystems.
+ .
+ This is a minimal package for use in debian-installer.
+
+Package: libzpool1
+Section: libs
+Architecture: linux-any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Replaces: libzpool0
+Provides: libzpool0
+Description: Native ZFS pool library for Linux
+ The Z file system is a pooled filesystem designed for maximum data
+ integrity, supporting data snapshots, multiple copies, and data
+ checksums.
+ .
+ This zpool library provides support for managing zpools.
+
+Package: libzpool1-dbg
+Section: debug
+Priority: extra
+Architecture: linux-any
+Depends: ${misc:Depends}, libzpool1 (= ${binary:Version})
+Replaces: libzpool0-dbg, libzpool0
+Provides: libzpool0-dbg, libzpool0
+Description: Debugging symbols for libzpool1
+ The Z file system is a pooled filesystem designed for maximum data
+ integrity, supporting data snapshots, multiple copies, and data
+ checksums.
+ .
+ This package contains the debugging symbols for libzpool1.
+
+Package: libzpool1-udeb
+Package-Type: udeb
+Section: debian-installer
+Architecture: linux-any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: OpenSolaris interface library to manage ZFS storage pools (debian-installer version)
+ This package contains the OpenSolaris libzpool library.
+ .
+ This is a minimal package for use in debian-installer.
+
+Package: zfs-dkms
+Architecture: all
+Pre-Depends: spl-dkms (>= ${source:Upstream-Version})
+Depends: ${misc:Depends}, dkms (>> 2.1.1.2-5), lsb-release
+Replaces: lzfs, lzfs-dkms
+Provides: lustre-backend-fs, lzfs, lzfs-dkms
+Conflicts: lzfs, lzfs-dkms
+Description: Native ZFS filesystem kernel modules for Linux
+ The Z file system is a pooled filesystem designed for maximum data
+ integrity, supporting data snapshots, multiple copies, and data
+ checksums.
+ .
+ This DKMS package includes the SPA, DMU, ZVOL, and ZPL components of ZFS.
+
+#Package: zfs-dracut
+#Section: kernel
+#Architecture: linux-any
+#Depends: ${misc:Depends}, dracut, zfsutils
+#Description: Native ZFS root filesystem capabilities for Linux
+# This package adds ZFS to the system initramfs with a hook
+# for the dracut infrastructure.
+
+#Package: zfs-initramfs
+#Section: kernel
+#Architecture: linux-any
+#Depends: ${misc:Depends}, zfsutils, zfs-grub
+#Description: Native ZFS root filesystem capabilities for Linux
+# This package adds ZFS to the system initramfs with a hook
+# for the initramfs-tools infrastructure.
+
+Package: zfsutils
+Section: admin
+Architecture: linux-any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Recommends: zfs-dkms
+Suggests: samba-common-bin (>= 3.0.23), nfs-kernel-server, zfs-initramfs
+Conflicts: zfs, zfs-fuse
+Replaces: zfs
+Description: command-line tools to manage ZFS filesystems
+ The Z file system is a pooled filesystem designed for maximum data
+ integrity, supporting data snapshots, multiple copies, and data checksums.
+ .
+ This package provides the zfs and zpool commands to create and administer
+ ZFS filesystems.
+
+Package: zfsutils-dbg
+Section: debug
+Priority: extra
+Architecture: linux-any
+Depends: ${misc:Depends}, zfsutils (= ${binary:Version})
+Replaces: zfs-dbg, zfs
+Provides: zfs-dbg, zfs
+Description: Debugging symbols for zfsutils
+ The Z file system is a pooled filesystem designed for maximum data
+ integrity, supporting data snapshots, multiple copies, and data checksums.
+ .
+ This package contains the debugging symbols for zfsutils.
+
+Package: zfsutils-udeb
+Package-Type: udeb
+Section: debian-installer
+Architecture: linux-any
+Depends: ${shlibs:Depends}, ${misc:Depends},
+ libuutil1-udeb (= ${binary:Version}), libnvpair1-udeb (= ${binary:Version}),
+ libzfs1-udeb (= ${binary:Version}), libzpool1-udeb (= ${binary:Version}),
+ zfs-modules,
+Description: command-line tools to manage ZFS filesystems (debian-installer version)
+ The Z file system is a pooled filesystem designed for maximum data integrity,
+ supporting data snapshots, multiple copies, and data checksums.
+ .
+ This package provides the zfs and zpool commands to create and administer
+ ZFS filesystems.
+ .
+ This is a minimal package for use in debian-installer.
--- /dev/null
+Source: zfs-linux
+Section: kernel
+Priority: extra
+Maintainer: Debian ZFS on Linux maintainers <pkg-zfsonlinux-devel@lists.alioth.debian.org>
+Build-Depends: autotools-dev,
+ autoconf,
+ autogen,
+ automake,
+ debhelper (>= 7.4),
+ dkms (>> 2.1.1.2-5),
+ libtool,
+ linux-headers-_KVERS_-common,
+ linux-headers-_KVERS_-amd64
+Standards-Version: 3.8.4
+Homepage: http://www.zfsonlinux.org/
+Vcs-Git: git://anonscm.debian.org/pkg-zfsonlinux/zfs.git
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-zfsonlinux/spl.git
+
+Package: zfs-modules-_KVERS_
+Architecture: amd64
+Provides: zfs-modules
+Description: Native ZFS filesystem kernel modules for Linux (kernel _KVERS_)
+ An advanced integrated volume manager and filesystem that is designed for
+ performance and data integrity. Snapshots, clones, checksums, deduplication,
+ compression, and RAID redundancy are built-in features.
+ .
+ This package contains the compiled kernel module for _KVERS_
+ .
+ Includes the SPA, DMU, ZVOL, and ZPL components of ZFS.
+ .
+ If you have compiled your own kernel, you will most likely need to build
+ your own zfs-modules. The zfs-source package has been
+ provided for use with the Debian kernel-package utility to produce a
+ version of zfs-module for your kernel.
+
+Package: zfs-modules-_KVERS_-amd64-di
+Package-Type: udeb
+Section: debian-installer
+Architecture: amd64
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Provides: zfs-modules, zfs-modules-_KVERS_-udeb
+Description: Native ZFS filesystem kernel modules for Linux (debian-installar version for kernel _KVERS_)
+ An advanced integrated volume manager and filesystem that is designed for
+ performance and data integrity. Snapshots, clones, checksums, deduplication,
+ compression, and RAID redundancy are built-in features.
+ .
+ This package contains the compiled kernel module for _KVERS_
+ .
+ This is a minimal package for use in debian-installer.
--- /dev/null
+lib/libnvpair/.libs/libnvpair.so.*[0-9] lib
--- /dev/null
+lib/libuutil/.libs/libuutil.so.*[0-9] lib
--- /dev/null
+lib/libzfs/.libs/libzfs.so.*[0-9] lib
--- /dev/null
+lib/libzpool/.libs/libzpool.so.*[0-9] lib
DKMSFILES := module include config zfs.release.in autogen.sh META AUTHORS \
DISCLAIMER COPYRIGHT OPENSOLARIS.LICENSE README.markdown
+export SHLIB_MAJOR = 1
+
+non_epoch_version=$(shell echo $(KVERS) | perl -pe 's/^\d+://')
+PACKAGE=zfs
+pmodules = $(PACKAGE)-modules-$(non_epoch_version)
+
%:
dh $@ --with dkms
override_dh_auto_configure:
+ @cp debian/control.in debian/control
+
@# Embed the downstream version in the module.
@sed -e 's/^Version:.*/Version: $(VERSION)/' -i.orig META
override_dh_dkms:
dh_dkms -V $(VERSION)
+override_dh_makeshlibs:
+ dh_makeshlibs -a
+ dh_makeshlibs -plibnvpair$(SHLIB_MAJOR) --add-udeb=libnvpair$(SHLIB_MAJOR)-udeb
+ dh_makeshlibs -plibuutil$(SHLIB_MAJOR) --add-udeb=libuutil$(SHLIB_MAJOR)-udeb
+ dh_makeshlibs -plibzfs$(SHLIB_MAJOR) --add-udeb=libzfs$(SHLIB_MAJOR)-udeb
+ dh_makeshlibs -plibzpool$(SHLIB_MAJOR) --add-udeb=libzpool$(SHLIB_MAJOR)-udeb
+ dh_makeshlibs -pzfsutils --add-udeb=zfsutils-udeb
+
override_dh_shlibdeps:
@# Suppress libtool dependency_libs warnings that are caused by
@# inter-library dependencies. (eg: zfs -> libzfs -> libuuid)
dh_strip -plibzpool1 --dbg-package=libzpool1-dbg
dh_strip -pzfsutils --dbg-package=zfsutils-dbg
+ dh_strip -plibnvpair$(SHLIB_MAJOR)-udeb
+ dh_strip -plibuutil$(SHLIB_MAJOR)-udeb
+ dh_strip -plibzfs$(SHLIB_MAJOR)-udeb
+ dh_strip -plibzpool$(SHLIB_MAJOR)-udeb
+ dh_strip -pzfsutils-udeb
+
override_dh_auto_clean:
dh_auto_clean
@if test -e META.orig; then mv META.orig META; fi
override_dh_install:
find . -name lib*.la -delete
dh_install
+
+# ------------
+
+override_dh_prep-deb-files:
+ for templ in $(wildcard $(CURDIR)/debian/*_KVERS_*.in); do \
+ sed -e 's/##KVERS##/$(KVERS)/g ; s/#KVERS#/$(KVERS)/g ; s/_KVERS_/$(KVERS)/g ; s/##KDREV##/$(KDREV)/g ; s/#KDREV#/$(KDREV)/g ; s/_KDREV_/$(KDREV)/g ' \
+ < $$templ > `echo $$templ | sed -e 's/_KVERS_/$(KVERS)/g' -e 's/\.in$$//'` ; \
+ done
+ sed -e 's/##KVERS##/$(KVERS)/g ; s/#KVERS#/$(KVERS)/g ; s/_KVERS_/$(KVERS)/g ; s/##KDREV##/$(KDREV)/g ; s/#KDREV#/$(KDREV)/g ; s/_KDREV_/$(KDREV)/g ' \
+ < debian/control.modules.in > debian/control
+
+override_dh_configure_modules: override_dh_configure_modules_stamp
+override_dh_configure_modules_stamp:
+ ./configure --with-config=kernel --with-linux=$(KSRC) \
+ --with-linux-obj=$(KOBJ)
+ touch override_dh_configure_modules_stamp
+
+override_dh_binary-modules-udeb: override_dh_prep-deb-files override_dh_configure_modules
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+
+ $(MAKE) -C $(CURDIR)/module modules
+
+ dh_installdirs -p${pmodules}-amd64-di
+ dh_install -p${pmodules}-amd64-di
+ dh_gencontrol -p${pmodules}-amd64-di
+
+ dh_builddeb -p${pmodules}-amd64-di --destdir=$(DEB_DESTDIR)
+
+override_dh_binary-modules: override_dh_prep-deb-files override_dh_configure_modules
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+
+ $(MAKE) -C $(CURDIR)/module modules
+
+ dh_install -p${pmodules}
+ dh_installdocs -p${pmodules}
+ dh_installchangelogs -p${pmodules}
+ dh_compress -p${pmodules}
+ dh_strip -p${pmodules}
+ dh_fixperms -p${pmodules}
+ dh_installdeb -p${pmodules}
+ dh_gencontrol -p${pmodules} -- -v$(VERSION)
+ dh_md5sums -p${pmodules}
+
+ dh_builddeb -p${pmodules} --destdir=$(DEB_DESTDIR)
# Explicitly specify all kernel modules because automatic dependency resolution
# is unreliable on many systems.
-MANUAL_ADD_MODULES_LIST="zlib_deflate spl zavl zcommon znvpair zunicode zfs"
+BASE_MODULES="zlib_deflate spl zavl zcommon znvpair zunicode zfs"
+CRPT_MODULES="ghash-generic sun-ccm sun-gcm sun-ctr"
+MANUAL_ADD_MODULES_LIST="$BASE_MODULES"
# Generic result code.
RC=0
# The spl-dkms package ensures that the /etc/hostid file exists.
# NB: Commentary in the spl-dkms.postinst script.
-cp -p "/etc/hostid" "$DESTDIR/etc/hostid"
+[ -f "/etc/hostid" ] && cp -p "/etc/hostid" "$DESTDIR/etc/hostid"
+
+# Install the zpool.cache file.
+[ ! -d "$DESTDIR/boot/zfs" ] && mkdir -p "$DESTDIR/boot/zfs"
+cp -r /boot/zfs "$DESTDIR/boot"
# Use "rpool" as the default, like on most Solaris systems.
[ -z "$ZFS_RPOOL" ] && ZFS_RPOOL='rpool'
- # @FIXME: Forcing the import should not be necessary.
- #
- # Consider inhibiting automatic zpool imports in the initramfs
- # environment and doing a full import in the regular system instead.
+ if [ -f /etc/zfs/zpool.cache ]; then
+ ZPOOL_CACHE=/etc/zfs/zpool.cache
+ elif [ -f /boot/zfs/zpool.cache ]; then
+ ZPOOL_CACHE=/boot/zfs/zpool.cache
+ fi
+
+ # zpool import refuse to import without a valid mtab
+ [ ! -f /proc/mounts ] && mount proc /proc
+ [ ! -f /etc/mtab ] && cat /proc/mounts > /etc/mtab
+
+ # Just make sure it's not already imported. Should be impossible, but...
+ zpool list "$ZFS_RPOOL" 1>/dev/null 2>&1
+ ZFS_ERROR=$?
[ "$quiet" != "y" ] && log_begin_msg "Importing ZFS root pool $ZFS_RPOOL"
- if [ -f /etc/zfs/zpool.cache ]
+ # Attempt 1: Try the correct/proper way.
+ if [ "$ZFS_ERROR" -ne 0 -a -n "$ZPOOL_CACHE" ]
then
- ZFS_STDERR=$(zpool list "$ZFS_RPOOL" 1>/dev/null 2>&1 \
- || zpool import -f -N "$ZFS_RPOOL" 2>&1)
+ ZFS_CMD="zpool import -c $ZPOOL_CACHE -N $ZFS_RPOOL"
+
+ ZFS_STDERR=$($ZFS_CMD 2>&1)
ZFS_ERROR=$?
- else
- ZFS_STDERR=$(zpool import -f -N "$ZFS_RPOOL" 2>&1)
+
+ [ "$ZFS_ERROR" -ne 0 ] && echo "FAIL: $ZFS_CMD. Retrying..."
+ fi
+
+ # Attempt 2: Try forcing the import, using /dev/disk/by-id if it exists.
+ [ -d /dev/disk/by-id ] && DISK_BY_ID="-d /dev/disk/by-id"
+ if [ "$ZFS_ERROR" -ne 0 -o -z "$ZPOOL_CACHE" ]
+ then
+ ZFS_CMD="zpool import -f -N $DISK_BY_ID $ZFS_RPOOL"
+
+ ZFS_STDERR=$($ZFS_CMD 2>&1)
ZFS_ERROR=$?
+
+ [ "$ZFS_ERROR" -ne 0 ] && echo "FAIL: $ZFS_CMD. Retrying..."
+ fi
+
+ # Attempt 3: Last ditch attempt. If DISK_BY_ID is set, we've already tried...
+ if [ "$ZFS_ERROR" -ne 0 -a -z "$DISK_BY_ID" ]
+ then
+ ZFS_CMD="zpool import -f -N $ZFS_RPOOL"
+
+ ZFS_STDERR=$($ZFS_CMD 2>&1)
+ ZFS_ERROR=$?
+
+ [ "$ZFS_ERROR" -ne 0 ] && echo "FAIL: $ZFS_CMD. Retrying..."
fi
[ "$quiet" != "y" ] && log_end_msg
if [ "$ZFS_ERROR" -ne 0 ]
then
disable_plymouth
- echo "Command: zpool import -f -N $ZFS_RPOOL"
+ echo "Command: $ZFS_CMD"
echo "Message: $ZFS_STDERR"
echo "Error: $ZFS_ERROR"
echo ""
ZFS_STDERR=$(zfs set mountpoint=/ "$ZFS_BOOTFS" 2>&1)
[ "$quiet" != "y" ] && log_end_msg
+ if zfs 2>&1 | grep -q 'key -l '
+ then
+ # 'zfs key' is availible (hence we have crypto), check if filesystem is encrypted.
+ set -- `zfs get encryption $ZFS_BOOTFS | grep ^$ZFS_RPOOL`
+ crypt_type=$3
+ if [ "$crypt_type" != "off" ]
+ then
+ [ "$quiet" != "y" ] && log_begin_msg "Loading crypto wrapper key for $ZFS_BOOTFS"
+
+ # Just make sure that ALL crypto modules module is loaded.
+ # Simplest just to load all...
+ for mod in sun-ccm sun-gcm sun-ctr ghash-generic
+ do
+ modprobe $mod
+ done
+
+ # If the key isn't availible, then this will fail!
+ ZFS_CMD="zfs key -l -a"
+ ZFS_STDERR=$($ZFS_CMD 2>&1)
+ ZFS_ERROR=$?
+
+ if [ "$ZFS_ERROR" -ne 0 ]
+ then
+ disable_plymouth
+ echo "FAIL: $ZFS_CMD"
+ echo "Message: $ZFS_STDERR"
+ echo "Error: $ZFS_ERROR"
+ echo ""
+ echo "Failed to load zfs encryption wrapper key (s)."
+ echo "Please verify dataset property 'keysource' for datasets"
+ echo "and rerun: $ZFS_CMD"
+ /bin/sh
+
+ ZFS_ERROR=0
+ else
+ [ "$quiet" != "y" ] && log_end_msg
+ fi
+ fi
+ fi
+
# Ideally, the root filesystem would be mounted like this:
#
# zpool import -R "$rootmnt" -N "$ZFS_RPOOL"
--- /dev/null
+lib/modules/_KVERS_/extra/zcommon
+lib/modules/_KVERS_/extra/zfs
+lib/modules/_KVERS_/extra/avl
+lib/modules/_KVERS_/extra/unicode
+lib/modules/_KVERS_/extra/zpios
+lib/modules/_KVERS_/extra/nvpari
--- /dev/null
+module/zcommon/zcommon.ko lib/modules/_KVERS_/extra/zcommon/
+module/zfs/zfs.ko lib/modules/_KVERS_/extra/zfs/
+module/avl/zavl.ko lib/modules/_KVERS_/extra/avl/
+module/unicode/zunicode.ko lib/modules/_KVERS_/extra/unicode/
+module/zpios/zpios.ko lib/modules/_KVERS_/extra/zpios/
+module/nvpair/znvpair.ko lib/modules/_KVERS_/extra/nvpari/
--- /dev/null
+lib/modules/_KVERS_/extra/zcommon
+lib/modules/_KVERS_/extra/zfs
+lib/modules/_KVERS_/extra/avl
+lib/modules/_KVERS_/extra/unicode
+lib/modules/_KVERS_/extra/zpios
+lib/modules/_KVERS_/extra/nvpari
--- /dev/null
+module/zcommon/zcommon.ko lib/modules/_KVERS_/extra/zcommon/
+module/zfs/zfs.ko lib/modules/_KVERS_/extra/zfs/
+module/avl/zavl.ko lib/modules/_KVERS_/extra/avl/
+module/unicode/zunicode.ko lib/modules/_KVERS_/extra/unicode/
+module/zpios/zpios.ko lib/modules/_KVERS_/extra/zpios/
+module/nvpair/znvpair.ko lib/modules/_KVERS_/extra/nvpari/
--- /dev/null
+../tmp/sbin/* /sbin
--- /dev/null
+#!/bin/sh
+
+# Require ZFS v28 in kernel
+exit 0