diff --git a/Makefile b/Makefile index 3cb31e6..6bae9b0 100644 --- a/Makefile +++ b/Makefile @@ -113,6 +113,13 @@ zfs_kmod_3.10.0 ${ZFS_3.10.0_DEBS}: ${ZFSSRC} .PHONY: download download: + git clone https://github.com/zfsonlinux/pkg-spl.git + #git clone https://github.com/zfsonlinux/pkg-zfs.git + #cd pkg-zfs; git checkout upstream + #cd pkg-zfs; git checkout master/ubuntu/precise + #git checkout master/debian/wheezy + #git merge upstream + dsaf rm spl-*.tar.gz rm zfs-*.tar.gz wget https://github.com/zfsonlinux/spl/archive/${SPLSRC} diff --git a/README b/README new file mode 100644 index 0000000..0b057f2 --- /dev/null +++ b/README @@ -0,0 +1,9 @@ +Proxmox VE packaging for ZFS on Linux + +This is based of code from: + +https://github.com/zfsonlinux/pkg-spl.git +https://github.com/zfsonlinux/pkg-zfs.git + +We merged updates from the precice branch into the older wheezy +branch. diff --git a/spl-debian-pve/changelog b/spl-debian-pve/changelog new file mode 100644 index 0000000..69505d3 --- /dev/null +++ b/spl-debian-pve/changelog @@ -0,0 +1,6 @@ +spl-linux (0.6.3-1~wheezy) unstable; urgency=low + + * first version for Proxmox VE + + -- Proxmox Support Team Sat, 10 Jan 2015 14:06:34 +0100 + diff --git a/spl-debian-pve/compat b/spl-debian-pve/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/spl-debian-pve/compat @@ -0,0 +1 @@ +7 diff --git a/spl-debian-pve/control b/spl-debian-pve/control new file mode 100644 index 0000000..eabb56a --- /dev/null +++ b/spl-debian-pve/control @@ -0,0 +1,35 @@ +Source: spl-linux +Section: kernel +Priority: extra +Maintainer: Proxmox Support Team +Build-Depends: autotools-dev, + autoconf, + autogen, + automake, + debhelper (>= 8), + dh-autoreconf, + dkms (>= 2.2.0.2), + libtool, +Standards-Version: 3.9.5 +Homepage: http://www.zfsonlinux.org/ + +Package: spl-dkms +Architecture: all +Depends: ${misc:Depends}, dkms (>= 2.2.0.2), file, lsb-release +Recommends: spl +Description: Solaris Porting Layer kernel modules for Linux + The Solaris Porting Layer (SPL) is a Linux kernel module which provides many of + the Solaris kernel APIs. This shim layer makes it possible to run Solaris + kernel code in the Linux kernel with relatively minimal modification. + . + The Solaris Porting LAyer Tests (SPLAT) is a Linux kernel module which provides + a testing harness for the SPL module. + +Package: spl +Architecture: any +Conflicts: spl-dev +Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: spl-dkms +Description: Solaris Porting Layer utilities for Linux + This package provides the userspace utilities for the SPL and SPLAT Linux + kernel modules. diff --git a/spl-debian-pve/copyright b/spl-debian-pve/copyright new file mode 100644 index 0000000..5f1e428 --- /dev/null +++ b/spl-debian-pve/copyright @@ -0,0 +1,147 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: Solaris Porting Layer for Linux +Upstream-Contact: Brian Behlendorf +Source: https://github.com/zfsonlinux/zfs/ +Disclaimer: + This work was produced at the Lawrence Livermore National Laboratory + (LLNL) under Contract No. DE-AC52-07NA27344 (Contract 44) between + the U.S. Department of Energy (DOE) and Lawrence Livermore National + Security, LLC (LLNS) for the operation of LLNL. + . + This work was prepared as an account of work sponsored by an agency of + the United States Government. Neither the United States Government nor + Lawrence Livermore National Security, LLC nor any of their employees, + makes any warranty, express or implied, or assumes any liability or + responsibility for the accuracy, completeness, or usefulness of any + information, apparatus, product, or process disclosed, or represents + that its use would not infringe privately-owned rights. + . + Reference herein to any specific commercial products, process, or + services by trade name, trademark, manufacturer or otherwise does + not necessarily constitute or imply its endorsement, recommendation, + or favoring by the United States Government or Lawrence Livermore + National Security, LLC. The views and opinions of authors expressed + herein do not necessarily state or reflect those of the Untied States + Government or Lawrence Livermore National Security, LLC, and shall + not be used for advertising or product endorsement purposes. + +Files: * +Copyright: Lawrence Livermore National Security, LLC. + The Regents of the University of California +License: GPL-2+ + +Files: config/config.guess +Copyright: Free Software Foundation, Inc. +License: GPL-2+ + +Files: config/config.sub +Copyright: Free Software Foundation, Inc. +License: GPL-2+ + +Files: config/deb.am +Copyright: Lawrence Livermore National Security, LLC. +License: GPL-2+ + +Files: config/depcomp +Copyright: Free Software Foundation, Inc. +License: GPL-2+ + +Files: config/install-sh +Copyright: 1994 X Consortium +License: + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- + TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + . + Except as contained in this notice, the name of the X Consortium shall not + be used in advertising or otherwise to promote the sale, use or other deal- + ings in this Software without prior written authorization from the X Consor- + tium. + +Files: config/ltmain.sh +Copyright: Free Software Foundation, Inc. +License: GPL-2+ + +Files: config/missing +Copyright: Free Software Foundation, Inc. +License: GPL-2+ + +Files: config/tgz.am +Copyright: Lawrence Livermore National Security, LLC. +License: GPL-2+ + +Files: debian/* +Copyright: Darik Horn +Source: https://github.com/dajhorn/pkg-spl/ +License: GPL-2+ + +Files: include/linux/zlib_compat.h +Copyright: Lawrence Livermore National Security, LLC. +License: GPL-2+ + +Files: include/rpc/xdr.h +Copyright: Sun Microsystems, Inc. +License: GPL-2+ + +Files: include/sys/extdirent.h +Copyright: Lawrence Livermore National Security, LLC. +License: GPL-2+ + +Files: include/sys/fcntl.h +Copyright: Lawrence Livermore National Security, LLC. +License: GPL-2+ + +Files: include/sys/idmap.h +Copyright: Lawrence Livermore National Security, LLC. +License: GPL-2+ + +Files: include/sys/tsd.h +Copyright: Lawrence Livermore National Security, LLC. +License: GPL-2+ + +Files: include/sys/zmod.h +Copyright: Jean-loup Gailly + Mark Adler +License: + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + . + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + . + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + . + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + . + 3. This notice may not be removed or altered from any source distribution. + +Files: module/spl/spl-tsd.c +Copyright: Lawrence Livermore National Security, LLC. +License: GPL-2+ + +Files: module/spl/spl-xdr.c +Copyright: Sun Microsystems, Inc. +License: GPL-2+ + +Files: module/splat/splat-linux.c +Copyright: Lawrence Livermore National Security, LLC. +License: GPL-2+ diff --git a/spl-debian-pve/dkms b/spl-debian-pve/dkms new file mode 100644 index 0000000..b349ded --- /dev/null +++ b/spl-debian-pve/dkms @@ -0,0 +1,35 @@ +AUTOINSTALL="yes" +PACKAGE_NAME="spl" +PACKAGE_VERSION="#MODULE_VERSION#" +PRE_BUILD="configure + --prefix=/usr + --with-config=kernel + --with-linux=$(case `lsb_release -is` in + (Debian) + if [ -e ${kernel_source_dir/%build/source} ] + then + echo ${kernel_source_dir/%build/source} + else + # This is a kpkg exception for Proxmox 2.0 + echo ${kernel_source_dir} + fi + ;; + (*) + echo ${kernel_source_dir} + ;; + esac) + --with-linux-obj=${kernel_source_dir} +" +POST_INSTALL="cp + ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/spl_config.h + ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/module/Module.symvers + ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/${kernelver}/${arch}/ +" +REMAKE_INITRD="no" +MAKE[0]="make" +BUILT_MODULE_NAME[0]="spl" +BUILT_MODULE_LOCATION[0]="module/spl/" +DEST_MODULE_LOCATION[0]="/extra/spl/spl" +BUILT_MODULE_NAME[1]="splat" +BUILT_MODULE_LOCATION[1]="module/splat/" +DEST_MODULE_LOCATION[1]="/extra/splat/splat" diff --git a/spl-debian-pve/patches/0001-Revert-Remove-etc-hostid-missing-warning.patch b/spl-debian-pve/patches/0001-Revert-Remove-etc-hostid-missing-warning.patch new file mode 100644 index 0000000..40bf56e --- /dev/null +++ b/spl-debian-pve/patches/0001-Revert-Remove-etc-hostid-missing-warning.patch @@ -0,0 +1,28 @@ +From 7559daf38acc293474d3d2a13ecf746bc7507a11 Mon Sep 17 00:00:00 2001 +From: Darik Horn +Date: Tue, 11 Oct 2011 18:32:58 -0500 +Subject: [PATCH 1/2] Revert "Remove /etc/hostid missing warning" + +This reverts commit 6b3b569df30d13ed7bbbff877cffc71290a52f12. +--- + module/spl/spl-generic.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +Index: b/module/spl/spl-generic.c +=================================================================== +--- a/module/spl/spl-generic.c ++++ b/module/spl/spl-generic.c +@@ -471,8 +471,12 @@ + + file = kobj_open_file(spl_hostid_path); + +- if (file == (struct _buf *)-1) ++ if (file == (struct _buf *)-1) { ++ printk(KERN_WARNING ++ "SPL: The %s file is not found.\n", ++ spl_hostid_path); + return -1; ++ } + + result = kobj_get_filesize(file, &size); + diff --git a/spl-debian-pve/patches/series b/spl-debian-pve/patches/series new file mode 100644 index 0000000..74d8d0d --- /dev/null +++ b/spl-debian-pve/patches/series @@ -0,0 +1 @@ +0001-Revert-Remove-etc-hostid-missing-warning.patch diff --git a/spl-debian-pve/rules b/spl-debian-pve/rules new file mode 100755 index 0000000..b8a7b92 --- /dev/null +++ b/spl-debian-pve/rules @@ -0,0 +1,63 @@ +#!/usr/bin/make -f + +NAME := $(shell awk '$$1 == "Name:" { print $$2; }' META) +VERSION := $(shell dpkg-parsechangelog \ + | awk '$$1 == "Version:" { print $$2; }' | cut -d- -f1) +REVISION := $(shell dpkg-parsechangelog \ + | awk '$$1 == "Version:" { print $$2; }' | cut -d- -f2-) + +%: + dh $@ --with autoreconf + +override_dh_auto_configure: + @# Embed the downstream version in the module. + @sed \ + -e 's/^Version:.*/Version: $(VERSION)/' \ + -e 's/^Release:.*/Release: $(REVISION)/' \ + -i.orig META + + @# Create the makefiles and configure script. + ./autogen.sh + + @# Build the userland, but don't build the kernel modules. + dh_auto_configure -- --with-config=user + +override_dh_auto_test: + # scripts/check.sh tries insmod and rmmod, so it cannot + # run in an unprivileged build environment. + +override_dh_auto_install: + @# Install the utilities. + make install DESTDIR='$(CURDIR)/debian/tmp' + + @# Create a dummy hostid file for the zfs-initramfs package. + @# NB: Commentary in the spl.postinst script. + mkdir -p '$(CURDIR)/debian/tmp/etc/' + /usr/bin/printf '\xFF\xFF\xFF\xFF' >'$(CURDIR)/debian/tmp/etc/hostid' + + @# Get a bare copy of the source code. + @# This creates the $(CURDIR)/$(NAME)-$(VERSION)/ tree. + make distdir + + @# Delete boilerplate to satisfy the lintian extra-license-file check. + rm '$(CURDIR)/$(NAME)-$(VERSION)/COPYING' + + @# This shunt allows DKMS to install the Module.symvers and spl_config.h + @# files to the ${dkms_tree} area through the POST_INSTALL directive. + echo '#!/bin/sh' >'$(CURDIR)/$(NAME)-$(VERSION)/cp' + echo 'cp "$$@"' >>'$(CURDIR)/$(NAME)-$(VERSION)/cp' + chmod 755 '$(CURDIR)/$(NAME)-$(VERSION)/cp' + + # Install the DKMS source. + mkdir -p '$(CURDIR)/debian/tmp/usr/src/' + mv '$(CURDIR)/$(NAME)-$(VERSION)' '$(CURDIR)/debian/tmp/usr/src/' + + # Install the dkms.conf file. + dh_dkms -V $(VERSION) + +override_dh_auto_clean: + dh_auto_clean + @if test -e META.orig; then mv META.orig META; fi + +%: + dh $@ diff --git a/spl-debian-pve/spl-dkms.install b/spl-debian-pve/spl-dkms.install new file mode 100644 index 0000000..18576fe --- /dev/null +++ b/spl-debian-pve/spl-dkms.install @@ -0,0 +1,3 @@ +usr/src/spl-*/AUTHORS usr/share/doc/spl-dkms/ +usr/src/spl-*/DISCLAIMER usr/share/doc/spl-dkms/ +usr/src diff --git a/spl-debian-pve/spl-dkms.postinst b/spl-debian-pve/spl-dkms.postinst new file mode 100644 index 0000000..07fe0c2 --- /dev/null +++ b/spl-debian-pve/spl-dkms.postinst @@ -0,0 +1,3 @@ +#!/bin/sh -e + +#DEBHELPER# diff --git a/spl-debian-pve/spl-dkms.prerm b/spl-debian-pve/spl-dkms.prerm new file mode 100644 index 0000000..07fe0c2 --- /dev/null +++ b/spl-debian-pve/spl-dkms.prerm @@ -0,0 +1,3 @@ +#!/bin/sh -e + +#DEBHELPER# diff --git a/spl-debian-pve/spl.install b/spl-debian-pve/spl.install new file mode 100644 index 0000000..6535652 --- /dev/null +++ b/spl-debian-pve/spl.install @@ -0,0 +1,3 @@ +etc/hostid +usr/sbin +usr/share/man diff --git a/spl-debian-pve/spl.postinst b/spl-debian-pve/spl.postinst new file mode 100644 index 0000000..ecbc4cc --- /dev/null +++ b/spl-debian-pve/spl.postinst @@ -0,0 +1,59 @@ +#!/bin/sh -e + +# The hostname and hostid of the last system to access a ZFS pool are stored in +# the ZFS pool itself. A pool is foreign if, during `zpool import`, the +# current hostname and hostid are different than the stored values thereof. +# +# The hostname and hostid on Solaris are intrinsic, but they are not on Linux, +# so the spl kernel module invokes /bin/hostname and /usr/bin/hostid from the +# userland in its initialization routine. +# +# However, these two indentifiers are usually undefined in the Linux initramfs +# environment, so the /etc/hostname and /etc/hostid files must be added to the +# initrd. Things like a DHCP lease change can affect the hostid too. +# +# ZFS requires stable values for hostname and hostid, but basic Linux systems +# do not. The hostid is therefore stabilized by creating the /etc/hostid file +# in the regular environment if it does not already exist. An undefined +# hostname is usuallly stable. +# +# Neither /etc/hostname nor /etc/hostid are controlled configuration files in +# Debian distributions, but the spl package nevertheless installs a dummy +# /etc/hostid file that contains the HW_INVALID_HOSTID sentinal value so that +# the package manager will track it. + +# This result is always an eight-character hexadecimal number sans the 0x +# prefix. Remember that /usr/bin/hostid generates a value if the /etc/hostid +# file doesn't exist or is malformed. +HOSTID=$(hostid) + +if [ -f /etc/hostid -a "0x$HOSTID" != "0xffffffff" ] +then + # This system already has a stable hostid. + exit 0 +fi + +# Truncate the dummy file and generate the actual system hostid. +: >/etc/hostid +HOSTID=$(hostid) + +# @TODO: Check whether this method is appropriate for gethostid(2) on big +# endian systems. (Update: It isn't.) +# +# The /etc/hostname file on i386 and amd64 systems must be a little endian +# integer of exacly four bytes. Regardless, a consistent hostid is more +# important than a correct byte order here. + +# Conveniences like a ${HOSTID:$ii:2} substring range or a `sed` one-liner +# are prohibited here because this file must be dash-compatible by policy. +AA=$(echo $HOSTID | cut -b 1,2) +BB=$(echo $HOSTID | cut -b 3,4) +CC=$(echo $HOSTID | cut -b 5,6) +DD=$(echo $HOSTID | cut -b 7,8) + +# Invoke the external printf because the dash builtin lacks the byte format. +"$(which printf)" "\x$DD\x$CC\x$BB\x$AA" >"/etc/hostid" + +# @ASSERT: [ "$HOSTID" = "$(hostid)" ] + +#DEBHELPER#