diff --git a/README.md b/README.md index 5cf9144..128a3d9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # zfs-fuse ZFS is an advanced modern general-purpose filesystem from Sun Microsystems, originally designed for Solaris/OpenSolaris. - This project is a port of ZFS to the FUSE framework for the Linux operating system. diff --git a/zfs-fuse-0.7.0-glibc-tirpc.patch b/zfs-fuse-0.7.0-glibc-tirpc.patch deleted file mode 100644 index e8c7ebb..0000000 --- a/zfs-fuse-0.7.0-glibc-tirpc.patch +++ /dev/null @@ -1,78 +0,0 @@ -diff -Nru zfs-fuse-0.7.0.orig/src/cmd/zdb/SConscript zfs-fuse-0.7.0/src/cmd/zdb/SConscript ---- zfs-fuse-0.7.0.orig/src/cmd/zdb/SConscript 2011-03-09 16:22:30.000000000 +0100 -+++ zfs-fuse-0.7.0/src/cmd/zdb/SConscript 2013-01-23 15:43:06.076397514 +0100 -@@ -3,6 +3,6 @@ - objects = Split('zdb.c zdb_il.c ptrace.c #lib/libavl/libavl.a #lib/libnvpair/libnvpair-user.a #lib/libumem/libumem.a #lib/libzfs/libzfs.a #lib/libzpool/libzpool-user.a #lib/libzfscommon/libzfscommon-user.a #lib/libuutil/libuutil.a #lib/libsolcompat/libsolcompat.a') - cpppath = Split('#lib/libavl/include #lib/libnvpair/include #lib/libumem/include #lib/libzfscommon/include #lib/libzpool/include #lib/libsolcompat/include #lib/libzfs/include') - --libs = Split('rt pthread dl z m aio crypto') -+libs = Split('rt pthread dl z m aio crypto tirpc') - - env.Program('zdb', objects, CPPPATH = env['CPPPATH'] + cpppath, LIBS = libs) -diff -Nru zfs-fuse-0.7.0.orig/src/cmd/zfs/SConscript zfs-fuse-0.7.0/src/cmd/zfs/SConscript ---- zfs-fuse-0.7.0.orig/src/cmd/zfs/SConscript 2011-03-09 16:22:30.000000000 +0100 -+++ zfs-fuse-0.7.0/src/cmd/zfs/SConscript 2013-01-23 15:43:37.701072143 +0100 -@@ -3,6 +3,6 @@ - objects = Split('zfs_main.c zfs_iter.c ptrace.c #lib/libzfs/libzfs.a #lib/libzfscommon/libzfscommon-user.a #lib/libnvpair/libnvpair-user.a #lib/libumem/libumem.a #lib/libuutil/libuutil.a #lib/libavl/libavl.a #lib/libsolcompat/libsolcompat.a') - cpppath = Split('#lib/libuutil/include #lib/libnvpair/include #lib/libumem/include #lib/libzfscommon/include #lib/libzfs/include #lib/libsolcompat/include #lib/libavl/include') - --libs = Split('pthread m dl crypto') -+libs = Split('pthread m dl crypto tirpc') - - env.Program('zfs', objects, CPPPATH = env['CPPPATH'] + cpppath, LIBS = libs) -diff -Nru zfs-fuse-0.7.0.orig/src/cmd/zpool/SConscript zfs-fuse-0.7.0/src/cmd/zpool/SConscript ---- zfs-fuse-0.7.0.orig/src/cmd/zpool/SConscript 2011-03-09 16:22:30.000000000 +0100 -+++ zfs-fuse-0.7.0/src/cmd/zpool/SConscript 2013-01-23 15:43:19.454259864 +0100 -@@ -3,6 +3,6 @@ - objects = Split('zpool_iter.c zpool_main.c zpool_util.c zpool_vdev.c ptrace.c #lib/libnvpair/libnvpair-user.a #lib/libzfs/libzfs.a #lib/libumem/libumem.a #lib/libzfscommon/libzfscommon-user.a #lib/libuutil/libuutil.a #lib/libavl/libavl.a #lib/libsolcompat/libsolcompat.a ../stat/common/timestamp.c') - cpppath = Split('#lib/libuutil/include #lib/libnvpair/include #lib/libumem/include #lib/libzfscommon/include #lib/libzfs/include #lib/libsolcompat/include #lib/libavl/include ../stat/common ') - --libs = Split('pthread m dl crypto') -+libs = Split('pthread m dl crypto tirpc') - - env.Program('zpool', objects, CPPPATH = env['CPPPATH'] + cpppath, LIBS = libs) -diff -Nru zfs-fuse-0.7.0.orig/src/cmd/ztest/SConscript zfs-fuse-0.7.0/src/cmd/ztest/SConscript ---- zfs-fuse-0.7.0.orig/src/cmd/ztest/SConscript 2011-03-09 16:22:30.000000000 +0100 -+++ zfs-fuse-0.7.0/src/cmd/ztest/SConscript 2013-01-23 15:43:29.022161436 +0100 -@@ -3,7 +3,7 @@ - objects = Split('ztest.c #lib/libzpool/libzpool-user.a #lib/libzfscommon/libzfscommon-user.a #lib/libnvpair/libnvpair-user.a #lib/libavl/libavl.a #lib/libumem/libumem.a #lib/libsolcompat/libsolcompat.a') - cpppath = Split('#lib/libavl/include #lib/libnvpair/include #lib/libumem/include #lib/libzfscommon/include #lib/libzpool/include #lib/libsolcompat/include') - --libs = Split('m dl rt pthread z aio crypto') -+libs = Split('m dl rt pthread z aio crypto tirpc') - - env.Program('ztest', objects, CPPPATH = env['CPPPATH'] + cpppath, LIBS = libs) - env.Depends('ztest', '../zdb/zdb') -diff -Nru zfs-fuse-0.7.0.orig/src/zfs-fuse/SConscript zfs-fuse-0.7.0/src/zfs-fuse/SConscript ---- zfs-fuse-0.7.0.orig/src/zfs-fuse/SConscript 2011-03-09 16:22:30.000000000 +0100 -+++ zfs-fuse-0.7.0/src/zfs-fuse/SConscript 2013-01-23 15:43:48.963956263 +0100 -@@ -4,6 +4,6 @@ - cpppath = Split('#lib/libavl/include #lib/libnvpair/include #lib/libumem/include #lib/libzfscommon/include #lib/libsolkerncompat/include') - ccflags = Split('-D_KERNEL') - --libs = Split('rt pthread fuse dl z aio crypto') -+libs = Split('rt pthread fuse dl z aio crypto tirpc') - - env.Program('zfs-fuse', objects, CPPPATH = env['CPPPATH'] + cpppath, LIBS = libs, CCFLAGS = env['CCFLAGS'] + ccflags) -diff -Nru zfs-fuse-0.7.0.orig/src/zfs-fuse/wscript_build zfs-fuse-0.7.0/src/zfs-fuse/wscript_build ---- zfs-fuse-0.7.0.orig/src/zfs-fuse/wscript_build 2011-03-09 16:22:30.000000000 +0100 -+++ zfs-fuse-0.7.0/src/zfs-fuse/wscript_build 2013-01-23 15:43:58.253860685 +0100 -@@ -16,7 +16,7 @@ - includes = include_dirs, - defines = [ '_FILE_OFFSET_BITS=64', '_KERNEL'], - uselib_local = 'zpool-kernel zfscommon-kernel nvpair-kernel avl umem solkerncompat', -- uselib = 'aio_lib fuse_lib dl_lib z_lib pthread_lib rt_lib crypto', -+ uselib = 'aio_lib fuse_lib dl_lib z_lib pthread_lib rt_lib crypto tirpc', - install_path = '${PREFIX}/usr/local/sbin/', - target = 'zfs-fuse' - ) ---- zfs-fuse-0.7.0/src/cmd/zstreamdump/SConscript.orig 2013-02-25 13:03:36.402430081 +0100 -+++ zfs-fuse-0.7.0/src/cmd/zstreamdump/SConscript 2013-02-25 13:01:41.824454121 +0100 -@@ -3,6 +3,6 @@ - objects = Split('zstreamdump.c #lib/libzfs/libzfs.a #lib/libnvpair/libnvpair-user.a') - cpppath = Split('#lib/libnvpair/include #lib/libumem/include #lib/libzfscommon/include #lib/libzfs/include #lib/libsolcompat/include #lib/libzpool/include #lib/libavl/include') - --libs = Split('pthread m dl') -+libs = Split('pthread m dl tirpc') - - env.Program('zstreamdump', objects, CPPPATH = env['CPPPATH'] + cpppath, LIBS = libs) diff --git a/zfs-fuse-0.7.2.2-common.patch b/zfs-fuse-0.7.2.2-common.patch new file mode 100644 index 0000000..38463d6 --- /dev/null +++ b/zfs-fuse-0.7.2.2-common.patch @@ -0,0 +1,11 @@ +--- src/SConstruct~ 2020-01-31 09:09:01.000000000 -0600 ++++ src/SConstruct 2020-01-31 09:11:41.687083093 -0600 +@@ -30,7 +30,7 @@ + + env.CacheDir('/tmp/.zfs-fuse.scons') + env['CC'] = os.environ.setdefault("CC","gcc") +-env['CCFLAGS'] = os.environ.setdefault("CFLAGS","") ++env['CCFLAGS'] = os.environ.setdefault("CFLAGS","-fcommon") + env['LINKFLAGS'] = Split('-pipe -Wall -ltirpc') + env.Append(CCFLAGS = Split('-pipe -Wall -std=c99 -Wno-switch -Wno-unused -Wno-missing-braces -Wno-parentheses -Wno-uninitialized -Wcast-align -fno-strict-aliasing -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DTEXT_DOMAIN=\\"zfs-fuse\\" ')) + diff --git a/zfs-fuse-0.7.2.2-python3.patch b/zfs-fuse-0.7.2.2-python3.patch new file mode 100644 index 0000000..da4ed2b --- /dev/null +++ b/zfs-fuse-0.7.2.2-python3.patch @@ -0,0 +1,30 @@ +diff -up zfs-fuse-0.7.2.2/src/SConstruct.py3 zfs-fuse-0.7.2.2/src/SConstruct +--- zfs-fuse-0.7.2.2/src/SConstruct.py3 2018-01-17 11:02:43.616124442 +0100 ++++ zfs-fuse-0.7.2.2/src/SConstruct 2018-01-17 11:04:22.826712411 +0100 +@@ -57,7 +57,7 @@ else: + if not (('-DDEBUG' in env['CCFLAGS']) or + ('-DNDEBUG' in env['CCFLAGS'])): + print +- print "Misconfigured debug level: Neither DEBUG or NDEBUG appears to have been defined: %s" % env['CCFLAGS'] ++ print("Misconfigured debug level: Neither DEBUG or NDEBUG appears to have been defined: %s" % env['CCFLAGS']) + sys.exit(1) + + env['CPPPATH'] = [] +@@ -82,7 +82,7 @@ myarch = getarch(arch) + + if not myarch: + print +- print 'Sorry, only the x86, amd64 and sparc64 hardware architectures are supported' ++ print('Sorry, only the x86, amd64 and sparc64 hardware architectures are supported') + sys.exit(1) + + if myarch == 'sparc64': +@@ -131,7 +131,7 @@ env.Install(man_dir, '../doc/zstreamdump + env.Install(man_dir, '../doc/zfs-fuse.8') + + if "tags" in sys.argv: +- print "updating tags..." ++ print("updating tags...") + os.system("ctags --extra=+f `find -name '*.c'` `find -name '*.h'`") + + env.Alias('install', [install_dir, man_dir, cfg_dir]) diff --git a/zfs-fuse-0.7.2.2-stack.patch b/zfs-fuse-0.7.2.2-stack.patch new file mode 100644 index 0000000..8664d27 --- /dev/null +++ b/zfs-fuse-0.7.2.2-stack.patch @@ -0,0 +1,11 @@ +--- src/SConstruct~ 2015-11-24 10:32:31.000000000 -0600 ++++ src/SConstruct 2017-01-23 10:53:53.228548687 -0600 +@@ -32,7 +32,7 @@ + env['CC'] = os.environ.setdefault("CC","gcc") + env['CCFLAGS'] = os.environ.setdefault("CFLAGS","") + env['LINKFLAGS'] = Split('-pipe -Wall') +-env.Append(CCFLAGS = Split('-pipe -Wall -std=c99 -Wno-switch -Wno-unused -Wno-missing-braces -Wno-parentheses -Wno-uninitialized -Wcast-align -fno-strict-aliasing -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DTEXT_DOMAIN=\\"zfs-fuse\\" -O2 -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector -fstrict-volatile-bitfields --param=ssp-buffer-size=4 ')) ++env.Append(CCFLAGS = Split('-pipe -Wall -std=c99 -Wno-switch -Wno-unused -Wno-missing-braces -Wno-parentheses -Wno-uninitialized -Wcast-align -fno-strict-aliasing -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DTEXT_DOMAIN=\\"zfs-fuse\\" ')) + + if osname == "Linux": + env.Append(CPPFLAGS = " -DLINUX_AIO") diff --git a/zfs-fuse-0.7.2.2-tirpc.patch b/zfs-fuse-0.7.2.2-tirpc.patch new file mode 100644 index 0000000..4724708 --- /dev/null +++ b/zfs-fuse-0.7.2.2-tirpc.patch @@ -0,0 +1,93 @@ +--- zfs-fuse-0.7.2.2/src/SConstruct~ 2019-02-21 13:03:39.000000000 -0600 ++++ zfs-fuse-0.7.2.2.good/src/SConstruct 2019-02-21 13:04:08.580527960 -0600 +@@ -35,7 +35,7 @@ + env.Append(CCFLAGS = Split('-pipe -Wall -std=c99 -Wno-switch -Wno-unused -Wno-missing-braces -Wno-parentheses -Wno-uninitialized -Wcast-align -fno-strict-aliasing -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DTEXT_DOMAIN=\\"zfs-fuse\\" ')) + + if osname == "Linux": +- env.Append(CPPFLAGS = " -DLINUX_AIO") ++ env.Append(CPPFLAGS = " -DLINUX_AIO -I/usr/include/tirpc") + + debug = int(ARGUMENTS.get('debug', '0')) + optim = ARGUMENTS.get('optim', '-O2') +diff -r -U3 zfs-fuse-0.7.2.2/src/cmd/zfs/zfs_main.c zfs-fuse-0.7.2.2.good/src/cmd/zfs/zfs_main.c +--- zfs-fuse-0.7.2.2/src/cmd/zfs/zfs_main.c 2015-11-24 10:32:31.000000000 -0600 ++++ zfs-fuse-0.7.2.2.good/src/cmd/zfs/zfs_main.c 2019-02-21 13:38:11.861699917 -0600 +@@ -47,6 +47,7 @@ + #include + #include + #include ++#include + + #include + #include +Only in zfs-fuse-0.7.2.2.good/src/lib/libnvpair: build-kernel +Only in zfs-fuse-0.7.2.2.good/src/lib/libnvpair: build-user +diff -r -U3 zfs-fuse-0.7.2.2/src/lib/libnvpair/nvpair.c zfs-fuse-0.7.2.2.good/src/lib/libnvpair/nvpair.c +--- zfs-fuse-0.7.2.2/src/lib/libnvpair/nvpair.c 2015-11-24 10:32:31.000000000 -0600 ++++ zfs-fuse-0.7.2.2.good/src/lib/libnvpair/nvpair.c 2019-02-21 13:25:47.483941076 -0600 +@@ -31,7 +31,7 @@ + #include + #include + #include +-#include ++#include "../libsolcompat/include/rpc/xdr.h" + + #if defined(_KERNEL) && !defined(_BOOT) + #include +diff -r -U3 zfs-fuse-0.7.2.2/src/lib/libsolcompat/getmntany.c zfs-fuse-0.7.2.2.good/src/lib/libsolcompat/getmntany.c +--- zfs-fuse-0.7.2.2/src/lib/libsolcompat/getmntany.c 2015-11-24 10:32:31.000000000 -0600 ++++ zfs-fuse-0.7.2.2.good/src/lib/libsolcompat/getmntany.c 2019-02-21 13:34:53.530041172 -0600 +@@ -36,6 +36,7 @@ + #include + #include + #include ++#include + + #define BUFSIZE (MNT_LINE_MAX + 2) + +diff -r -U3 zfs-fuse-0.7.2.2/src/lib/libsolkerncompat/vfs.c zfs-fuse-0.7.2.2.good/src/lib/libsolkerncompat/vfs.c +--- zfs-fuse-0.7.2.2/src/lib/libsolkerncompat/vfs.c 2015-11-24 10:32:31.000000000 -0600 ++++ zfs-fuse-0.7.2.2.good/src/lib/libsolkerncompat/vfs.c 2019-02-21 13:39:41.902544986 -0600 +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + + struct vfs st_rootvfs = {}; + +diff -r -U3 zfs-fuse-0.7.2.2/src/lib/libsolkerncompat/vnode.c zfs-fuse-0.7.2.2.good/src/lib/libsolkerncompat/vnode.c +--- zfs-fuse-0.7.2.2/src/lib/libsolkerncompat/vnode.c 2015-11-24 10:32:31.000000000 -0600 ++++ zfs-fuse-0.7.2.2.good/src/lib/libsolkerncompat/vnode.c 2019-02-21 13:44:47.662018866 -0600 +@@ -52,6 +52,8 @@ + #include + #include + ++#include ++ + #include + #include + #include +diff -r -U3 zfs-fuse-0.7.2.2/src/SConstruct zfs-fuse-0.7.2.2.good/src/SConstruct +--- zfs-fuse-0.7.2.2/src/SConstruct 2019-02-21 13:53:53.467094730 -0600 ++++ zfs-fuse-0.7.2.2.good/src/SConstruct 2019-02-21 13:28:53.021649581 -0600 +@@ -31,7 +31,7 @@ + env.CacheDir('/tmp/.zfs-fuse.scons') + env['CC'] = os.environ.setdefault("CC","gcc") + env['CCFLAGS'] = os.environ.setdefault("CFLAGS","") +-env['LINKFLAGS'] = Split('-pipe -Wall') ++env['LINKFLAGS'] = Split('-pipe -Wall -ltirpc') + env.Append(CCFLAGS = Split('-pipe -Wall -std=c99 -Wno-switch -Wno-unused -Wno-missing-braces -Wno-parentheses -Wno-uninitialized -Wcast-align -fno-strict-aliasing -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DTEXT_DOMAIN=\\"zfs-fuse\\" ')) + + if osname == "Linux": +diff -r -U3 zfs-fuse-0.7.2.2/src/zfs-fuse/zfs_operations.c zfs-fuse-0.7.2.2.good/src/zfs-fuse/zfs_operations.c +--- zfs-fuse-0.7.2.2/src/zfs-fuse/zfs_operations.c 2015-11-24 10:32:31.000000000 -0600 ++++ zfs-fuse-0.7.2.2.good/src/zfs-fuse/zfs_operations.c 2019-02-21 13:49:44.500513196 -0600 +@@ -35,6 +35,7 @@ + #include + #include + #include ++#include + #include + #include + diff --git a/zfs-fuse-0.7.2.2-upstream-ENODATA-errors.patch b/zfs-fuse-0.7.2.2-upstream-ENODATA-errors.patch new file mode 100644 index 0000000..865b099 --- /dev/null +++ b/zfs-fuse-0.7.2.2-upstream-ENODATA-errors.patch @@ -0,0 +1,31 @@ +From 65983559eeb21659bda84fcc88c4cb59b49199cd Mon Sep 17 00:00:00 2001 +From: Your Name +Date: Sun, 10 Feb 2019 10:33:00 +0100 +Subject: [PATCH] Turn ENOATTR errors into ENODATA errrors - buildfix + +--- + src/zfs-fuse/zfs_operations.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/zfs-fuse/zfs_operations.c b/src/zfs-fuse/zfs_operations.c +index 3c5562a..c9204e5 100644 +--- a/src/zfs-fuse/zfs_operations.c ++++ b/src/zfs-fuse/zfs_operations.c +@@ -516,7 +516,7 @@ static void zfsfuse_getxattr(fuse_req_t req, fuse_ino_t ino, const char *name, + vnode_t *new_vp = NULL; + error = VOP_LOOKUP(vp, (char *) name, &new_vp, NULL, 0, NULL, &cred, NULL, NULL, NULL); + if (error) { +- error = ENOATTR; ++ error = ENODATA; + goto out; + } + VN_RELE(vp); +@@ -588,7 +588,7 @@ static void zfsfuse_removexattr(fuse_req_t req, fuse_ino_t ino, const char *name + VN_RELE(dvp); + ZFS_EXIT(zfsvfs); + if (error == ENOENT) +- error = ENOATTR; ++ error = ENODATA; + fuse_reply_err(req,error); + } + diff --git a/zfs-fuse-0.7.2.2-xattr.patch b/zfs-fuse-0.7.2.2-xattr.patch new file mode 100644 index 0000000..c29b0ca --- /dev/null +++ b/zfs-fuse-0.7.2.2-xattr.patch @@ -0,0 +1,11 @@ +--- zfs-fuse-0.7.2.2/src/zfs-fuse/zfs_operations.c.orig 2021-03-24 20:17:29.765564027 +0100 ++++ zfs-fuse-0.7.2.2/src/zfs-fuse/zfs_operations.c 2021-03-24 20:17:51.971969400 +0100 +@@ -34,7 +34,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include diff --git a/zfs-fuse-helper b/zfs-fuse-helper new file mode 100644 index 0000000..6833f24 --- /dev/null +++ b/zfs-fuse-helper @@ -0,0 +1,216 @@ +#! /bin/bash + +# Source function library. +. /etc/rc.d/init.d/functions + +prog="zfs-fuse" +exec="/usr/sbin/$prog" +config=/etc/sysconfig/$prog + +[ -e $config ] && . $config + +PIDFILE=/var/run/$prog.pid + +unset LANG +ulimit -v unlimited +ulimit -c 512000 +ulimit -l unlimited +ulimit -s unlimited + +start() { + [ -x $exec ] || (echo "$prog binary not present or executable" && exit 5) + PID=`pidofproc $prog` + start_status=$? + case "$start_status" in + 0) + echo "ZFS-FUSE is already running with pid $pid" + exit 3 + ;; + 1) + echo "Cleaning up stale $prog PID file in $PIDFILE" + rm -f "$PIDFILE" + ;; + 3) + # not running + ;; + *) + echo "Huh?" + exit 99 + esac + + if [ "$ZFS_KILL_ORPHANS" == "yes_really" ] ; then + echo -n Killing processes with unknown working directory: + for a in 1 2 3 4 5 ; do + orphans=`lsof -w -n | awk '$4 == "cwd" && $5 == "unknown" {print $2}'` + echo -n $orphans + [ "$orphans" == "" ] && break + echo -n . + kill $orphans + sleep 1 + done + orphans=`lsof -w -n | awk '$4 == "cwd" && $5 == "unknown" {print $2}'` + if [ "$orphans" != "" ] ; then + echo_failure ; echo + echo -n Some orphans still live: $orphans Killing with signal 9 + kill -9 $orphans + fi + orphans=`lsof -w -n | awk '$4 == "cwd" && $5 == "unknown" {print $2}'` + if [ "$orphans" != "" ] ; then + echo_failure ; echo + echo -n Some orphans still live: $orphans + echo_failure ; echo + exit 8 + fi + echo_success ; echo + fi + + echo -n $"Starting $prog: " + daemon $exec -p "$PIDFILE" + exec_retval=$? + echo + [ $exec_retval -ne 0 ] && return $exec_retval + + for a in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ; do + PID=`pidofproc $prog` + [ "$PID" != "" ] && break + echo -n "." + sleep 1 + done + + if [ "$PID" = "" ] ; then + echo "ZFS-FUSE did not start or create $PIDFILE" + exit 3 + fi + + echo -n "Immunizing $prog against OOM kills" + echo -17 > "/proc/$PID/oom_score_adj" + ES_TO_REPORT=$? + if [ "$ES_TO_REPORT" -ne 0 ] ; then + echo_warning + echo "code $ES_TO_REPORT" + exit 3 + fi + echo_success + echo + + if [ "$ZFS_AUTOMOUNT" == "1" ] ; then + echo "Deprecated use of ZFS_AUTOMOUNT option. Use ZFS_AUTOMOUNT=yes instead." + ZFS_AUTOMOUNT=yes + fi + + if [ "$ZFS_AUTOMOUNT" == "yes" ] ; then + echo -n $"Mounting zfs partitions: " + sleep 1 + rm -f /var/lib/random-seed + zfs mount -a + zfs_mount_retval=$? + if [ $zfs_mount_retval = 0 ]; then + echo_success + else + echo_warning + echo zfs mount failed with code $zfs_mount_retval + fi + echo + fi + + +# if [ -x /nonexistent -a -x /usr/bin/renice ] ; then # DISABLED +# log_action_begin_msg "Increasing ZFS-FUSE priority" +# /usr/bin/renice -15 -g $PID > /dev/null +# ES_TO_REPORT=$? +# if [ 0 = "$ES_TO_REPORT" ] ; then +# log_action_end_msg 0 +# else +# log_action_end_msg 1 "code $ES_TO_REPORT" +# exit 3 +# fi +# true +# fi + + + return $exec_retval +} + +stop() { + status_quiet || return 0 + [ -x $exec ] || (echo "$prog binary not present or executable" && exit 5) + PID=`pidofproc $prog` + if [ "$PID" != "" ] ; then + echo -n "Syncing disks" + sync + echo_success + echo + + echo -n "Unmounting ZFS filesystems" + zfs unmount -a + ES_TO_REPORT=$? + if [ 0 = "$ES_TO_REPORT" ] ; then + echo_success + else + echo_warning + fi + echo + fi + + echo -n $"Stopping $prog: " + killproc $prog + kill_retval=$? + echo + + if [ "$PID" != "" ] ; then + echo -n "Syncing disks again" + sync + echo_success + echo + fi + + return $kill_retval +} + +restart() { + stop + start +} + +pool_status() { + # run checks to determine if the service is running or use generic status + status $prog && /usr/sbin/zpool status +} + +pool_status_quiet() { + pool_status >/dev/null 2>&1 +} + +status_quiet() { + status $prog >/dev/null 2>&1 +} + +case "$1" in + start) + status_quiet && exit 0 + $1 + ;; + stop) + $1 + ;; +# restart) +# restart +# ;; +# reload) +# restart +# ;; +# force-reload) +# restart +# ;; +# status) +# pool_status +# ;; +# condrestart|try-restart) +# pool_status_quiet || exit 0 +# restart +# ;; + *) +# echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" + exit 2 +esac +exit $? diff --git a/zfs-fuse-initscript b/zfs-fuse-initscript deleted file mode 100644 index 7ee368a..0000000 --- a/zfs-fuse-initscript +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh -# -# zfs-fuse Filesystem in the Userspace port of Solaris' ZFS -# -# chkconfig: 345 90 10 -# description: A port of ZFS to the FUSE framework for the Linux operating system -# -# Copyright (c) 2007 by Stefano Cotta Ramusino - -. /etc/sysconfig/rc -. $rc_functions - -NAME=zfs-fuse -DAEMON=/usr/sbin/$NAME -DAEMONPID=/var/run/$NAME.pid -LOCKFILE=/var/lock/subsys/$NAME - -[ -x $DAEMON ] || exit 0 - -running() { - status $NAME > /dev/null -} - -# See how we were called. -case "$1" in - start) - if ! running; then - echo -n $"Starting $NAME daemon: " - daemon --pidfile=$DAEMONPID $DAEMON -p $DAEMONPID - [ $? -eq 0 ] && touch $LOCKFILE - else - echo -n $"Service $NAME already running." - fi - echo - ;; - stop) - if running; then - echo -n $"Shutting down $NAME daemon: " - killproc -p $DAEMONPID $DAEMON - [ $? -eq 0 ] && rm -f $LOCKFILE $DAEMONPID - else - echo -n $"Service $NAME not running." - fi - echo - ;; - restart) - $0 stop - $0 start - ;; - condstop) - [ -e $LOCKFILE ] && $0 stop || : - ;; - condrestart) - [ -e $LOCKFILE ] && $0 restart || : - ;; - status) - status $NAME - ;; - *) - echo $"Usage: $0 {start|stop|restart|condstop|condrestart|status}" - exit 1 - ;; -esac - -: diff --git a/zfs-fuse.service b/zfs-fuse.service new file mode 100644 index 0000000..b5a5eee --- /dev/null +++ b/zfs-fuse.service @@ -0,0 +1,12 @@ +[Unit] +Description=zfs-fuse daemon +After=syslog.target + +[Service] +Type=forking +PrivateTmp=False +ExecStart=/usr/sbin/zfs-fuse-helper start +ExecStop=/usr/sbin/zfs-fuse-helper stop + +[Install] +WantedBy=multi-user.target diff --git a/zfs-fuse.spec b/zfs-fuse.spec index e54e254..313c4e9 100644 --- a/zfs-fuse.spec +++ b/zfs-fuse.spec @@ -1,68 +1,78 @@ Name: zfs-fuse Epoch: 1 -Version: 0.7.0 +Version: 0.7.2.2 Release: 1mamba Summary: ZFS Filesystem for FUSE/Linux Group: System/Kernel and Hardware/Drivers Vendor: openmamba Distribution: openmamba Packager: Stefano Cotta Ramusino -URL: http://zfs-fuse.net/ -## To get zfs-fuse: -## hg clone http://www.wizy.org/mercurial/zfs-fuse/trunk -## mv trunk zfs-fuse -## tar jcvf zfs-fuse-hg`date '+%Y%m%d'`.tar.bz2 zfs-fuse -#Source: http://download.berlios.de/zfs-fuse/zfs-fuse-%{version}.tar.bz2 -#Source: http://zfs-fuse.net/releases/%{version}/zfs-fuse-%{version}.tar.bz2 -Source: http://fossies.org/linux/misc/zfs-fuse-%{version}.tar.xz -#Source: http://zfs-fuse.net/releases/%{version}/zfs-fuse-%{version}.tar.bz2 -Source1: %{name}-initscript +URL: https://github.com/gordan-bobic/zfs-fuse +Source: https://github.com/gordan-bobic/zfs-fuse.git/%{version}/zfs-fuse-%{version}.tar.bz2 +Source1: zfs-fuse.service +Source2: zfs-fuse-helper +Source3: zfs-fuse.sysconfig Patch: %{name}-0.4.0_beta1-SConstruct.patch Patch1: %{name}-0.5.0-gcc43.patch Patch2: %{name}-0.5.0-gcc44.patch Patch3: zfs-fuse-0.7.0-glibc-2.14.patch -Patch4: zfs-fuse-0.7.0-glibc-tirpc.patch +Patch4: zfs-fuse-0.7.2.2-stack.patch +Patch5: zfs-fuse-0.7.2.2-python3.patch +Patch6: zfs-fuse-0.7.2.2-tirpc.patch +Patch7: zfs-fuse-0.7.2.2-common.patch +Patch8: zfs-fuse-0.7.2.2-upstream-ENODATA-errors.patch +Patch9: zfs-fuse-0.7.2.2-xattr.patch License: Common Development and Distribution License ## AUTOBUILDREQ-BEGIN BuildRequires: glibc-devel BuildRequires: libaio-devel +BuildRequires: libbzip2-devel BuildRequires: libfuse-devel +BuildRequires: liblzma-devel +BuildRequires: liblzo-devel +BuildRequires: libopenssl-devel +BuildRequires: libtirpc-devel BuildRequires: libz-devel +BuildRequires: perl-devel ## AUTOBUILDREQ-END BuildRequires: scons -BuildRoot: %{_tmppath}/%{name}-%{version}-root %description ZFS is an advanced modern general-purpose filesystem from Sun Microsystems, originally designed for Solaris/OpenSolaris. - This project is a port of ZFS to the FUSE framework for the Linux operating system. +%debug_package + %prep %setup -q -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -#sed -i -e "s,-O2,%{optflags}," src/SConstruct +#%patch1 -p1 +#%patch2 -p1 +#%patch3 -p1 +%patch4 -p0 +%patch5 -p1 +%patch6 -p1 +%patch7 -p0 +%patch8 -p1 +%patch9 -p1 %build cd src -scons \ - debug=0 \ - optim="%{optflags} -ltirpc" +export CCFLAGS="%{optflags}" +scons debug=2 optim='%{optflags}' %install [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" pushd src scons install \ - debug=0 \ + debug=1 \ install_dir=%{buildroot}%{_sbindir} \ man_dir=%{buildroot}%{_mandir}/man8 \ cfg_dir=%{buildroot}%{_sysconfdir}/zfs popd -install -D -m 0755 %{S:1} \ - %{buildroot}%{_initrddir}/%{name} +install -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/zfs-fuse.service +install -D -m 0755 %{SOURCE2} %{buildroot}%{_sbindir}/zfs-fuse-helper +install -D -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/zfs-fuse # remove unpackaged files rm -f %{buildroot}%{_sbindir}/.sconsign @@ -71,47 +81,41 @@ rm -f %{buildroot}%{_sbindir}/.sconsign [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" %post -# new install -if [ $1 -eq 1 ]; then - /sbin/chkconfig --add %{name} - service %{name} start -fi +%systemd_post zfs-fuse : %preun -# erase -if [ $1 -eq 0 ]; then - service %{name} condstop - /sbin/chkconfig --del %{name} -fi +%systemd_preun zfs-fuse : %postun -# upgrade -if [ $1 -eq 1 ]; then - service %{name} condrestart -fi +%systemd_postun_with_restart zfs-fuse : %files %defattr(-,root,root) +%config(noreplace) %{_sysconfdir}/sysconfig/zfs-fuse %{_sysconfdir}/zfs/zfs_pool_alert -%{_initrddir}/%{name} +%{_sbindir}/mount.zfs %{_sbindir}/zdb %{_sbindir}/zfs %{_sbindir}/zfs-fuse +%{_sbindir}/zfs-fuse-helper %{_sbindir}/zpool %{_sbindir}/zstreamdump %{_sbindir}/ztest +%{_unitdir}/zfs-fuse.service %{_mandir}/man8/zdb.8* %{_mandir}/man8/zfs-fuse.8* %{_mandir}/man8/zfs.8* %{_mandir}/man8/zpool.8* %{_mandir}/man8/zstreamdump.8* %doc LICENSE -#BUGS CHANGES HACKING README STATUS TESTING TODO %changelog +* Wed Mar 24 2021 Silvan Calarco 0.7.2.2-1mamba +- update to 0.7.2.2 + * Wed Aug 15 2012 Automatic Build System 0.7.0-1mamba - automatic version update by autodist diff --git a/zfs-fuse.sysconfig b/zfs-fuse.sysconfig new file mode 100644 index 0000000..eff8988 --- /dev/null +++ b/zfs-fuse.sysconfig @@ -0,0 +1,9 @@ +# Set this option to yes if you want all ZFS filesystems to be mounted on boot. +ZFS_AUTOMOUNT=yes + +# Set this option to yes to enable weekly scrubbing of your ZFS pools. +ZFS_WEEKLY_SCRUB=no + +# Set this option to yes_really to kill all processes with unknown working directory at zfs-fuse startup +# Use with extreme care. This will also kill processes totally unrelated to zfs-fuse. +# ZFS_KILL_ORPHANS=no|yes_really