Skip to content

Commit

Permalink
Merge pull request #415 from trapexit/static
Browse files Browse the repository at this point in the history
add libfuse 2.9.7 to repo and build against libfuse.a
  • Loading branch information
trapexit authored Jun 2, 2017
2 parents 986f230 + de0985c commit a7cddef
Show file tree
Hide file tree
Showing 145 changed files with 44,125 additions and 90 deletions.
18 changes: 5 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,27 @@ matrix:
- os: linux
dist: precise
compiler: gcc
sudo: false
sudo: required
- os: linux
dist: precise
compiler: clang
sudo: false
sudo: required
- os: linux
dist: trusty
compiler: gcc
sudo: false
sudo: required
- os: linux
dist: trusty
compiler: clang
sudo: false
sudo: required
- os: osx
compiler: clang

addons:
apt:
packages:
- pkg-config
- debhelper
- libfuse-dev
- libattr1-dev
- python

before_script:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew tap caskroom/cask; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew cask install osxfuse; fi

script:
- sudo -E make install-build-pkgs
- make
74 changes: 37 additions & 37 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.


PKGCONFIG = $(shell which pkg-config)
GIT = $(shell which git)
TAR = $(shell which tar)
MKDIR = $(shell which mkdir)
Expand All @@ -30,35 +28,13 @@ SED = $(shell which sed)
GZIP = $(shell which gzip)
RPMBUILD = $(shell which rpmbuild)
GIT2DEBCL = ./tools/git2debcl
CPPFIND = ./tools/cppfind

ifeq ($(PKGCONFIG),"")
$(error "pkg-config not installed")
endif

ifeq ($(PANDOC),"")
$(warning "pandoc does not appear available: manpage won't be buildable")
endif

XATTR_AVAILABLE = $(shell test ! -e /usr/include/attr/xattr.h; echo $$?)

FUSE_AVAILABLE = $(shell ! pkg-config --exists fuse; echo $$?)

ifeq ($(FUSE_AVAILABLE),0)
FUSE_AVAILABLE = $(shell test ! -e /usr/include/fuse.h; echo $$?)
endif

ifeq ($(FUSE_AVAILABLE),0)
$(error "FUSE development package doesn't appear available")
endif

FLAG_NOPATH = $(shell $(CPPFIND) "flag_nopath")
FLAG_UTIME = $(shell $(CPPFIND) "flag_utime_omit_ok")
FALLOCATE = $(shell $(CPPFIND) "fuse_fs_fallocate")
FLOCK = $(shell $(CPPFIND) "fuse_fs_flock")
READ_BUF = $(shell $(CPPFIND) "fuse_fs_read_buf")
WRITE_BUF = $(shell $(CPPFIND) "fuse_fs_write_buf")

UGID_USE_RWLOCK = 0

OPTS = -O2
Expand All @@ -67,21 +43,15 @@ OBJ = $(SRC:src/%.cpp=obj/%.o)
DEPS = $(OBJ:obj/%.o=obj/%.d)
TARGET = mergerfs
MANPAGE = $(TARGET).1
FUSE_CFLAGS = $(shell $(PKGCONFIG) --cflags fuse)
FUSE_CFLAGS = -D_FILE_OFFSET_BITS=64 -Ilibfuse/include
CFLAGS = -g -Wall \
$(OPTS) \
-Wno-unused-result \
$(FUSE_CFLAGS) \
-DFUSE_USE_VERSION=29 \
-MMD \
-DFLAG_NOPATH=$(FLAG_NOPATH) \
-DFLAG_UTIME=$(FLAG_UTIME) \
-DFALLOCATE=$(FALLOCATE) \
-DFLOCK=$(FLOCK) \
-DREAD_BUF=$(READ_BUF) \
-DWRITE_BUF=$(WRITE_BUF) \
-DUGID_USE_RWLOCK=$(UGID_USE_RWLOCK)
LDFLAGS = $(shell $(PKGCONFIG) fuse --libs)
LDFLAGS = -pthread -lrt

PREFIX = /usr/local
EXEC_PREFIX = $(PREFIX)
Expand All @@ -107,8 +77,9 @@ help:
@echo "usage: make"
@echo "make XATTR_AVAILABLE=0 - to build program without xattrs functionality (auto discovered otherwise)"

