-
-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create LD preload to reopen files on underlying filesystem
- Loading branch information
Showing
10 changed files
with
548 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
ISC License | ||
|
||
Copyright (c) 2023, Antonio SJ Musumeci <[email protected]> | ||
Copyright (c) 2024, Antonio SJ Musumeci <[email protected]> | ||
|
||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted, provided that the above | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Copyright (c) 2016, Antonio SJ Musumeci <[email protected]> | ||
# Copyright (c) 2024, Antonio SJ Musumeci <[email protected]> | ||
# | ||
# Permission to use, copy, modify, and/or distribute this software for any | ||
# purpose with or without fee is hereby granted, provided that the above | ||
|
@@ -26,7 +26,7 @@ STRIP = strip | |
PANDOC = pandoc | ||
SED = sed | ||
RPMBUILD = rpmbuild | ||
GIT2DEBCL = ./tools/git2debcl | ||
GIT2DEBCL = ./buildtools/git2debcl | ||
PKGCONFIG = pkg-config | ||
|
||
GIT_REPO = 0 | ||
|
@@ -68,6 +68,10 @@ TESTS_DEPS = $(TESTS:tests/%.cpp=build/.tests/%.d) | |
TESTS_DEPS += $(DEPS) | ||
|
||
MANPAGE = mergerfs.1 | ||
CFLAGS ?= ${OPT_FLAGS} | ||
CFLAGS := ${CFLAGS} \ | ||
-Wall \ | ||
-Wno-unused-result | ||
CXXFLAGS ?= ${OPT_FLAGS} | ||
CXXFLAGS := \ | ||
${CXXFLAGS} \ | ||
|
@@ -92,18 +96,21 @@ LDFLAGS := \ | |
-pthread \ | ||
-lrt | ||
|
||
# https://www.gnu.org/prep/standards/html_node/Directory-Variables.html | ||
DESTDIR = | ||
PREFIX = /usr/local | ||
EXEC_PREFIX = $(PREFIX) | ||
DATAROOTDIR = $(PREFIX)/share | ||
DATADIR = $(DATAROOTDIR) | ||
BINDIR = $(EXEC_PREFIX)/bin | ||
SBINDIR = $(EXEC_PREFIX)/sbin | ||
LIBDIR = $(EXEC_PREFIX)/lib | ||
MANDIR = $(DATAROOTDIR)/man | ||
MAN1DIR = $(MANDIR)/man1 | ||
|
||
INSTALLBINDIR = $(DESTDIR)$(BINDIR) | ||
INSTALLSBINDIR = $(DESTDIR)$(SBINDIR) | ||
INSTALLLIBDIR = $(DESTDIR)$(LIBDIR)/mergerfs | ||
INSTALLMAN1DIR = $(DESTDIR)$(MAN1DIR) | ||
|
||
.PHONY: all | ||
|
@@ -141,7 +148,7 @@ endif | |
|
||
.PHONY: version | ||
version: | ||
tools/update-version | ||
./buildtools/update-version | ||
|
||
build/stamp: | ||
$(MKDIR) -p build/.src build/.tests | ||
|
@@ -153,6 +160,10 @@ build/.src/%.o: src/%.cpp | |
build/.tests/%.o: tests/%.cpp | ||
$(CXX) $(CXXFLAGS) $(TESTS_FLAGS) $(FUSE_FLAGS) $(MFS_FLAGS) $(CPPFLAGS) -c $< -o $@ | ||
|
||
build/preload.so: build/stamp tools/preload.c | ||
$(CC) -shared -fPIC $(CFLAGS) $(CPPFLAGS) -o $@ tools/preload.c | ||
|
||
preload: build/preload.so | ||
|
||
.PHONY: clean | ||
clean: rpm-clean | ||
|
@@ -166,7 +177,7 @@ ifeq ($(GIT_REPO),1) | |
endif | ||
|
||
.PHONY: install | ||
install: install-base install-mount-tools install-man | ||
install: install-base install-mount-tools install-preload install-man | ||
|
||
install-base: build/mergerfs | ||
$(MKDIR) -p "$(INSTALLBINDIR)" | ||
|
@@ -180,6 +191,10 @@ install-man: $(MANPAGE) | |
$(MKDIR) -p "$(INSTALLMAN1DIR)" | ||
$(INSTALL) -v -m 0644 "man/$(MANPAGE)" "$(INSTALLMAN1DIR)/$(MANPAGE)" | ||
|
||
install-preload: preload | ||
$(MKDIR) -p "$(INSTALLLIBDIR)" | ||
$(INSTALL) -v -m 444 "build/preload.so" "$(INSTALLLIBDIR)/preload.so" | ||
|
||
install-strip: install-base | ||
$(STRIP) "$(INSTALLBINDIR)/mergerfs" | ||
|
||
|
@@ -225,14 +240,14 @@ endif | |
signed-deb: | ||
$(MAKE) distclean | ||
$(MAKE) debian-changelog | ||
dpkg-source -b . | ||
dpkg-buildpackage -nc | ||
# dpkg-source -b . | ||
dpkg-buildpackage --build=binary -nc | ||
|
||
deb: | ||
$(MAKE) distclean | ||
$(MAKE) debian-changelog | ||
dpkg-source -b . | ||
dpkg-buildpackage -nc -uc -us | ||
# dpkg-source -b . | ||
dpkg-buildpackage --build=binary -nc -uc -us | ||
|
||
.PHONY: rpm-clean | ||
rpm-clean: | ||
|
@@ -250,7 +265,7 @@ rpm: tarball | |
|
||
.PHONY: install-build-pkgs | ||
install-build-pkgs: | ||
tools/install-build-pkgs | ||
./buildtools/install-build-pkgs | ||
|
||
.PHONY: libfuse | ||
libfuse: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.