add debian packaging files for zfs
This commit is contained in:
parent
e7e8c3293d
commit
8d6c7ec564
153
Makefile
153
Makefile
@ -3,51 +3,55 @@ RELEASE=3.3
|
||||
# source form https://github.com/zfsonlinux/
|
||||
|
||||
ZFSVER=0.6.3-1.2
|
||||
PKGREL=1~wheezy
|
||||
PKGVER=0.6.3-${PKGREL}
|
||||
|
||||
SPLDIR=spl-spl-${ZFSVER}
|
||||
SPLSRC=spl-${ZFSVER}.tar.gz
|
||||
ZFSDIR=zfs-zfs-${ZFSVER}
|
||||
ZFSSRC=zfs-${ZFSVER}.tar.gz
|
||||
|
||||
TOP=$(shell pwd)
|
||||
|
||||
KERNEL_3.10.0_HDR=/usr/src/linux-headers-3.10.0-6-pve/
|
||||
KERNEL_2.6.32_HDR=/usr/src/linux-headers-2.6.32-35-pve/
|
||||
KERNEL_3.10.0_SRC=${TOP}/../pve-kernel-3.10.0/linux-2.6-3.10.0/
|
||||
KERNEL_2.6.32_SRC=${TOP}/../pve-kernel-2.6.32/linux-2.6-2.6.32
|
||||
#TOP=$(shell pwd)
|
||||
#KERNEL_3.10.0_HDR=/usr/src/linux-headers-3.10.0-6-pve/
|
||||
#KERNEL_2.6.32_HDR=/usr/src/linux-headers-2.6.32-35-pve/
|
||||
#KERNEL_3.10.0_SRC=${TOP}/../pve-kernel-3.10.0/linux-2.6-3.10.0/
|
||||
#KERNEL_2.6.32_SRC=${TOP}/../pve-kernel-2.6.32/linux-2.6-2.6.32
|
||||
|
||||
SPL_UTILS_DEBS= \
|
||||
${SPLDIR}_utils/spl_0.6.3-1.2_amd64.deb
|
||||
SPL_DEBS= \
|
||||
spl_${PKGVER}_amd64.deb \
|
||||
spl-dkms_${PKGVER}_all.deb
|
||||
|
||||
SPL_2.6.32_DEBS= \
|
||||
${SPLDIR}_2.6.32/kmod-spl-devel_0.6.3-1.2_amd64.deb \
|
||||
${SPLDIR}_2.6.32/kmod-spl-2.6.32-35-pve_0.6.3-1.2_amd64.deb \
|
||||
${SPLDIR}_2.6.32/kmod-spl-devel-2.6.32-35-pve_0.6.3-1.2_amd64.deb
|
||||
#SPL_2.6.32_DEBS= \
|
||||
#${SPLDIR}_2.6.32/kmod-spl-devel_0.6.3-1.2_amd64.deb \
|
||||
#${SPLDIR}_2.6.32/kmod-spl-2.6.32-35-pve_0.6.3-1.2_amd64.deb \
|
||||
#${SPLDIR}_2.6.32/kmod-spl-devel-2.6.32-35-pve_0.6.3-1.2_amd64.deb
|
||||
|
||||
SPL_3.10.0_DEBS= \
|
||||
${SPLDIR}_3.10.0/kmod-spl-3.10.0-6-pve_0.6.3-1.2_amd64.deb \
|
||||
${SPLDIR}_3.10.0/kmod-spl-devel-3.10.0-6-pve_0.6.3-1.2_amd64.deb
|
||||
#SPL_3.10.0_DEBS= \
|
||||
#${SPLDIR}_3.10.0/kmod-spl-3.10.0-6-pve_0.6.3-1.2_amd64.deb \
|
||||
#${SPLDIR}_3.10.0/kmod-spl-devel-3.10.0-6-pve_0.6.3-1.2_amd64.deb
|
||||
|
||||
ZFS_UTILS_DEBS= \
|
||||
${ZFSDIR}_utils/libnvpair1_0.6.3-1.2_amd64.deb \
|
||||
${ZFSDIR}_utils/libuutil1_0.6.3-1.2_amd64.deb \
|
||||
${ZFSDIR}_utils/libzfs2_0.6.3-1.2_amd64.deb \
|
||||
${ZFSDIR}_utils/libzfs2-devel_0.6.3-1.2_amd64.deb \
|
||||
${ZFSDIR}_utils/libzpool2_0.6.3-1.2_amd64.deb \
|
||||
${ZFSDIR}_utils/zfs_0.6.3-1.2_amd64.deb \
|
||||
${ZFSDIR}_utils/zfs-dracut_0.6.3-1.2_amd64.deb \
|
||||
${ZFSDIR}_utils/zfs-test_0.6.3-1.2_amd64.deb
|
||||
ZFS_DEBS= \
|
||||
libnvpair1_0.6.3-1~wheezy_amd64.deb \
|
||||
libuutil1_0.6.3-1~wheezy_amd64.deb \
|
||||
libzfs2_0.6.3-1~wheezy_amd64.deb \
|
||||
libzfs-dev_0.6.3-1~wheezy_amd64.deb \
|
||||
libzpool2_0.6.3-1~wheezy_amd64.deb \
|
||||
zfs-dkms_0.6.3-1~wheezy_amd64.deb \
|
||||
zfs-doc_0.6.3-1~wheezy_amd64.deb \
|
||||
zfs-initramfs_0.6.3-1~wheezy_amd64.deb \
|
||||
zfsutils_0.6.3-1~wheezy_amd64.deb
|
||||
|
||||
ZFS_2.6.32_DEBS= \
|
||||
${ZFSDIR}_2.6.32/kmod-zfs-2.6.32-35-pve_0.6.3-1.2_amd64.deb \
|
||||
${ZFSDIR}_2.6.32/kmod-zfs-devel_0.6.3-1.2_amd64.deb \
|
||||
${ZFSDIR}_2.6.32/kmod-zfs-devel-2.6.32-35-pve_0.6.3-1.2_amd64.deb
|
||||
#ZFS_2.6.32_DEBS= \
|
||||
#${ZFSDIR}_2.6.32/kmod-zfs-2.6.32-35-pve_0.6.3-1.2_amd64.deb \
|
||||
#${ZFSDIR}_2.6.32/kmod-zfs-devel_0.6.3-1.2_amd64.deb \
|
||||
#${ZFSDIR}_2.6.32/kmod-zfs-devel-2.6.32-35-pve_0.6.3-1.2_amd64.deb
|
||||
|
||||
ZFS_3.10.0_DEBS= \
|
||||
${ZFSDIR}_3.10.0/kmod-zfs-3.10.0-6-pve_0.6.3-1.2_amd64.deb \
|
||||
${ZFSDIR}_3.10.0/kmod-zfs-devel-3.10.0-6-pve_0.6.3-1.2_amd64.deb
|
||||
#ZFS_3.10.0_DEBS= \
|
||||
#${ZFSDIR}_3.10.0/kmod-zfs-3.10.0-6-pve_0.6.3-1.2_amd64.deb \
|
||||
#${ZFSDIR}_3.10.0/kmod-zfs-devel-3.10.0-6-pve_0.6.3-1.2_amd64.deb
|
||||
|
||||
DEBS=${SPL_UTILS_DEBS} ${SPL_2.6.32_DEBS} ${SPL_3.10.0_DEBS} ${ZFS_UTILS_DEBS} ${ZFS_2.6.32_DEBS} ${ZFS_3.10.0_DEBS}
|
||||
DEBS=${SPL_DEBS} ${ZFS_DEBS}
|
||||
|
||||
all: ${DEBS}
|
||||
|
||||
@ -56,70 +60,44 @@ dinstall: ${DEBS}
|
||||
dpkg -i ${DEBS}
|
||||
|
||||
.PHONY: spl_utils
|
||||
spl_utils ${SPL_UTILS_DEBS}: ${SPLSRC}
|
||||
spl_utils ${SPL_DEBS}: ${SPLSRC}
|
||||
rm -rf ${SPLDIR}
|
||||
tar xf ${SPLSRC}
|
||||
mv ${SPLDIR} ${SPLDIR}_utils
|
||||
cd ${SPLDIR}_utils; ./autogen.sh
|
||||
cd ${SPLDIR}_utils; ./configure --with-linux=${KERNEL_2.6.32_HDR} --with-linux-obj=${KERNEL_2.6.32_SRC}
|
||||
cd ${SPLDIR}_utils; make deb-utils
|
||||
cp -a spl-debian-pve ${SPLDIR}/debian
|
||||
cd ${SPLDIR}; dpkg-buildpackage -b -uc -us
|
||||
|
||||
.PHONY: spl_kmod_2.6.32
|
||||
spl_kmod_2.6.32 ${SPL_2.6.32_DEBS}: ${SPLSRC}
|
||||
rm -rf ${SPLDIR}
|
||||
tar xf ${SPLSRC}
|
||||
mv ${SPLDIR} ${SPLDIR}_2.6.32
|
||||
cd ${SPLDIR}_2.6.32; ./autogen.sh
|
||||
cd ${SPLDIR}_2.6.32; ./configure --with-linux=${KERNEL_2.6.32_HDR} --with-linux-obj=${KERNEL_2.6.32_SRC}
|
||||
cd ${SPLDIR}_2.6.32; make deb-kmod
|
||||
|
||||
.PHONY: spl_kmod_3.10.0
|
||||
spl_kmod_3.10.0 ${SPL_3.10.0_DEBS}: ${SPLSRC}
|
||||
rm -rf ${SPLDIR}
|
||||
tar xf ${SPLSRC}
|
||||
mv ${SPLDIR} ${SPLDIR}_3.10.0
|
||||
cd ${SPLDIR}_3.10.0; ./autogen.sh
|
||||
cd ${SPLDIR}_3.10.0; ./configure --with-linux=${KERNEL_3.10.0_HDR} --with-linux-obj=${KERNEL_3.10.0_SRC}
|
||||
cd ${SPLDIR}_3.10.0; make deb-kmod
|
||||
#.PHONY: spl_kmod_2.6.32
|
||||
#spl_kmod_2.6.32 ${SPL_2.6.32_DEBS}: ${SPLSRC}
|
||||
# rm -rf ${SPLDIR}
|
||||
# tar xf ${SPLSRC}
|
||||
# mv ${SPLDIR} ${SPLDIR}_2.6.32
|
||||
# cd ${SPLDIR}_2.6.32; ./autogen.sh
|
||||
# cd ${SPLDIR}_2.6.32; ./configure --with-linux=${KERNEL_2.6.32_HDR} --with-linux-obj=${KERNEL_2.6.32_SRC}
|
||||
# cd ${SPLDIR}_2.6.32; make deb-kmod
|
||||
|
||||
.PHONY: zfs_utils
|
||||
zfs_utils ${ZFS_UTILS_DEBS}: ${ZFSSRC}
|
||||
rm -rf ${ZFSDIR} ${ZFSDIR}_utils
|
||||
zfs_utils ${ZFS_DEBS}: ${ZFSSRC}
|
||||
rm -rf ${ZFSDIR}
|
||||
tar xf ${ZFSSRC}
|
||||
mv ${ZFSDIR} ${ZFSDIR}_utils
|
||||
cd ${ZFSDIR}_utils; ./autogen.sh
|
||||
cd ${ZFSDIR}_utils; ./configure --with-linux=${KERNEL_2.6.32_HDR} --with-linux-obj=${KERNEL_2.6.32_SRC}
|
||||
cd ${ZFSDIR}_utils; make deb-utils
|
||||
cp -a zfs-debian-pve ${ZFSDIR}/debian
|
||||
cd ${ZFSDIR}; dpkg-buildpackage -b -uc -us
|
||||
|
||||
# Note: install mod-spl-devel-* first
|
||||
.PHONY: zfs_kmod_2.6.32
|
||||
zfs_kmod_2.6.32 ${ZFS_2.6.32_DEBS}: ${ZFSSRC}
|
||||
rm -rf ${ZFSDIR} ${ZFSDIR}_2.6.32
|
||||
tar xf ${ZFSSRC}
|
||||
mv ${ZFSDIR} ${ZFSDIR}_2.6.32
|
||||
cd ${ZFSDIR}_2.6.32; ./autogen.sh
|
||||
cd ${ZFSDIR}_2.6.32; ./configure --with-linux=${KERNEL_2.6.32_HDR} --with-linux-obj=${KERNEL_2.6.32_SRC}
|
||||
cd ${ZFSDIR}_2.6.32; make deb-kmod
|
||||
|
||||
# Note: install mod-spl-devel-* first
|
||||
.PHONY: zfs_kmod_3.10.0
|
||||
zfs_kmod_3.10.0 ${ZFS_3.10.0_DEBS}: ${ZFSSRC}
|
||||
rm -rf ${ZFSDIR} ${ZFSDIR}_3.10.0
|
||||
tar xf ${ZFSSRC}
|
||||
mv ${ZFSDIR} ${ZFSDIR}_3.10.0
|
||||
cd ${ZFSDIR}_3.10.0; ./autogen.sh
|
||||
cd ${ZFSDIR}_3.10.0; ./configure --with-linux=${KERNEL_3.10.0_HDR} --with-linux-obj=${KERNEL_3.10.0_SRC}
|
||||
cd ${ZFSDIR}_3.10.0; make deb-kmod
|
||||
## Note: install mod-spl-devel-* first
|
||||
#.PHONY: zfs_kmod_2.6.32
|
||||
#zfs_kmod_2.6.32 ${ZFS_2.6.32_DEBS}: ${ZFSSRC}
|
||||
# rm -rf ${ZFSDIR} ${ZFSDIR}_2.6.32
|
||||
# tar xf ${ZFSSRC}
|
||||
# mv ${ZFSDIR} ${ZFSDIR}_2.6.32
|
||||
# cd ${ZFSDIR}_2.6.32; ./autogen.sh
|
||||
# cd ${ZFSDIR}_2.6.32; ./configure --with-linux=${KERNEL_2.6.32_HDR} --with-linux-obj=${KERNEL_2.6.32_SRC}
|
||||
# cd ${ZFSDIR}_2.6.32; make deb-kmod
|
||||
|
||||
.PHONY: download
|
||||
download:
|
||||
git clone https://github.com/zfsonlinux/pkg-spl.git
|
||||
#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
|
||||
##git checkout master/ubuntu/precise
|
||||
##git checkout master/debian/wheezy
|
||||
rm spl-*.tar.gz
|
||||
rm zfs-*.tar.gz
|
||||
wget https://github.com/zfsonlinux/spl/archive/${SPLSRC}
|
||||
@ -127,7 +105,7 @@ download:
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf *~ *.deb *.changes ${ZFSDIR} ${ZFSDIR}_utils ${ZFSDIR}_2.6.32 ${ZFSDIR}_3.10.0 ${SPLDIR} ${SPLDIR}_utils ${SPLDIR}_2.6.32 ${SPLDIR}_3.10.0
|
||||
rm -rf *~ *.deb *.changes ${ZFSDIR} ${SPLDIR}
|
||||
|
||||
.PHONY: distclean
|
||||
distclean: clean
|
||||
@ -142,12 +120,9 @@ upload: ${DEBS}
|
||||
rm -f /pve/${RELEASE}/extra/libnvpair1_*.deb
|
||||
rm -f /pve/${RELEASE}/extra/libuutil1_*.deb
|
||||
rm -f /pve/${RELEASE}/extra/libzfs2_*.deb
|
||||
rm -f /pve/${RELEASE}/extra/libzfs2-devel_*.deb
|
||||
rm -f /pve/${RELEASE}/extra/libzfs2-dbg_*.deb
|
||||
rm -f /pve/${RELEASE}/extra/libzpool2_*.deb
|
||||
rm -f /pve/${RELEASE}/extra/zfs_*.deb
|
||||
rm -f /pve/${RELEASE}/extra/zfs-dracut_*.deb
|
||||
rm -f /pve/${RELEASE}/extra/zfs-test_*.deb
|
||||
rm -f /pve/${RELEASE}/extra/kmod-zfs-*.deb
|
||||
rm -f /pve/${RELEASE}/extra/Packages*
|
||||
cp ${DEBS} /pve/${RELEASE}/extra
|
||||
cd /pve/${RELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
|
||||
|
6
zfs-debian-pve/changelog
Normal file
6
zfs-debian-pve/changelog
Normal file
@ -0,0 +1,6 @@
|
||||
zfs-linux (0.6.3-1~wheezy) unstable; urgency=low
|
||||
|
||||
* first version for Proxmox VE
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Sat, 10 Jan 2015 14:06:34 +0100
|
||||
|
1
zfs-debian-pve/compat
Normal file
1
zfs-debian-pve/compat
Normal file
@ -0,0 +1 @@
|
||||
7
|
179
zfs-debian-pve/control
Normal file
179
zfs-debian-pve/control
Normal file
@ -0,0 +1,179 @@
|
||||
Source: zfs-linux
|
||||
Section: kernel
|
||||
Priority: extra
|
||||
Maintainer: Proxmox Support Team <support@proxmox.com>
|
||||
Build-Depends: autotools-dev,
|
||||
autoconf,
|
||||
autogen,
|
||||
automake,
|
||||
debhelper (>= 8),
|
||||
dh-autoreconf,
|
||||
dkms (>= 2.2.0.2),
|
||||
libselinux1-dev,
|
||||
libtool,
|
||||
uuid-dev,
|
||||
zlib1g-dev,
|
||||
Standards-Version: 3.9.5
|
||||
|
||||
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
|
||||
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 OpenZFS on Linux:
|
||||
* libspl: The Solaris Porting Layer 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 and SMB service integration for OpenZFS.
|
||||
|
||||
Package: libuutil1-dbg
|
||||
Section: debug
|
||||
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 OpenZFS on Linux:
|
||||
* libspl: The Solaris Porting Layer 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 and SMB service integration for OpenZFS.
|
||||
.
|
||||
This package contains debugging symbols for libuutil1.
|
||||
|
||||
Package: libzfs-dev
|
||||
Section: libdevel
|
||||
Architecture: linux-any
|
||||
Depends: ${misc:Depends}, libzfs2 (= ${binary:Version})
|
||||
Provides: libnvpair-dev, libuutil-dev
|
||||
Replaces: libefi1,
|
||||
libnvpair1,
|
||||
libshare1,
|
||||
libspl1,
|
||||
libunicode1,
|
||||
libuutil1,
|
||||
libzavl1,
|
||||
libzfs2,
|
||||
libzpool2,
|
||||
Description: Native OpenZFS filesystem development files for Linux
|
||||
Header files and static libraries for compiling software
|
||||
against libzfs.
|
||||
|
||||
Package: libzfs2
|
||||
Section: libs
|
||||
Architecture: linux-any
|
||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
||||
Replaces: libzfs0, libzfs1
|
||||
Description: Native OpenZFS filesystem library for Linux
|
||||
The ZoL management library.
|
||||
|
||||
Package: libzfs2-dbg
|
||||
Section: debug
|
||||
Architecture: linux-any
|
||||
Depends: ${misc:Depends}, libzfs2 (= ${binary:Version})
|
||||
Replaces: libzfs0-dbg, libzfs1-dbg
|
||||
Description: Debugging symbols for libzfs2
|
||||
The ZoL management library.
|
||||
.
|
||||
This package contains the debugging symbols for libzfs2.
|
||||
|
||||
Package: libzpool2
|
||||
Section: libs
|
||||
Architecture: linux-any
|
||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
||||
Replaces: libzpool0, libzpool1
|
||||
Description: Native OpenZFS pool library for Linux
|
||||
The zpool management library.
|
||||
|
||||
Package: libzpool2-dbg
|
||||
Section: debug
|
||||
Architecture: linux-any
|
||||
Depends: ${misc:Depends}, libzpool2 (= ${binary:Version})
|
||||
Replaces: libzpool0-dbg, libzpool1-dbg
|
||||
Description: Debugging symbols for libzpool2
|
||||
The zpool management library.
|
||||
.
|
||||
This package contains the debugging symbols for libzpool2.
|
||||
|
||||
Package: zfs-dkms
|
||||
Section: kernel
|
||||
Architecture: linux-any
|
||||
Pre-Depends: spl-dkms (>= ${source:Upstream-Version})
|
||||
Depends: ${misc:Depends}, dkms (>= 2.2.0.2)
|
||||
Replaces: lzfs, lzfs-dkms
|
||||
Provides: lustre-backend-fs, lzfs, lzfs-dkms
|
||||
Conflicts: lzfs, lzfs-dkms
|
||||
Description: Native OpenZFS filesystem kernel modules for Linux
|
||||
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.
|
||||
.
|
||||
Includes the SPA, DMU, ZVOL, and ZPL components of OpenZFS.
|
||||
|
||||
Package: zfs-doc
|
||||
Section: doc
|
||||
Architecture: linux-any
|
||||
Depends: ${misc:Depends}
|
||||
Description: Native OpenZFS filesystem documentation and examples.
|
||||
Shared boilerplate files for OpenZFS on Linux that are not required at runtime.
|
||||
|
||||
Package: zfs-initramfs
|
||||
Section: kernel
|
||||
Architecture: linux-any
|
||||
Depends: ${misc:Depends}, zfsutils
|
||||
Description: Native OpenZFS root filesystem capabilities for Linux
|
||||
This package adds OpenZFS 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: Native OpenZFS management utilities for Linux
|
||||
This package provides the zpool and zfs commands that are used to
|
||||
manage OpenZFS filesystems.
|
||||
|
||||
Package: zfsutils-dbg
|
||||
Section: debug
|
||||
Architecture: linux-any
|
||||
Depends: ${misc:Depends}, zfsutils (= ${binary:Version})
|
||||
Replaces: zfs-dbg
|
||||
Description: Debugging symbols for zfsutils
|
||||
This package provides the zpool and zfs commands that are used to
|
||||
manage OpenZFS filesystems.
|
||||
.
|
||||
This package contains the debugging symbols for zfsutils.
|
1629
zfs-debian-pve/copyright
Normal file
1629
zfs-debian-pve/copyright
Normal file
File diff suppressed because it is too large
Load Diff
1
zfs-debian-pve/libnvpair1.install
Normal file
1
zfs-debian-pve/libnvpair1.install
Normal file
@ -0,0 +1 @@
|
||||
lib/libnvpair.so.*
|
1
zfs-debian-pve/libuutil1.install
Normal file
1
zfs-debian-pve/libuutil1.install
Normal file
@ -0,0 +1 @@
|
||||
lib/libuutil.so.*
|
4
zfs-debian-pve/libzfs-dev.install
Normal file
4
zfs-debian-pve/libzfs-dev.install
Normal file
@ -0,0 +1,4 @@
|
||||
lib/*.a
|
||||
lib/*.la
|
||||
lib/*.so
|
||||
usr/include
|
2
zfs-debian-pve/libzfs2.install
Normal file
2
zfs-debian-pve/libzfs2.install
Normal file
@ -0,0 +1,2 @@
|
||||
lib/libzfs.so.*
|
||||
lib/libzfs_core.so.*
|
1
zfs-debian-pve/libzpool2.install
Normal file
1
zfs-debian-pve/libzpool2.install
Normal file
@ -0,0 +1 @@
|
||||
lib/libzpool.so.*
|
@ -0,0 +1,71 @@
|
||||
From: Darik Horn <dajhorn@vanadac.com>
|
||||
Date: Tue, 17 Jan 2012 19:45:07 -0600
|
||||
Subject: Prevent manual builds in the DKMS source.
|
||||
|
||||
Print an instructive error messsage and exit if the `dkms.conf` file
|
||||
exists when the userland is configured. (ie: `--with-config=user`)
|
||||
|
||||
A non-trivial number of people try to rebuild ZoL from the
|
||||
`/usr/src/zfs` tree, which is modified to better satisfy Debian
|
||||
packaging policy and contains only the module sources for DKMS.
|
||||
|
||||
Regardless, local installations usually break managed installations,
|
||||
so this autotools test could be further enhanced to check whether
|
||||
ZFS has a DKMS registration.
|
||||
---
|
||||
config/dkms.m4 | 14 ++++++++++++++
|
||||
config/user.m4 | 1 +
|
||||
config/zfs-build.m4 | 6 +++---
|
||||
3 files changed, 18 insertions(+), 3 deletions(-)
|
||||
create mode 100644 config/dkms.m4
|
||||
|
||||
diff --git a/config/dkms.m4 b/config/dkms.m4
|
||||
new file mode 100644
|
||||
index 0000000..cfa1152
|
||||
--- /dev/null
|
||||
+++ b/config/dkms.m4
|
||||
@@ -0,0 +1,14 @@
|
||||
+dnl #
|
||||
+dnl # Prevent manual building in DKMS source tree.
|
||||
+dnl #
|
||||
+AC_DEFUN([ZFS_AC_DKMS_INHIBIT], [
|
||||
+ AC_MSG_CHECKING([for dkms.conf file])
|
||||
+ AS_IF([test -e dkms.conf], [
|
||||
+ AC_MSG_ERROR([
|
||||
+ *** ZFS should not be manually built in the DKMS source tree.
|
||||
+ *** Remove all ZFS packages before compiling the ZoL sources.
|
||||
+ *** Running "make install" breaks ZFS packages.])
|
||||
+ ], [
|
||||
+ AC_MSG_RESULT([not found])
|
||||
+ ])
|
||||
+])
|
||||
diff --git a/config/user.m4 b/config/user.m4
|
||||
index 3802437..f5a8827 100644
|
||||
--- a/config/user.m4
|
||||
+++ b/config/user.m4
|
||||
@@ -2,6 +2,7 @@ dnl #
|
||||
dnl # Default ZFS user configuration
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_CONFIG_USER], [
|
||||
+ ZFS_AC_DKMS_INHIBIT
|
||||
ZFS_AC_CONFIG_USER_UDEV
|
||||
ZFS_AC_CONFIG_USER_SYSTEMD
|
||||
ZFS_AC_CONFIG_USER_SYSVINIT
|
||||
diff --git a/config/zfs-build.m4 b/config/zfs-build.m4
|
||||
index 5ec94a0..41eec88 100644
|
||||
--- a/config/zfs-build.m4
|
||||
+++ b/config/zfs-build.m4
|
||||
@@ -87,10 +87,10 @@ AC_DEFUN([ZFS_AC_CONFIG], [
|
||||
ZFS_AC_CONFIG_ALWAYS
|
||||
|
||||
case "$ZFS_CONFIG" in
|
||||
- kernel) ZFS_AC_CONFIG_KERNEL ;;
|
||||
user) ZFS_AC_CONFIG_USER ;;
|
||||
- all) ZFS_AC_CONFIG_KERNEL
|
||||
- ZFS_AC_CONFIG_USER ;;
|
||||
+ kernel) ZFS_AC_CONFIG_KERNEL ;;
|
||||
+ all) ZFS_AC_CONFIG_USER
|
||||
+ ZFS_AC_CONFIG_KERNEL ;;
|
||||
srpm) ;;
|
||||
*)
|
||||
AC_MSG_RESULT([Error!])
|
@ -0,0 +1,70 @@
|
||||
From: Darik Horn <dajhorn@vanadac.com>
|
||||
Date: Sat, 18 Oct 2014 14:23:11 -0500
|
||||
Subject: Check for META and DCH consistency in autoconf.
|
||||
|
||||
If a debian/ packaging overlay exists, then the software versions defined in
|
||||
the META and debian/changelog files must be the same to ensure that DKMS uses
|
||||
correct paths and that users see the same version everywhere.
|
||||
---
|
||||
config/zfs-meta.m4 | 34 +++++++++++++++++++++++++++++-----
|
||||
1 file changed, 29 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/config/zfs-meta.m4 b/config/zfs-meta.m4
|
||||
index 7c92dd5..d174ccc 100644
|
||||
--- a/config/zfs-meta.m4
|
||||
+++ b/config/zfs-meta.m4
|
||||
@@ -1,9 +1,10 @@
|
||||
dnl #
|
||||
dnl # DESCRIPTION:
|
||||
-dnl # Read meta data from the META file. When building from a git repository
|
||||
-dnl # the ZFS_META_RELEASE field will be overwritten if there is an annotated
|
||||
-dnl # tag matching the form ZFS_META_NAME-ZFS_META_VERSION-*. This allows
|
||||
-dnl # for working builds to be uniquely identified using the git commit hash.
|
||||
+dnl # Read meta data from the META file or the debian/changelog file if it
|
||||
+dnl # exists. When building from a git repository the ZFS_META_RELEASE field
|
||||
+dnl # will be overwritten if there is an annotated tag matching the form
|
||||
+dnl # ZFS_META_NAME-ZFS_META_VERSION-*. This allows for working builds to be
|
||||
+dnl # uniquely identified using the git commit hash.
|
||||
dnl #
|
||||
dnl # The META file format is as follows:
|
||||
dnl # ^[ ]*KEY:[ \t]+VALUE$
|
||||
@@ -49,6 +50,7 @@ AC_DEFUN([ZFS_AC_META], [
|
||||
_zfs_ac_meta_type="none"
|
||||
if test -f "$META"; then
|
||||
_zfs_ac_meta_type="META file"
|
||||
+ _dpkg_parsechangelog=$(dpkg-parsechangelog 2>/dev/null)
|
||||
|
||||
ZFS_META_NAME=_ZFS_AC_META_GETVAL([(Name|Project|Package)]);
|
||||
if test -n "$ZFS_META_NAME"; then
|
||||
@@ -66,8 +68,30 @@ AC_DEFUN([ZFS_AC_META], [
|
||||
AC_SUBST([ZFS_META_VERSION])
|
||||
fi
|
||||
|
||||
+ if test -n "${_dpkg_parsechangelog}"; then
|
||||
+ _dpkg_version=$(echo "${_dpkg_parsechangelog}" \
|
||||
+ | $AWK '$[]1 == "Version:" { print $[]2; }' \
|
||||
+ | cut -d- -f1)
|
||||
+ if test "${_dpkg_version}" != "$ZFS_META_VERSION"; then
|
||||
+ AC_MSG_ERROR([
|
||||
+ *** Version $ZFS_META_VERSION in the META file is different than
|
||||
+ *** version $_dpkg_version in the debian/changelog file. DKMS and DEB
|
||||
+ *** packaging require that these files have the same version.
|
||||
+ ])
|
||||
+ fi
|
||||
+ fi
|
||||
+
|
||||
ZFS_META_RELEASE=_ZFS_AC_META_GETVAL([Release]);
|
||||
- if test ! -f ".nogitrelease" && git rev-parse --git-dir > /dev/null 2>&1; then
|
||||
+
|
||||
+ if test -n "${_dpkg_parsechangelog}"; then
|
||||
+ _dpkg_release=$(echo "${_dpkg_parsechangelog}" \
|
||||
+ | $AWK '$[]1 == "Version:" { print $[]2; }' \
|
||||
+ | cut -d- -f2-)
|
||||
+ if test -n "${_dpkg_release}"; then
|
||||
+ ZFS_META_RELEASE=${_dpkg_release}
|
||||
+ _zfs_ac_meta_type="dpkg-parsechangelog"
|
||||
+ fi
|
||||
+ elif test ! -f ".nogitrelease" && git rev-parse --git-dir > /dev/null 2>&1; then
|
||||
_match="${ZFS_META_NAME}-${ZFS_META_VERSION}"
|
||||
_alias=$(git describe --match=${_match} 2>/dev/null)
|
||||
_release=$(echo ${_alias}|cut -f3- -d'-'|sed 's/-/_/g')
|
@ -0,0 +1,41 @@
|
||||
From: Darik Horn <dajhorn@vanadac.com>
|
||||
Date: Sat, 18 Oct 2014 19:48:46 -0500
|
||||
Subject: Add libuutil to LIBADD for libzfs and libzfs_core
|
||||
|
||||
Resolve spurious dpkg-shlibdeps warnings like this:
|
||||
|
||||
warning: symbol strlcpy used by libzfs_core.so found in none of the libraries
|
||||
|
||||
This happens because dpkg-shlibdeps does not recursively search for symbols.
|
||||
|
||||
Signed-off-by: Darik Horn <dajhorn@vanadac.com>
|
||||
---
|
||||
lib/libzfs/Makefile.am | 1 +
|
||||
lib/libzfs_core/Makefile.am | 3 ++-
|
||||
2 files changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/libzfs/Makefile.am b/lib/libzfs/Makefile.am
|
||||
index 8b1f517..efdf84b 100644
|
||||
--- a/lib/libzfs/Makefile.am
|
||||
+++ b/lib/libzfs/Makefile.am
|
||||
@@ -23,6 +23,7 @@ libzfs_la_SOURCES = \
|
||||
|
||||
libzfs_la_LIBADD = \
|
||||
$(top_builddir)/lib/libzfs_core/libzfs_core.la \
|
||||
+ $(top_builddir)/lib/libuutil/libuutil.la \
|
||||
$(top_builddir)/lib/libshare/libshare.la \
|
||||
$(top_builddir)/lib/libnvpair/libnvpair.la \
|
||||
$(top_builddir)/lib/libzpool/libzpool.la
|
||||
diff --git a/lib/libzfs_core/Makefile.am b/lib/libzfs_core/Makefile.am
|
||||
index 0ecd208..6f0be5f 100644
|
||||
--- a/lib/libzfs_core/Makefile.am
|
||||
+++ b/lib/libzfs_core/Makefile.am
|
||||
@@ -10,6 +10,7 @@ libzfs_core_la_SOURCES = \
|
||||
$(top_srcdir)/lib/libzfs_core/libzfs_core.c
|
||||
|
||||
libzfs_core_la_LIBADD = \
|
||||
- $(top_builddir)/lib/libnvpair/libnvpair.la
|
||||
+ $(top_builddir)/lib/libnvpair/libnvpair.la \
|
||||
+ $(top_builddir)/lib/libuutil/libuutil.la
|
||||
|
||||
libzfs_core_la_LDFLAGS = -version-info 1:0:0
|
@ -0,0 +1,31 @@
|
||||
From: Ned Bass <bass6@llnl.gov>
|
||||
Date: Wed, 17 Dec 2014 11:01:42 -0800
|
||||
Subject: vdev_id: use mawk-compatible regular expression
|
||||
|
||||
Slot mapping in vdev_id doesn't work on systems using mawk as the 'awk'
|
||||
alternative. A regular expression in map_slot() contains an unquoted
|
||||
empty string following the alternation (|) operator, which results in an
|
||||
"missing operand" error with mawk. The solution is to rearrange the
|
||||
expression so the alternation has two operands.
|
||||
|
||||
Signed-off-by: Ned Bass <bass6@llnl.gov>
|
||||
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
|
||||
Closes zfsonlinux/pkg-zfs#136
|
||||
Closes zfsonlinux/zfs#2965
|
||||
---
|
||||
cmd/vdev_id/vdev_id | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/cmd/vdev_id/vdev_id b/cmd/vdev_id/vdev_id
|
||||
index b6752ba..6fddd12 100755
|
||||
--- a/cmd/vdev_id/vdev_id
|
||||
+++ b/cmd/vdev_id/vdev_id
|
||||
@@ -116,7 +116,7 @@ map_slot() {
|
||||
local MAPPED_SLOT=
|
||||
|
||||
MAPPED_SLOT=`awk "\\$1 == \"slot\" && \\$2 == ${LINUX_SLOT} && \
|
||||
- \\$4 ~ /^(${CHANNEL}|)$/ { print \\$3; exit }" $CONFIG`
|
||||
+ \\$4 ~ /^${CHANNEL}$|^$/ { print \\$3; exit }" $CONFIG`
|
||||
if [ -z "$MAPPED_SLOT" ] ; then
|
||||
MAPPED_SLOT=$LINUX_SLOT
|
||||
fi
|
4
zfs-debian-pve/patches/series
Normal file
4
zfs-debian-pve/patches/series
Normal file
@ -0,0 +1,4 @@
|
||||
0001-Prevent-manual-builds-in-the-DKMS-source.patch
|
||||
0002-Check-for-META-and-DCH-consistency-in-autoconf.patch
|
||||
0003-Add-libuutil-to-LIBADD-for-libzfs-and-libzfs_core.patch
|
||||
0005-vdev_id-use-mawk-compatible-regular-expression.patch
|
115
zfs-debian-pve/rules
Executable file
115
zfs-debian-pve/rules
Executable file
@ -0,0 +1,115 @@
|
||||
#!/usr/bin/make -f
|
||||
|
||||
CHMOD ?= chmod
|
||||
INSTALL ?= install
|
||||
MAKE ?= make
|
||||
|
||||
META_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-)
|
||||
|
||||
META_DISTDIR := $(CURDIR)/$(META_NAME)-$(VERSION)/
|
||||
|
||||
%:
|
||||
dh $@ --with autoreconf,dkms
|
||||
|
||||
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
|
||||
|
||||
@# Build the userland, but don't build the kernel modules.
|
||||
dh_auto_configure -- \
|
||||
--bindir=/bin \
|
||||
--sbindir=/sbin \
|
||||
--libdir=/lib \
|
||||
--with-udevdir=/lib/udev \
|
||||
--with-config=user
|
||||
|
||||
override_dh_auto_test:
|
||||
# The dh_auto_test rule is disabled because
|
||||
# `make check` cannot run in an unprivileged build environment.
|
||||
|
||||
override_dh_auto_install:
|
||||
@# Install the utilities.
|
||||
$(MAKE) install DESTDIR='$(CURDIR)/debian/tmp'
|
||||
|
||||
@# Get a bare copy of the source code for DKMS.
|
||||
@# This creates the $(META_DISTDIR)/ tree.
|
||||
$(MAKE) distdir
|
||||
|
||||
@# Delete components that are not required to build the kernel modules.
|
||||
@# This prevents several lintian complaints, discourages users from
|
||||
@# running `make install` in /usr/src, and reduces the installation
|
||||
@# size by one third. The printf creates a dummy automake file.
|
||||
umask 0111 && \
|
||||
cd '$(META_DISTDIR)' && \
|
||||
for ii in $$(find cmd dracut etc lib man rpm scripts udev -type f); do \
|
||||
rm "$$ii"; \
|
||||
test "$$ii" != "$${ii%.in}" && printf '%%:\n\t#\n' >"$$ii"; \
|
||||
true; \
|
||||
done
|
||||
|
||||
@# This shunt allows DKMS to copy the Module.symvers and zfs_config.h
|
||||
@# files into the ${dkms_tree} area through the POST_INSTALL directive.
|
||||
printf '#!/bin/sh\ncp "$$@"\n' >'$(META_DISTDIR)/cp'
|
||||
$(CHMOD) 755 '$(META_DISTDIR)/cp'
|
||||
|
||||
@# Install the DKMS source directly, avoiding dh_install.
|
||||
$(INSTALL) -d '$(CURDIR)/debian/zfs-dkms/usr/src/'
|
||||
mv '$(META_DISTDIR)' '$(CURDIR)/debian/zfs-dkms/usr/src/'
|
||||
|
||||
override_dh_dkms:
|
||||
dh_dkms -V
|
||||
|
||||
override_dh_install:
|
||||
@# Exclude the upstream /usr/lib/udev/rules.d files.
|
||||
dh_install -X/rules.d/
|
||||
|
||||
@# Ensure that /etc/zfs is in the zfsutils package
|
||||
@# because git has difficulty tracking empty directories.
|
||||
$(INSTALL) -d '$(CURDIR)/debian/zfsutils/etc/zfs/'
|
||||
|
||||
@# Resolve lintian errors regarding Debian Policy Manual Section 8.4
|
||||
@# by moving unversioned library links from /lib to /usr/lib in the
|
||||
@# development package. Look at libc6-dev for a packaging example if
|
||||
@# multiarch support ever becomes a concern here.
|
||||
$(INSTALL) -d '$(CURDIR)/debian/libzfs-dev/usr/lib/'
|
||||
cd '$(CURDIR)/debian/libzfs-dev/lib' && \
|
||||
for ii in $$(find -type l); do \
|
||||
ln -s "../../lib/$$(readlink "$$ii")" "../usr/lib/$$(basename "$$ii")" \
|
||||
&& rm "$$ii"; \
|
||||
done
|
||||
|
||||
override_dh_installdocs:
|
||||
dh_installdocs --link-doc=zfs-doc
|
||||
|
||||
override_dh_installinit:
|
||||
@# Install debian/zfsutils.zfs.default as /etc/default/zfs.
|
||||
dh_installinit --name=zfs
|
||||
|
||||
@# Install the /etc/init.d/zfs-mount script.
|
||||
@# Debian runs local mounts at sysv sequences [10..12] [08..09].
|
||||
dh_installinit --name=zfs-mount \
|
||||
--no-restart-on-upgrade --no-start -- defaults 13 07
|
||||
|
||||
@# Debian runs nfs-kernel-server at sysv sequence 17 01,
|
||||
@# iscsitarget at 02 01, and samba at 01 02.
|
||||
dh_installinit --name=zfs-share \
|
||||
--no-restart-on-upgrade --no-start -- defaults 18 00
|
||||
|
||||
|
||||
override_dh_installudev:
|
||||
dh_installudev --name=zvol --priority=60
|
||||
dh_installudev --name=vdev --priority=69
|
||||
|
||||
override_dh_strip:
|
||||
dh_strip -plibnvpair1 --dbg-package=libnvpair1-dbg
|
||||
dh_strip -plibuutil1 --dbg-package=libuutil1-dbg
|
||||
dh_strip -plibzfs2 --dbg-package=libzfs2-dbg
|
||||
dh_strip -plibzpool2 --dbg-package=libzpool2-dbg
|
||||
dh_strip -pzfsutils --dbg-package=zfsutils-dbg
|
6
zfs-debian-pve/tree/zfs-doc/etc/dpkg/dpkg.cfg.d/zfs-doc
Normal file
6
zfs-debian-pve/tree/zfs-doc/etc/dpkg/dpkg.cfg.d/zfs-doc
Normal file
@ -0,0 +1,6 @@
|
||||
## /etc/dpkg/dpkg.cfg.d/zfs-doc
|
||||
##
|
||||
## DPKG overrides that prevent the installation of ZoL documentation.
|
||||
|
||||
## Enable this line to reduce installation size.
|
||||
#path-exclude /usr/share/doc/zfs-doc/*
|
@ -0,0 +1,2 @@
|
||||
# Force the inclusion of Busybox in the initramfs.
|
||||
BUSYBOX=y
|
75
zfs-debian-pve/tree/zfs-initramfs/usr/share/initramfs-tools/hooks/zfs
Executable file
75
zfs-debian-pve/tree/zfs-initramfs/usr/share/initramfs-tools/hooks/zfs
Executable file
@ -0,0 +1,75 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Add ZoL filesystem capabilities to an initrd, usually for a native OpenZFS root.
|
||||
#
|
||||
|
||||
# This hook installs udev rules for ZoL.
|
||||
PREREQ="zdev"
|
||||
|
||||
# These prerequisites are provided by the zfsutils package. The zdb utility is
|
||||
# not strictly required, but it can be useful at the initramfs recovery prompt.
|
||||
COPY_EXEC_LIST="/sbin/zdb /sbin/zpool /sbin/zfs /sbin/mount.zfs"
|
||||
|
||||
# These prerequisites are provided by the base system.
|
||||
COPY_EXEC_LIST="$COPY_EXEC_LIST /bin/hostname /sbin/blkid"
|
||||
|
||||
# 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"
|
||||
|
||||
# Generic result code.
|
||||
RC=0
|
||||
|
||||
case $1 in
|
||||
prereqs)
|
||||
echo "$PREREQ"
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
for ii in $COPY_EXEC_LIST
|
||||
do
|
||||
if [ ! -x "$ii" ]
|
||||
then
|
||||
echo "Error: $ii is not executable."
|
||||
RC=2
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$RC" -ne 0 ]
|
||||
then
|
||||
exit "$RC"
|
||||
fi
|
||||
|
||||
. /usr/share/initramfs-tools/hook-functions
|
||||
|
||||
mkdir -p "$DESTDIR/etc/"
|
||||
|
||||
# ZDB uses pthreads for some functions, but the library dependency is not
|
||||
# automatically detected. The `find` utility and extended `cp` options are
|
||||
# used here because libgcc_s.so could be in a subdirectory of /lib for
|
||||
# multi-arch installations.
|
||||
cp --target-directory="$DESTDIR" --parents $(find /lib -type f -name libgcc_s.so.1)
|
||||
|
||||
for ii in $COPY_EXEC_LIST
|
||||
do
|
||||
copy_exec "$ii"
|
||||
done
|
||||
|
||||
for ii in $MANUAL_ADD_MODULES_LIST
|
||||
do
|
||||
manual_add_modules "$ii"
|
||||
done
|
||||
|
||||
if [ -f "/etc/hostname" ]
|
||||
then
|
||||
cp -p "/etc/hostname" "$DESTDIR/etc/"
|
||||
else
|
||||
hostname >"$DESTDIR/etc/hostname"
|
||||
fi
|
||||
|
||||
# ZoL 0.6.3 deprecated the hostid check.
|
||||
if [ -f /etc/hostid ]
|
||||
then
|
||||
cp -p /etc/hostid "$DESTDIR/etc/hostid"
|
||||
fi
|
@ -0,0 +1,163 @@
|
||||
# ZFS boot stub for initramfs-tools.
|
||||
#
|
||||
# In the initramfs environment, the /init script sources this stub to
|
||||
# override the default functions in the /scripts/local script.
|
||||
#
|
||||
# Enable this by passing boot=zfs on the kernel command line.
|
||||
#
|
||||
|
||||
|
||||
pre_mountroot()
|
||||
{
|
||||
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-top"
|
||||
run_scripts /scripts/local-top
|
||||
[ "$quiet" != "y" ] && log_end_msg
|
||||
|
||||
if [ -r '/etc/default/zfs' ]
|
||||
then
|
||||
. '/etc/default/zfs'
|
||||
if [ "$ZFS_INITRD_PRE_MOUNTROOT_SLEEP" -gt '0' ]
|
||||
then
|
||||
[ "$quiet" != "y" ] && log_begin_msg "Sleeping for $ZFS_INITRD_PRE_MOUNTROOT_SLEEP seconds..."
|
||||
sleep "$ZFS_INITRD_PRE_MOUNTROOT_SLEEP"
|
||||
[ "$quiet" != "y" ] && log_end_msg
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Duplicates the functionality found under try_failure_hooks in functions
|
||||
# but invoking that would be inappropriate here.
|
||||
disable_plymouth()
|
||||
{
|
||||
if [ -x /bin/plymouth ] && /bin/plymouth --ping
|
||||
then
|
||||
/bin/plymouth hide-splash >/dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
mountroot()
|
||||
{
|
||||
pre_mountroot
|
||||
|
||||
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-premount"
|
||||
run_scripts /scripts/local-premount
|
||||
[ "$quiet" != "y" ] && log_end_msg
|
||||
|
||||
# Wait for all of the /dev/{hd,sd}[a-z] device nodes to appear.
|
||||
wait_for_udev
|
||||
|
||||
# Load the module now to get consistent automatic pool import behavior.
|
||||
modprobe zfs
|
||||
|
||||
# Check the kernel command line for overrides.
|
||||
ZFS_RPOOL="${rpool#rpool=}"
|
||||
ZFS_BOOTFS="${bootfs#bootfs=}"
|
||||
|
||||
if [ -z "$ZFS_RPOOL" ]
|
||||
then
|
||||
# Check for the `-B zfs-bootfs=%s/%u,...` kind of parameter.
|
||||
#
|
||||
# The ${zfs-bootfs} variable is set at the kernel commmand
|
||||
# line, usually by GRUB, but it cannot be referenced here
|
||||
# directly because bourne variable names cannot contain a
|
||||
# hyphen.
|
||||
#
|
||||
# Reassign the variable by dumping the environment and
|
||||
# stripping the zfs-bootfs= prefix. Let the shell handle
|
||||
# quoting through the eval command.
|
||||
eval ZFS_RPOOL=$(set | sed -n -e 's,^zfs-bootfs=,,p')
|
||||
|
||||
# Only the pool name is relevant because the ZFS filesystem on
|
||||
# Linux is extrinsic and the userland cannot resolve a ZFS
|
||||
# object number.
|
||||
#
|
||||
# Strip everything after the first slash character.
|
||||
ZFS_RPOOL=$(echo "$ZFS_RPOOL" | sed -e 's,/.*,,')
|
||||
fi
|
||||
|
||||
# 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.
|
||||
|
||||
[ "$quiet" != "y" ] && log_begin_msg "Importing ZFS root pool $ZFS_RPOOL"
|
||||
if [ -f /etc/zfs/zpool.cache ]
|
||||
then
|
||||
ZFS_STDERR=$(zpool list "$ZFS_RPOOL" 1>/dev/null 2>&1 \
|
||||
|| zpool import -f -N "$ZFS_RPOOL" 2>&1)
|
||||
ZFS_ERROR=$?
|
||||
else
|
||||
ZFS_STDERR=$(zpool import -f -N "$ZFS_RPOOL" 2>&1)
|
||||
ZFS_ERROR=$?
|
||||
fi
|
||||
[ "$quiet" != "y" ] && log_end_msg
|
||||
|
||||
if [ "$ZFS_ERROR" -ne 0 ]
|
||||
then
|
||||
disable_plymouth
|
||||
echo "Command: zpool import -f -N $ZFS_RPOOL"
|
||||
echo "Message: $ZFS_STDERR"
|
||||
echo "Error: $ZFS_ERROR"
|
||||
echo ""
|
||||
echo "Manually import the root pool at the command prompt and then exit."
|
||||
echo "Hint: Try: zpool import -f -R / -N $ZFS_RPOOL"
|
||||
/bin/sh
|
||||
fi
|
||||
|
||||
if [ -z "$ZFS_BOOTFS" ]
|
||||
then
|
||||
[ "$quiet" != "y" ] && log_begin_msg "Getting ZFS bootfs property"
|
||||
ZFS_BOOTFS=$(zpool list -H -o bootfs "$ZFS_RPOOL")
|
||||
ZFS_ERROR=$?
|
||||
[ "$quiet" != "y" ] && log_end_msg
|
||||
fi
|
||||
|
||||
if [ -z "$ZFS_BOOTFS" ]
|
||||
then
|
||||
disable_plymouth
|
||||
echo "Command: zpool list -H -o bootfs $ZFS_RPOOL"
|
||||
echo "Error: $ZFS_ERROR, unable to get the bootfs property."
|
||||
echo ""
|
||||
echo "Manually mount the root filesystem on $rootmnt and then exit."
|
||||
echo "Hint: Try: mount -t zfs -o zfsutil $ZFS_RPOOL/ROOT/system $rootmnt"
|
||||
/bin/sh
|
||||
fi
|
||||
|
||||
# Force the mountpoint to the only correct value for a root filesystem.
|
||||
[ "$quiet" != "y" ] && log_begin_msg "Setting mountpoint=/ on ZFS filesystem $ZFS_BOOTFS"
|
||||
ZFS_STDERR=$(zfs set mountpoint=/ "$ZFS_BOOTFS" 2>&1)
|
||||
[ "$quiet" != "y" ] && log_end_msg
|
||||
|
||||
# Ideally, the root filesystem would be mounted like this:
|
||||
#
|
||||
# zpool import -R "$rootmnt" -N "$ZFS_RPOOL"
|
||||
# zfs mount -o mountpoint=/ "$ZFS_BOOTFS"
|
||||
#
|
||||
# but the MOUNTPOINT prefix is preserved on descendent filesystem after
|
||||
# the pivot into the regular root, which later breaks things like
|
||||
# `zfs mount -a` and the /etc/mtab refresh.
|
||||
|
||||
[ "$quiet" != "y" ] && log_begin_msg "Mounting ZFS filesystem $ZFS_BOOTFS"
|
||||
ZFS_STDERR=$(mount -t zfs -o zfsutil "$ZFS_BOOTFS" "$rootmnt" 2>&1)
|
||||
ZFS_ERROR=$?
|
||||
[ "$quiet" != "y" ] && log_end_msg
|
||||
|
||||
if [ "$ZFS_ERROR" -ne 0 ]
|
||||
then
|
||||
disable_plymouth
|
||||
echo ""
|
||||
echo "Command: mount -t zfs -o zfsutil $ZFS_BOOTFS $rootmnt"
|
||||
echo "Message: $ZFS_STDERR"
|
||||
echo "Error: $ZFS_ERROR"
|
||||
echo ""
|
||||
echo "Manually mount the root filesystem on $rootmnt and then exit."
|
||||
/bin/sh
|
||||
fi
|
||||
|
||||
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-bottom"
|
||||
run_scripts /scripts/local-bottom
|
||||
[ "$quiet" != "y" ] && log_end_msg
|
||||
}
|
391
zfs-debian-pve/tree/zfsutils/etc/bash_completion.d/zfs
Normal file
391
zfs-debian-pve/tree/zfsutils/etc/bash_completion.d/zfs
Normal file
@ -0,0 +1,391 @@
|
||||
# Copyright (c) 2013, Aneurin Price <aneurin.price@gmail.com>
|
||||
|
||||
# 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 AUTHORS OR COPYRIGHT
|
||||
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
# OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
if [[ -w /dev/zfs ]]; then
|
||||
__ZFS_CMD="zfs"
|
||||
__ZPOOL_CMD="zpool"
|
||||
else
|
||||
__ZFS_CMD="sudo zfs"
|
||||
__ZPOOL_CMD="sudo zpool"
|
||||
fi
|
||||
|
||||
__zfs_get_commands()
|
||||
{
|
||||
$__ZFS_CMD 2>&1 | awk '/^\t[a-z]/ {print $1}' | cut -f1 -d '|' | uniq
|
||||
}
|
||||
|
||||
__zfs_get_properties()
|
||||
{
|
||||
$__ZFS_CMD get 2>&1 | awk '$2 == "YES" || $2 == "NO" {print $1}'; echo all name space
|
||||
}
|
||||
|
||||
__zfs_get_editable_properties()
|
||||
{
|
||||
$__ZFS_CMD get 2>&1 | awk '$2 == "YES" {print $1"="}'
|
||||
}
|
||||
|
||||
__zfs_get_inheritable_properties()
|
||||
{
|
||||
$__ZFS_CMD get 2>&1 | awk '$3 == "YES" {print $1}'
|
||||
}
|
||||
|
||||
__zfs_list_datasets()
|
||||
{
|
||||
$__ZFS_CMD list -H -o name -t filesystem,volume
|
||||
}
|
||||
|
||||
__zfs_list_filesystems()
|
||||
{
|
||||
$__ZFS_CMD list -H -o name -t filesystem
|
||||
}
|
||||
|
||||
__zfs_match_snapshot()
|
||||
{
|
||||
local base_dataset=${cur%@*}
|
||||
if [[ $base_dataset != $cur ]]
|
||||
then
|
||||
$__ZFS_CMD list -H -o name -s name -t snapshot -d 1 $base_dataset
|
||||
else
|
||||
$__ZFS_CMD list -H -o name -t filesystem,volume | awk '{print $1"@"}'
|
||||
fi
|
||||
}
|
||||
|
||||
__zfs_match_explicit_snapshot()
|
||||
{
|
||||
local base_dataset=${cur%@*}
|
||||
if [[ $base_dataset != $cur ]]
|
||||
then
|
||||
$__ZFS_CMD list -H -o name -s name -t snapshot -d 1 $base_dataset
|
||||
fi
|
||||
}
|
||||
|
||||
__zfs_match_multiple_snapshots()
|
||||
{
|
||||
local existing_opts=$(expr "$cur" : '\(.*\)[%,]')
|
||||
if [[ $existing_opts ]]
|
||||
then
|
||||
local base_dataset=${cur%@*}
|
||||
if [[ $base_dataset != $cur ]]
|
||||
then
|
||||
local cur=${cur##*,}
|
||||
if [[ $cur =~ ^%|%.*% ]]
|
||||
then
|
||||
# correct range syntax is start%end
|
||||
return 1
|
||||
fi
|
||||
local range_start=$(expr "$cur" : '\(.*%\)')
|
||||
$__ZFS_CMD list -H -o name -s name -t snapshot -d 1 $base_dataset | sed 's$.*@$'$range_start'$g'
|
||||
fi
|
||||
else
|
||||
__zfs_match_explicit_snapshot; __zfs_list_datasets
|
||||
fi
|
||||
}
|
||||
|
||||
__zfs_list_volumes()
|
||||
{
|
||||
$__ZFS_CMD list -H -o name -t volume
|
||||
}
|
||||
|
||||
__zfs_argument_chosen()
|
||||
{
|
||||
local word property
|
||||
for word in $(seq $((COMP_CWORD-1)) -1 2)
|
||||
do
|
||||
local prev="${COMP_WORDS[$word]}"
|
||||
if [[ ${COMP_WORDS[$word-1]} != -[tos] ]]
|
||||
then
|
||||
if [[ "$prev" == [^,]*,* ]] || [[ "$prev" == *[@:]* ]]
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
for property in $@
|
||||
do
|
||||
if [[ $prev == "$property" ]]
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
__zfs_complete_ordered_arguments()
|
||||
{
|
||||
local list1=$1
|
||||
local list2=$2
|
||||
local cur=$3
|
||||
local extra=$4
|
||||
if __zfs_argument_chosen $list1
|
||||
then
|
||||
COMPREPLY=($(compgen -W "$list2 $extra" -- "$cur"))
|
||||
else
|
||||
COMPREPLY=($(compgen -W "$list1 $extra" -- "$cur"))
|
||||
fi
|
||||
}
|
||||
|
||||
__zfs_complete_multiple_options()
|
||||
{
|
||||
local options=$1
|
||||
local cur=$2
|
||||
|
||||
COMPREPLY=($(compgen -W "$options" -- "${cur##*,}"))
|
||||
local existing_opts=$(expr "$cur" : '\(.*,\)')
|
||||
if [[ $existing_opts ]]
|
||||
then
|
||||
COMPREPLY=( "${COMPREPLY[@]/#/${existing_opts}}" )
|
||||
fi
|
||||
}
|
||||
|
||||
__zfs_complete_switch()
|
||||
{
|
||||
local options=$1
|
||||
if [[ ${cur:0:1} == - ]]
|
||||
then
|
||||
COMPREPLY=($(compgen -W "-{$options}" -- "$cur"))
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
__zfs_complete()
|
||||
{
|
||||
local cur prev cmd cmds
|
||||
COMPREPLY=()
|
||||
# Don't split on colon
|
||||
_get_comp_words_by_ref -n : -c cur -p prev -w COMP_WORDS -i COMP_CWORD
|
||||
cmd="${COMP_WORDS[1]}"
|
||||
|
||||
if [[ ${prev##*/} == zfs ]]
|
||||
then
|
||||
cmds=$(__zfs_get_commands)
|
||||
COMPREPLY=($(compgen -W "$cmds -?" -- "$cur"))
|
||||
return 0
|
||||
fi
|
||||
|
||||
case "${cmd}" in
|
||||
clone)
|
||||
case "${prev}" in
|
||||
-o)
|
||||
COMPREPLY=($(compgen -W "$(__zfs_get_editable_properties)" -- "$cur"))
|
||||
;;
|
||||
*)
|
||||
if ! __zfs_complete_switch "o,p"
|
||||
then
|
||||
if __zfs_argument_chosen
|
||||
then
|
||||
COMPREPLY=($(compgen -W "$(__zfs_list_datasets)" -- "$cur"))
|
||||
else
|
||||
COMPREPLY=($(compgen -W "$(__zfs_match_snapshot)" -- "$cur"))
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
get)
|
||||
case "${prev}" in
|
||||
-d)
|
||||
COMPREPLY=($(compgen -W "" -- "$cur"))
|
||||
;;
|
||||
-t)
|
||||
__zfs_complete_multiple_options "filesystem volume snapshot all" "$cur"
|
||||
;;
|
||||
-s)
|
||||
__zfs_complete_multiple_options "local default inherited temporary none" "$cur"
|
||||
;;
|
||||
-o)
|
||||
__zfs_complete_multiple_options "name property value source received all" "$cur"
|
||||
;;
|
||||
*)
|
||||
if ! __zfs_complete_switch "H,r,p,d,o,t,s"
|
||||
then
|
||||
if __zfs_argument_chosen $(__zfs_get_properties)
|
||||
then
|
||||
COMPREPLY=($(compgen -W "$(__zfs_match_explicit_snapshot) $(__zfs_list_datasets)" -- "$cur"))
|
||||
else
|
||||
__zfs_complete_multiple_options "$(__zfs_get_properties)" "$cur"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
inherit)
|
||||
if ! __zfs_complete_switch "r"
|
||||
then
|
||||
__zfs_complete_ordered_arguments "$(__zfs_get_inheritable_properties)" "$(__zfs_match_explicit_snapshot) $(__zfs_list_datasets)" $cur
|
||||
fi
|
||||
;;
|
||||
list)
|
||||
case "${prev}" in
|
||||
-d)
|
||||
COMPREPLY=($(compgen -W "" -- "$cur"))
|
||||
;;
|
||||
-t)
|
||||
__zfs_complete_multiple_options "filesystem volume snapshot all" "$cur"
|
||||
;;
|
||||
-o)
|
||||
__zfs_complete_multiple_options "$(__zfs_get_properties)" "$cur"
|
||||
;;
|
||||
-s|-S)
|
||||
COMPREPLY=($(compgen -W "$(__zfs_get_properties)" -- "$cur"))
|
||||
;;
|
||||
*)
|
||||
if ! __zfs_complete_switch "H,r,d,o,t,s,S"
|
||||
then
|
||||
COMPREPLY=($(compgen -W "$(__zfs_match_explicit_snapshot) $(__zfs_list_datasets)" -- "$cur"))
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
promote)
|
||||
COMPREPLY=($(compgen -W "$(__zfs_list_filesystems)" -- "$cur"))
|
||||
;;
|
||||
rollback)
|
||||
if ! __zfs_complete_switch "r,R,f"
|
||||
then
|
||||
COMPREPLY=($(compgen -W "$(__zfs_match_snapshot)" -- "$cur"))
|
||||
fi
|
||||
;;
|
||||
send)
|
||||
if ! __zfs_complete_switch "d,n,P,p,R,v,i,I"
|
||||
then
|
||||
COMPREPLY=($(compgen -W "$(__zfs_match_snapshot)" -- "$cur"))
|
||||
fi
|
||||
;;
|
||||
snapshot)
|
||||
case "${prev}" in
|
||||
-o)
|
||||
COMPREPLY=($(compgen -W "$(__zfs_get_editable_properties)" -- "$cur"))
|
||||
;;
|
||||
*)
|
||||
if ! __zfs_complete_switch "o,r"
|
||||
then
|
||||
COMPREPLY=($(compgen -W "$(__zfs_list_datasets | awk '{print $1"@"}')" -- "$cur"))
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
set)
|
||||
__zfs_complete_ordered_arguments "$(__zfs_get_editable_properties)" "$(__zfs_match_explicit_snapshot) $(__zfs_list_datasets)" $cur
|
||||
;;
|
||||
upgrade)
|
||||
case "${prev}" in
|
||||
-a|-V|-v)
|
||||
COMPREPLY=($(compgen -W "" -- "$cur"))
|
||||
;;
|
||||
*)
|
||||
if ! __zfs_complete_switch "a,V,v,r"
|
||||
then
|
||||
COMPREPLY=($(compgen -W "$(__zfs_list_filesystems)" -- "$cur"))
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
destroy)
|
||||
if ! __zfs_complete_switch "d,f,n,p,R,r,v"
|
||||
then
|
||||
__zfs_complete_multiple_options "$(__zfs_match_multiple_snapshots)" $cur
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=($(compgen -W "$(__zfs_match_explicit_snapshot) $(__zfs_list_datasets)" -- "$cur"))
|
||||
;;
|
||||
esac
|
||||
__ltrim_colon_completions "$cur"
|
||||
return 0
|
||||
}
|
||||
|
||||
__zpool_get_commands()
|
||||
{
|
||||
$__ZPOOL_CMD 2>&1 | awk '/^\t[a-z]/ {print $1}' | uniq
|
||||
}
|
||||
|
||||
__zpool_get_properties()
|
||||
{
|
||||
$__ZPOOL_CMD get 2>&1 | awk '$2 == "YES" || $2 == "NO" {print $1}'; echo all
|
||||
}
|
||||
|
||||
__zpool_get_editable_properties()
|
||||
{
|
||||
$__ZPOOL_CMD get 2>&1 | awk '$2 == "YES" {print $1"="}'
|
||||
}
|
||||
|
||||
__zpool_list_pools()
|
||||
{
|
||||
$__ZPOOL_CMD list -H -o name
|
||||
}
|
||||
|
||||
__zpool_complete()
|
||||
{
|
||||
local cur prev cmd cmds
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
cmd="${COMP_WORDS[1]}"
|
||||
|
||||
if [[ ${prev##*/} == zpool ]]
|
||||
then
|
||||
cmds=$(__zpool_get_commands)
|
||||
COMPREPLY=($(compgen -W "$cmds" -- "$cur"))
|
||||
return 0
|
||||
fi
|
||||
|
||||
case "${cmd}" in
|
||||
get)
|
||||
__zfs_complete_ordered_arguments "$(__zpool_get_properties)" "$(__zpool_list_pools)" $cur
|
||||
return 0
|
||||
;;
|
||||
import)
|
||||
if [[ $prev == -d ]]
|
||||
then
|
||||
_filedir -d
|
||||
else
|
||||
COMPREPLY=($(compgen -W "$(__zpool_list_pools) -d" -- "$cur"))
|
||||
fi
|
||||
return 0
|
||||
;;
|
||||
set)
|
||||
__zfs_complete_ordered_arguments "$(__zpool_get_editable_properties)" "$(__zpool_list_pools)" $cur
|
||||
return 0
|
||||
;;
|
||||
add|attach|clear|create|detach|offline|online|remove|replace)
|
||||
local pools="$(__zpool_list_pools)"
|
||||
if __zfs_argument_chosen $pools
|
||||
then
|
||||
_filedir
|
||||
else
|
||||
COMPREPLY=($(compgen -W "$pools" -- "$cur"))
|
||||
fi
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=($(compgen -W "$(__zpool_list_pools)" -- "$cur"))
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
}
|
||||
|
||||
complete -F __zfs_complete zfs
|
||||
complete -F __zpool_complete zpool
|
28
zfs-debian-pve/tree/zfsutils/etc/sudoers.d/zfs
Normal file
28
zfs-debian-pve/tree/zfsutils/etc/sudoers.d/zfs
Normal file
@ -0,0 +1,28 @@
|
||||
## Allow read-only ZoL commands to be called through sudo
|
||||
## without a password. Remove the first '#' column to enable.
|
||||
##
|
||||
## CAUTION: Any syntax error introduced here will break sudo.
|
||||
##
|
||||
## Cmnd alias specification
|
||||
#Cmnd_Alias C_ZFS = \
|
||||
# /sbin/zfs "", /sbin/zfs help *, \
|
||||
# /sbin/zfs get, /sbin/zfs get *, \
|
||||
# /sbin/zfs list, /sbin/zfs list *, \
|
||||
# /sbin/zpool "", /sbin/zpool help *, \
|
||||
# /sbin/zpool iostat, /sbin/zpool iostat *, \
|
||||
# /sbin/zpool list, /sbin/zpool list *, \
|
||||
# /sbin/zpool status, /sbin/zpool status *, \
|
||||
# /sbin/zpool upgrade, /sbin/zpool upgrade -v
|
||||
#
|
||||
#Runas_Alias R_ROOT = root
|
||||
#
|
||||
## User privilege specification
|
||||
#root ALL=(ALL) ALL
|
||||
#
|
||||
## Members of the admin group may gain root privileges
|
||||
#%adm ALL=(ALL) ALL # linux
|
||||
#%admin ALL=(ALL) ALL # linux
|
||||
#%staff ALL=(ALL) ALL # solaris
|
||||
#
|
||||
## allow any user to use basic read-only ZFS commands
|
||||
#ALL ALL = (R_ROOT) NOPASSWD: C_ZFS
|
14
zfs-debian-pve/tree/zfsutils/usr/lib/os-probes/10zvol-test
Executable file
14
zfs-debian-pve/tree/zfsutils/usr/lib/os-probes/10zvol-test
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
# Sub-test to exclude ZVOLs
|
||||
set -e
|
||||
partition="$1"
|
||||
|
||||
. /usr/share/os-prober/common.sh
|
||||
|
||||
if [ "$(stat -L -c %t "$partition")" = "e6" ] ; then
|
||||
debug "$1 is a ZVOL; skipping"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# No ZVOLs found
|
||||
exit 1
|
67
zfs-debian-pve/tree/zfsutils/usr/share/initramfs-tools/hooks/zdev
Executable file
67
zfs-debian-pve/tree/zfsutils/usr/share/initramfs-tools/hooks/zdev
Executable file
@ -0,0 +1,67 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Add udev rules for ZoL to the initrd.
|
||||
#
|
||||
|
||||
PREREQ="udev"
|
||||
PREREQ_UDEV_RULES="60-zvol.rules 69-vdev.rules"
|
||||
COPY_EXEC_LIST="/lib/udev/vdev_id /lib/udev/zvol_id"
|
||||
|
||||
# Generic result code.
|
||||
RC=0
|
||||
|
||||
case $1 in
|
||||
prereqs)
|
||||
echo "$PREREQ"
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
for ii in $COPY_EXEC_LIST
|
||||
do
|
||||
if [ ! -x "$ii" ]
|
||||
then
|
||||
echo "Error: $ii is not executable."
|
||||
RC=2
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$RC" -ne 0 ]
|
||||
then
|
||||
exit "$RC"
|
||||
fi
|
||||
|
||||
. /usr/share/initramfs-tools/hook-functions
|
||||
|
||||
mkdir -p "$DESTDIR/lib/udev/rules.d/"
|
||||
for ii in $PREREQ_UDEV_RULES
|
||||
do
|
||||
if [ -e "/etc/udev/rules.d/$ii" ]
|
||||
then
|
||||
cp -p "/etc/udev/rules.d/$ii" "$DESTDIR/lib/udev/rules.d/"
|
||||
elif [ -e "/lib/udev/rules.d/$ii" ]
|
||||
then
|
||||
cp -p "/lib/udev/rules.d/$ii" "$DESTDIR/lib/udev/rules.d/"
|
||||
else
|
||||
echo "Error: Missing udev rule: $ii"
|
||||
echo " This file must be in the /etc/udev/rules.d or /lib/udev/rules.d directory."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
for ii in $COPY_EXEC_LIST
|
||||
do
|
||||
copy_exec "$ii"
|
||||
done
|
||||
|
||||
if [ -f '/etc/default/zfs' -a -r '/etc/default/zfs' ]
|
||||
then
|
||||
mkdir -p "$DESTDIR/etc/default"
|
||||
cp -a '/etc/default/zfs' "$DESTDIR/etc/default/"
|
||||
fi
|
||||
|
||||
if [ -d '/etc/zfs' -a -r '/etc/zfs' ]
|
||||
then
|
||||
mkdir -p "$DESTDIR/etc"
|
||||
cp -a '/etc/zfs' "$DESTDIR/etc/"
|
||||
fi
|
88
zfs-debian-pve/zfs-dkms.dkms
Normal file
88
zfs-debian-pve/zfs-dkms.dkms
Normal file
@ -0,0 +1,88 @@
|
||||
BUILD_DEPENDS[0]="spl"
|
||||
AUTOINSTALL="yes"
|
||||
PACKAGE_NAME="zfs"
|
||||
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
|
||||
# A kpkg exception for Proxmox 2.0
|
||||
echo ${kernel_source_dir}
|
||||
fi
|
||||
;;
|
||||
(*)
|
||||
echo ${kernel_source_dir}
|
||||
;;
|
||||
esac
|
||||
)
|
||||
--with-linux-obj=${kernel_source_dir}
|
||||
--with-spl=${source_tree}/spl-${PACKAGE_VERSION}
|
||||
--with-spl-obj=${dkms_tree}/spl/${PACKAGE_VERSION}/${kernelver}/${arch}
|
||||
$(
|
||||
[[ -r /etc/default/zfs ]] \
|
||||
&& source /etc/default/zfs \
|
||||
&& shopt -q -s extglob \
|
||||
&& \
|
||||
{
|
||||
if [[ ${ZFS_DKMS_ENABLE_DEBUG,,} == @(y|yes) ]]
|
||||
then
|
||||
echo --enable-debug
|
||||
fi
|
||||
if [[ ${ZFS_DKMS_ENABLE_DEBUG_DMU_TX,,} == @(y|yes) ]]
|
||||
then
|
||||
echo --enable-debug-dmu-tx
|
||||
fi
|
||||
}
|
||||
)
|
||||
"
|
||||
POST_BUILD="cp
|
||||
${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/zfs_config.h
|
||||
${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/module/Module.symvers
|
||||
${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/${kernelver}/${arch}/
|
||||
"
|
||||
REMAKE_INITRD="$(
|
||||
if [ -e /usr/share/initramfs-tools/hooks/zfs \
|
||||
-o -e /usr/share/dracut/modules.d/90zfs ]
|
||||
then
|
||||
echo -n yes
|
||||
else
|
||||
echo -n no
|
||||
fi
|
||||
)"
|
||||
MAKE[0]="make"
|
||||
STRIP[0]="$(
|
||||
[[ -r /etc/default/zfs ]] \
|
||||
&& source /etc/default/zfs \
|
||||
&& shopt -q -s extglob \
|
||||
&& [[ ${ZFS_DKMS_DISABLE_STRIP,,} == @(y|yes) ]] \
|
||||
&& echo -n no
|
||||
)"
|
||||
STRIP[1]="${STRIP[0]}"
|
||||
STRIP[2]="${STRIP[0]}"
|
||||
STRIP[3]="${STRIP[0]}"
|
||||
STRIP[4]="${STRIP[0]}"
|
||||
STRIP[5]="${STRIP[0]}"
|
||||
BUILT_MODULE_NAME[0]="zavl"
|
||||
BUILT_MODULE_LOCATION[0]="module/avl/"
|
||||
DEST_MODULE_LOCATION[0]="/extra/zfs/zavl"
|
||||
BUILT_MODULE_NAME[1]="zcommon"
|
||||
BUILT_MODULE_LOCATION[1]="module/zcommon/"
|
||||
DEST_MODULE_LOCATION[1]="/extra/zfs/zcommon"
|
||||
BUILT_MODULE_NAME[2]="znvpair"
|
||||
BUILT_MODULE_LOCATION[2]="module/nvpair/"
|
||||
DEST_MODULE_LOCATION[2]="/extra/zfs/znvpair"
|
||||
BUILT_MODULE_NAME[3]="zpios"
|
||||
BUILT_MODULE_LOCATION[3]="module/zpios/"
|
||||
DEST_MODULE_LOCATION[3]="/extra/zfs/zpios"
|
||||
BUILT_MODULE_NAME[4]="zunicode"
|
||||
BUILT_MODULE_LOCATION[4]="module/unicode/"
|
||||
DEST_MODULE_LOCATION[4]="/extra/zfs/zunicode"
|
||||
BUILT_MODULE_NAME[5]="zfs"
|
||||
BUILT_MODULE_LOCATION[5]="module/zfs/"
|
||||
DEST_MODULE_LOCATION[5]="/extra/zfs/zfs"
|
10
zfs-debian-pve/zfs-dkms.postinst
Normal file
10
zfs-debian-pve/zfs-dkms.postinst
Normal file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
case $1 in
|
||||
(configure)
|
||||
[ -x /usr/share/update-notifier/notify-reboot-required ] \
|
||||
&& /usr/share/update-notifier/notify-reboot-required
|
||||
;;
|
||||
esac
|
||||
|
||||
#DEBHELPER#
|
3
zfs-debian-pve/zfs-dkms.prerm
Normal file
3
zfs-debian-pve/zfs-dkms.prerm
Normal file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
#DEBHELPER#
|
2
zfs-debian-pve/zfs-doc.docs
Normal file
2
zfs-debian-pve/zfs-doc.docs
Normal file
@ -0,0 +1,2 @@
|
||||
COPYRIGHT
|
||||
OPENSOLARIS.LICENSE
|
56
zfs-debian-pve/zfs-doc.examples
Normal file
56
zfs-debian-pve/zfs-doc.examples
Normal file
@ -0,0 +1,56 @@
|
||||
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
|
||||
scripts/common.sh
|
||||
scripts/zconfig.sh
|
||||
scripts/zfault.sh
|
||||
scripts/zfs.sh
|
||||
scripts/zpios-profile/zpios-profile-disk.sh
|
||||
scripts/zpios-profile/zpios-profile-pids.sh
|
||||
scripts/zpios-profile/zpios-profile-post.sh
|
||||
scripts/zpios-profile/zpios-profile-pre.sh
|
||||
scripts/zpios-profile/zpios-profile.sh
|
||||
scripts/zpios-sanity.sh
|
||||
scripts/zpios-survey.sh
|
||||
scripts/zpios-test/16th-8192rc-4rs-1cs-4off.sh
|
||||
scripts/zpios-test/1th-16rc-4rs-1cs-4off.sh
|
||||
scripts/zpios-test/1x256th-65536rc-4rs-1cs-4off.sh
|
||||
scripts/zpios-test/256th-65536rc-4rs-1cs-4off.sh
|
||||
scripts/zpios-test/4th-1024rc-4rs-1cs-4off.sh
|
||||
scripts/zpios-test/large-thread-survey.sh
|
||||
scripts/zpios-test/large.sh
|
||||
scripts/zpios-test/lustre.sh
|
||||
scripts/zpios-test/medium.sh
|
||||
scripts/zpios-test/small.sh
|
||||
scripts/zpios-test/tiny.sh
|
||||
scripts/zpios.sh
|
||||
scripts/zpool-config/dm0-raid0.sh
|
||||
scripts/zpool-config/file-raid0.sh
|
||||
scripts/zpool-config/file-raid10.sh
|
||||
scripts/zpool-config/file-raidz.sh
|
||||
scripts/zpool-config/file-raidz2.sh
|
||||
scripts/zpool-config/hda-raid0.sh
|
||||
scripts/zpool-config/lo-faulty-raid0.sh
|
||||
scripts/zpool-config/lo-faulty-raid10.sh
|
||||
scripts/zpool-config/lo-faulty-raidz.sh
|
||||
scripts/zpool-config/lo-faulty-raidz2.sh
|
||||
scripts/zpool-config/lo-faulty-raidz3.sh
|
||||
scripts/zpool-config/lo-raid0.sh
|
||||
scripts/zpool-config/lo-raid10.sh
|
||||
scripts/zpool-config/lo-raidz.sh
|
||||
scripts/zpool-config/lo-raidz2.sh
|
||||
scripts/zpool-config/md0-raid10.sh
|
||||
scripts/zpool-config/md0-raid5.sh
|
||||
scripts/zpool-config/ram0-raid0.sh
|
||||
scripts/zpool-config/scsi_debug-noraid.sh
|
||||
scripts/zpool-config/scsi_debug-raid0.sh
|
||||
scripts/zpool-config/scsi_debug-raid10.sh
|
||||
scripts/zpool-config/scsi_debug-raidz.sh
|
||||
scripts/zpool-config/scsi_debug-raidz2.sh
|
||||
scripts/zpool-config/scsi_debug-raidz3.sh
|
||||
scripts/zpool-config/sda-raid0.sh
|
||||
scripts/zpool-config/zpool-raid0.sh
|
||||
scripts/zpool-config/zpool-raid10.sh
|
||||
scripts/zpool-config/zpool-raidz.sh
|
||||
scripts/zpool-create.sh
|
1
zfs-debian-pve/zfs-doc.install
Normal file
1
zfs-debian-pve/zfs-doc.install
Normal file
@ -0,0 +1 @@
|
||||
../tree/zfs-doc/* /
|
1
zfs-debian-pve/zfs-initramfs.install
Normal file
1
zfs-debian-pve/zfs-initramfs.install
Normal file
@ -0,0 +1 @@
|
||||
../tree/zfs-initramfs/* /
|
10
zfs-debian-pve/zfs-initramfs.preinst
Normal file
10
zfs-debian-pve/zfs-initramfs.preinst
Normal file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
# @FIXME: During system start, the /etc/init/mountall.conf on Ubuntu is unable
|
||||
# to generate the /etc/mtab file from the /proc/mounts file if a ZFS filesystem
|
||||
# is already mounted.
|
||||
|
||||
# This depends on mountall 2.18, which recognizes the link.
|
||||
ln -sf /proc/mounts /etc/mtab
|
||||
|
||||
#DEBHELPER#
|
1
zfs-debian-pve/zfs-initramfs.triggers
Normal file
1
zfs-debian-pve/zfs-initramfs.triggers
Normal file
@ -0,0 +1 @@
|
||||
activate update-initramfs
|
4
zfs-debian-pve/zfsutils.install
Normal file
4
zfs-debian-pve/zfsutils.install
Normal file
@ -0,0 +1,4 @@
|
||||
../tree/zfsutils/* /
|
||||
sbin
|
||||
lib/udev
|
||||
usr/share/man
|
9
zfs-debian-pve/zfsutils.postinst
Normal file
9
zfs-debian-pve/zfsutils.postinst
Normal file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
if dpkg-maintscript-helper supports rm_conffile 2>/dev/null
|
||||
then
|
||||
dpkg-maintscript-helper rm_conffile /etc/default/zfsload -- "$@"
|
||||
dpkg-maintscript-helper rm_conffile /etc/init.d/zfs -- "$@"
|
||||
fi
|
||||
|
||||
#DEBHELPER#
|
9
zfs-debian-pve/zfsutils.postrm
Normal file
9
zfs-debian-pve/zfsutils.postrm
Normal file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
if dpkg-maintscript-helper supports rm_conffile 2>/dev/null
|
||||
then
|
||||
dpkg-maintscript-helper rm_conffile /etc/default/zfsload -- "$@"
|
||||
dpkg-maintscript-helper rm_conffile /etc/init.d/zfs -- "$@"
|
||||
fi
|
||||
|
||||
#DEBHELPER#
|
9
zfs-debian-pve/zfsutils.preinst
Normal file
9
zfs-debian-pve/zfsutils.preinst
Normal file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
if dpkg-maintscript-helper supports rm_conffile 2>/dev/null
|
||||
then
|
||||
dpkg-maintscript-helper rm_conffile /etc/default/zfsload -- "$@"
|
||||
dpkg-maintscript-helper rm_conffile /etc/init.d/zfs -- "$@"
|
||||
fi
|
||||
|
||||
#DEBHELPER#
|
1
zfs-debian-pve/zfsutils.triggers
Normal file
1
zfs-debian-pve/zfsutils.triggers
Normal file
@ -0,0 +1 @@
|
||||
activate update-initramfs
|
4
zfs-debian-pve/zfsutils.vdev.udev
Normal file
4
zfs-debian-pve/zfsutils.vdev.udev
Normal file
@ -0,0 +1,4 @@
|
||||
ENV{DEVTYPE}=="disk", IMPORT{program}="/lib/udev/vdev_id -d %k"
|
||||
KERNEL=="*[!0-9]", ENV{SUBSYSTEM}=="block", ENV{ID_VDEV}=="?*", SYMLINK+="$env{ID_VDEV_PATH}"
|
||||
KERNEL=="*[0-9]", ENV{SUBSYSTEM}=="block", ENV{DEVTYPE}=="partition", ENV{ID_VDEV}=="?*", SYMLINK+="$env{ID_VDEV_PATH}-part%n"
|
||||
KERNEL=="dm-[0-9]*", ENV{SUBSYSTEM}=="block", ENV{ID_VDEV}=="?*", SYMLINK+="$env{ID_VDEV_PATH}"
|
80
zfs-debian-pve/zfsutils.zfs-mount.init
Normal file
80
zfs-debian-pve/zfsutils.zfs-mount.init
Normal file
@ -0,0 +1,80 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: zvol zfs
|
||||
# Required-Start: $local_fs
|
||||
# Required-Stop: $local_fs
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Mount ZFS filesystems
|
||||
# Description: Run the `zfs mount -a` or `zfs umount -a` command.
|
||||
# This init script is deprecated and should be disabled in the
|
||||
# /etc/default/zfs options file. Instead, use the zfs-mount
|
||||
# package for Debian or the zfs-mountall package for Ubuntu
|
||||
### END INIT INFO
|
||||
|
||||
PATH=/sbin:/bin
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
. /lib/init/vars.sh
|
||||
|
||||
[ -f /etc/default/zfs ] && . /etc/default/zfs
|
||||
|
||||
do_start()
|
||||
{
|
||||
log_begin_msg "Mounting ZFS filesystems"
|
||||
log_progress_msg "filesystems"
|
||||
zfs mount -a
|
||||
RET=$?
|
||||
|
||||
if [ $RET != 0 ] ; then
|
||||
log_end_msg $RET
|
||||
exit $RET
|
||||
fi
|
||||
|
||||
log_end_msg 0
|
||||
}
|
||||
|
||||
do_stop()
|
||||
{
|
||||
log_begin_msg "Unmounting ZFS filesystems"
|
||||
log_progress_msg "filesystems"
|
||||
zfs unmount -a
|
||||
RET=$?
|
||||
|
||||
# Ignore a non-zero `zfs` result so that a busy ZFS instance
|
||||
# does not hang the system during shutdown.
|
||||
if [ $RET != 0 ] ; then
|
||||
log_end_msg $RET
|
||||
fi
|
||||
|
||||
log_end_msg 0
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
(start)
|
||||
case "$ZFS_MOUNT" in
|
||||
([Oo][Ff][Ff]|[Nn][Oo]|'')
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
do_start
|
||||
;;
|
||||
(stop)
|
||||
case "$ZFS_UNMOUNT" in
|
||||
([Oo][Ff][Ff]|[Nn][Oo]|'')
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
do_stop
|
||||
;;
|
||||
(force-reload|reload|restart|status)
|
||||
# no-op
|
||||
;;
|
||||
|
||||
(*)
|
||||
[ -n "$1" ] && echo "Error: Unknown command $1."
|
||||
echo "Usage: $0 {start|stop}"
|
||||
exit 3
|
||||
;;
|
||||
esac
|
80
zfs-debian-pve/zfsutils.zfs-share.init
Normal file
80
zfs-debian-pve/zfsutils.zfs-share.init
Normal file
@ -0,0 +1,80 @@
|
||||
#!/bin/sh
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: shareiscsi sharenfs sharesmb zfs-share
|
||||
# Required-Start: $local_fs $network $remote_fs
|
||||
# Required-Stop: $local_fs $network $remote_fs
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Should-Start: iscsi iscsitarget istgt nfs-kernel-server samba
|
||||
# Should-Stop: iscsi iscsitarget istgt nfs-kernel-server samba
|
||||
# Short-Description: Network share OpenZFS datasets.
|
||||
# Description: Run the `zfs share -a` or `zfs unmount -a` commands
|
||||
# for controlling iSCSI, NFS, or CIFS network shares.
|
||||
### END INIT INFO
|
||||
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
. /lib/init/vars.sh
|
||||
|
||||
[ -f /etc/default/zfs ] && . /etc/default/zfs
|
||||
|
||||
do_start()
|
||||
{
|
||||
log_begin_msg "Sharing OpenZFS filesystems"
|
||||
log_progress_msg "filesystems"
|
||||
zfs share -a
|
||||
RET=$?
|
||||
|
||||
if [ $RET != 0 ] ; then
|
||||
log_end_msg $RET
|
||||
exit $RET
|
||||
fi
|
||||
|
||||
log_end_msg 0
|
||||
}
|
||||
|
||||
do_stop()
|
||||
{
|
||||
log_begin_msg "Unsharing OpenZFS filesystems"
|
||||
log_progress_msg "filesystems"
|
||||
zfs unshare -a
|
||||
RET=$?
|
||||
|
||||
# Ignore a non-zero `zfs` result so that a busy OpenZFS instance
|
||||
# does not hang the system during shutdown.
|
||||
if [ $RET != 0 ] ; then
|
||||
log_end_msg $RET
|
||||
fi
|
||||
|
||||
log_end_msg 0
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
(start)
|
||||
case "$ZFS_SHARE" in
|
||||
([Oo][Ff][Ff]|[Nn][Oo]|'')
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
do_start
|
||||
;;
|
||||
(stop)
|
||||
case "$ZFS_UNSHARE" in
|
||||
([Oo][Ff][Ff]|[Nn][Oo]|'')
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
do_stop
|
||||
;;
|
||||
(force-reload|reload|restart|status)
|
||||
# no-op
|
||||
;;
|
||||
|
||||
(*)
|
||||
[ -n "$1" ] && echo "Error: Unknown command $1."
|
||||
echo "Usage: $0 {start|stop}"
|
||||
exit 3
|
||||
;;
|
||||
esac
|
25
zfs-debian-pve/zfsutils.zfs.default
Normal file
25
zfs-debian-pve/zfsutils.zfs.default
Normal file
@ -0,0 +1,25 @@
|
||||
# ZoL userland configuration.
|
||||
|
||||
# Wait this many seconds during system start for pool member devices to appear
|
||||
# before attempting import and starting mountall.
|
||||
ZFS_AUTOIMPORT_TIMEOUT='30'
|
||||
|
||||
# Run `zfs share -a` during system start?
|
||||
# nb: The shareiscsi, sharenfs, and sharesmb dataset properties.
|
||||
ZFS_SHARE='no'
|
||||
|
||||
# Run `zfs unshare -a` during system stop?
|
||||
ZFS_UNSHARE='no'
|
||||
|
||||
# Build kernel modules with the --enable-debug switch?
|
||||
ZFS_DKMS_ENABLE_DEBUG='no'
|
||||
|
||||
# Build kernel modules with the --enable-debug-dmu-tx switch?
|
||||
ZFS_DKMS_ENABLE_DEBUG_DMU_TX='no'
|
||||
|
||||
# Keep debugging symbols in kernel modules?
|
||||
ZFS_DKMS_DISABLE_STRIP='no'
|
||||
|
||||
# Wait for this many seconds in the initrd pre_mountroot?
|
||||
# This delays startup and should be '0' on most systems.
|
||||
ZFS_INITRD_PRE_MOUNTROOT_SLEEP='0'
|
1
zfs-debian-pve/zfsutils.zvol.udev
Normal file
1
zfs-debian-pve/zfsutils.zvol.udev
Normal file
@ -0,0 +1 @@
|
||||
KERNEL=="zd*" SUBSYSTEM=="block" ACTION=="add|change" PROGRAM="/lib/udev/zvol_id $tempnode" SYMLINK+="zvol/%c"
|
Loading…
Reference in New Issue
Block a user