$(TARGET): src/version.hpp obj/obj-stamp $(OBJ)
$(CXX) $(CFLAGS) $(OBJ) -o $@ $(LDFLAGS)
$(TARGET): src/version.hpp obj/obj-stamp libfuse/lib/.libs/libfuse.a $(OBJ)
cd libfuse && make
$(CXX) $(CFLAGS) $(OBJ) -o $@ libfuse/lib/.libs/libfuse.a -ldl $(LDFLAGS)

mount.mergerfs: $(TARGET)
$(LN) -fs "$<" "$@"
Expand All @@ -133,7 +104,7 @@ obj/obj-stamp:
obj/%.o: src/%.cpp
$(CXX) $(CFLAGS) -c $< -o $@

clean: rpm-clean
clean: rpm-clean libfuse_Makefile
ifneq ($(GIT),)
ifeq ($(shell test -e .git; echo $$?),0)
$(RM) -f src/version.hpp
Expand All @@ -143,7 +114,10 @@ endif
$(RM) -f "$(TARGET)" mount.mergerfs
$(FIND) . -name "*~" -delete

distclean: clean
cd libfuse && $(MAKE) clean

distclean: clean libfuse_Makefile
cd libfuse && $(MAKE) distclean
$(GIT) clean -fd

install: install-base install-mount.mergerfs install-man
Expand Down Expand Up @@ -213,6 +187,32 @@ rpm: tarball
$(RPMBUILD) -ba rpmbuild/SOURCES/$(TARGET).spec \
--define "_topdir $(CURDIR)/rpmbuild"

install-build-pkgs:
ifeq ($(shell test -e /usr/bin/apt-get; echo $$?),0)
apt-get -qy update
apt-get -qy --no-install-suggests --no-install-recommends --force-yes \
install build-essential git g++ debhelper libattr1-dev python automake libtool lsb-release
else ifeq ($(shell test -e /usr/bin/dnf; echo $$?),0)
dnf -y update
dnf -y install git rpm-build libattr-devel gcc-c++ make which python automake libtool gettext-devel
else ifeq ($(shell test -e /usr/bin/yum; echo $$?),0)
yum -y update
yum -y install git rpm-build libattr-devel gcc-c++ make which python automake libtool gettext-devel
endif

unexport CFLAGS LDFLAGS
.PHONY: libfuse_Makefile
libfuse_Makefile:
ifeq ($(shell test -e libfuse/Makefile; echo $$?),1)
cd libfuse && \
$(MKDIR) -p m4 && \
autoreconf --force --install && \
./configure --enable-lib --disable-util --disable-example
endif

libfuse/lib/.libs/libfuse.a: libfuse_Makefile
cd libfuse && $(MAKE)

.PHONY: all clean install help

include $(wildcard obj/*.d)
-include $(DEPS)
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,29 +225,32 @@ $ wget https://github.com/trapexit/mergerfs/releases/download/<ver>/mergerfs-<ve

#### Debian / Ubuntu
```
$ sudo apt-get install g++ pkg-config git git-buildpackage pandoc debhelper libfuse-dev libattr1-dev python
$ sudo apt-get -y update
$ sudo apt-get -y install git make
$ cd mergerfs
$ make install-build-pkgs
$ make deb
$ sudo dpkg -i ../mergerfs_version_arch.deb
```

#### Fedora
```
$ su -
# dnf install rpm-build fuse-devel libattr-devel pandoc gcc-c++ git make which python
# dnf -y update
# dnf -y install git make
# cd mergerfs
# make install-build-pkgs
# make rpm
# rpm -i rpmbuild/RPMS/<arch>/mergerfs-<verion>.<arch>.rpm
```

#### Generically

Have git, python, pkg-config, pandoc, libfuse, libattr1 installed.
Have git, g++, make, python, libattr1, automake, libtool installed.

```
$ cd mergerfs
$ make
$ make man
$ sudo make install
```

Expand Down Expand Up @@ -366,7 +369,7 @@ A B C

# TIPS / NOTES

* The recommended options are **defaults,allow_other,direct_io,use_ino**.
* The recommended options are **defaults,allow_other,direct_io,use_ino**. (**use_ino** will only work when used with mergerfs 2.18.0 and above.)
* Run mergerfs as `root` unless you're merging paths which are owned by the same user otherwise strange permission issues may arise.
* https://github.com/trapexit/backup-and-recovery-howtos : A set of guides / howtos on creating a data storage system, backing it up, maintaining it, and recovering from failure.
* If you don't see some directories and files you expect in a merged point or policies seem to skip drives be sure the user has permission to all the underlying directories. Use `mergerfs.fsck` to audit the drive for out of sync permissions.
Expand Down Expand Up @@ -440,6 +443,8 @@ The gid cache uses fixed storage to simplify the design and be compatible with o

#### mergerfs or libfuse crashing

**NOTE:** as of mergerfs 2.22.0 it includes the most recent version of libfuse so any crash should be reported. For older releases continue reading...

If suddenly the mergerfs mount point disappears and `Transport endpoint is not connected` is returned when attempting to perform actions within the mount directory **and** the version of libfuse (use `mergerfs -v` to find the version) is older than `2.9.4` its likely due to a bug in libfuse. Affected versions of libfuse can be found in Debian Wheezy, Ubuntu Precise and others.

In order to fix this please install newer versions of libfuse. If using a Debian based distro (Debian,Ubuntu,Mint) you can likely just install newer versions of [libfuse](https://packages.debian.org/unstable/libfuse2) and [fuse](https://packages.debian.org/unstable/fuse) from the repo of a newer release.
Expand Down
7 changes: 2 additions & 5 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@ Section: utils
Priority: optional
Maintainer: Antonio SJ Musumeci <trapexit@spawn.link>
Build-Depends: debhelper (>= 8.0.0),
libfuse-dev,
libattr1-dev,
pkg-config
libattr1-dev
Standards-Version: 3.9.4
Homepage: http://github.com/trapexit/mergerfs

Package: mergerfs
Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends},
libfuse2
${misc:Depends}
Description: another FUSE union filesystem
mergerfs is similar to mhddfs, unionfs, and aufs. Like mhddfs in that it too
uses FUSE. Like aufs in that it provides multiple policies for how to handle
Expand Down
59 changes: 59 additions & 0 deletions libfuse/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
Current Maintainer
------------------

Nikolaus Rath <Nikolaus@rath.org>


Past Maintainers
----------------

Miklos Szeredi <miklos@szeredi.hu> (until 12/2015)


Contributors
------------

CUSE has been written by Tejun Heo <teheo@suse.de>. Furthermore, the
following people have contributed patches (autogenerated list):

Anatol Pomozov <anatol.pomozov@gmail.com>
Antonio SJ Musumeci <trapexit@spawn.link>
Christopher Harrison <ch12@sanger.ac.uk>
Csaba Henk <csaba.henk@creo.hu>
cvs2git <>
Dalvik Khertel <khertel@outlook.com>
Daniel Thau <danthau@bedrocklinux.org>
David McNab <david@rebirthing.co.nz>
David Sheets <sheets@alum.mit.edu>
Emmanuel Dreyfus <manu@netbsd.org>
Enke Chen <enkechen@yahoo.com>
Eric Engestrom <eric@engestrom.ch>
Eric Wong <normalperson@yhbt.net>
Fabrice Bauzac <fbauzac@amadeus.com>
Feng Shuo <steve.shuo.feng@gmail.com>
Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Ikey Doherty <michael.i.doherty@intel.com>
Jan Blumschein <jan@jan-blumschein.de>
Joachim Schiele <joachim.schiele@daimler.com>
Joachim Schiele <js@lastlog.de>
John Muir <john@jmuir.com>
Laszlo Papp <ext-laszlo.papp@nokia.com>
Madan Valluri <mvalluri@cumulus-systems.com>
Mark Glines <mark@glines.org>
Max Krasnyansky <maxk@kernel.org>
Michael Grigoriev <mag@luminal.org>
Miklos Szeredi <miklos@szeredi.hu>
Miklos Szeredi <mszeredi@suse.cz>
mkmm@gmx-topmail.de <mkmm@gmx-topmail.de>
Natanael Copa <ncopa@alpinelinux.org>
Nikolaus Rath <Nikolaus@rath.org>
Olivier Blin <olivier.blin@softathome.com>
Ratna_Bolla@dell.com <Ratna_Bolla@dell.com>
Reuben Hawkins <reubenhwk@gmail.com>
Richard W.M. Jones <rjones@redhat.com>
Riku Voipio <riku.voipio@linaro.org>
Roland Bauerschmidt <rb@debian.org>
Sam Stuewe <halosghost@archlinux.info>
Sebastian Pipping <sebastian@pipping.org>
therealneworld@gmail.com <therealneworld@gmail.com>
Winfried Koehler <w_scan@gmx-topmail.de>
Loading

0 comments on commit a7cddef

Please sign in to comment.