mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-29 18:15:13 +08:00
🌴 Sync 2026-03-05 23:51:42
This commit is contained in:
1 parent
97c049ed0a
commit
0acff03804
14253 files changed
+3893239
No files matched your search
@@ -0,0 +1,56 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=mergerfs
|
||||
PKG_VERSION:=2.40.2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/trapexit/mergerfs/releases/download/$(PKG_VERSION)/
|
||||
PKG_HASH:=skip
|
||||
|
||||
PKG_MAINTAINER:=jjm2473 <jjm2473@gmail.com>
|
||||
PKG_LICENSE:=ISC
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/mergerfs
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Filesystem
|
||||
TITLE:=A featureful union filesystem
|
||||
URL:=https://github.com/trapexit/mergerfs
|
||||
DEPENDS:=+libstdcpp
|
||||
endef
|
||||
|
||||
define Package/mergerfs/description
|
||||
mergerfs is a FUSE based union filesystem geared towards simplifying
|
||||
storage and management of files across numerous commodity storage
|
||||
devices. It is similar to mhddfs, unionfs, and aufs.
|
||||
endef
|
||||
|
||||
define Package/mergerfs/conffiles
|
||||
/etc/config/mergerfs
|
||||
endef
|
||||
|
||||
define Package/mergerfs/install
|
||||
$(INSTALL_DIR) $(1)/sbin/fs $(1)/usr/bin $(1)/usr/lib/mergerfs
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/mount.mergerfs $(1)/sbin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mergerfs-fusermount $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mergerfs $(1)/usr/bin/
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/mergerfs/preload.so $(1)/usr/lib/mergerfs/
|
||||
$(LN) /sbin/mount.mergerfs $(1)/sbin/fs/mount.mergerfs
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d $(1)/lib/fstab.d
|
||||
$(INSTALL_CONF) ./files/mergerfs.config $(1)/etc/config/mergerfs
|
||||
$(INSTALL_BIN) ./files/mergerfs.init $(1)/etc/init.d/mergerfs
|
||||
$(INSTALL_DATA) ./files/mergerfs.fstab $(1)/lib/fstab.d/mergerfs.sh
|
||||
endef
|
||||
|
||||
# Set variables used in the source's Makefile
|
||||
MAKE_FLAGS+= NDEBUG=1 USE_XATTR=0 LTO=1 PREFIX=/usr
|
||||
|
||||
$(eval $(call BuildPackage,mergerfs))
|
||||
@@ -0,0 +1,11 @@
|
||||
config pool
|
||||
option enabled '0'
|
||||
option mountpoint '/mnt/merged/movies'
|
||||
option paths '
|
||||
/mnt/nvme1/movies
|
||||
/mnt/nvme2/movies
|
||||
/mnt/nvme3/movies
|
||||
'
|
||||
option createpolicy 'epmfs'
|
||||
option minfreespace '100M'
|
||||
# option options 'defaults,cache.files=off'
|
||||
@@ -0,0 +1,25 @@
|
||||
if /etc/init.d/mergerfs enabled && [ -f /etc/config/mergerfs ]; then
|
||||
(
|
||||
. /lib/functions.sh
|
||||
|
||||
add_paths() {
|
||||
local section="$1"
|
||||
local enabled paths
|
||||
|
||||
config_get_bool enabled "$section" enabled 0
|
||||
[ "$enabled" -eq 1 ] || return 0
|
||||
|
||||
config_get paths "$section" paths
|
||||
|
||||
# (
|
||||
printf "%s\n" "$paths" | while IFS= read -r p; do
|
||||
case "$p" in
|
||||
/*) fstab_add_essential_mountpoint "$p"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
config_load mergerfs
|
||||
config_foreach add_paths pool
|
||||
)
|
||||
fi
|
||||
Executable
+94
@@ -0,0 +1,94 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
# mergerfs -f -o category.create=epmfs,minfreespace=100M,fsname=mergerfs:/mnt/merged /mnt/n2:/mnt/n3:/mnt/n4 /mnt/merged
|
||||
|
||||
START=98
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
start_service() {
|
||||
config_load mergerfs
|
||||
config_foreach start_pool pool
|
||||
}
|
||||
|
||||
start_pool() {
|
||||
local section="$1"
|
||||
local enabled mountpoint paths createpolicy minfreespace options
|
||||
|
||||
config_get_bool enabled "$section" enabled 0
|
||||
[ "$enabled" -eq 1 ] || return 0
|
||||
config_get mountpoint "$section" mountpoint
|
||||
config_get paths "$section" paths
|
||||
config_get createpolicy "$section" createpolicy "epmfs"
|
||||
config_get minfreespace "$section" minfreespace "4G"
|
||||
config_get options "$section" options
|
||||
|
||||
# 检查 mountpoint 是否已设置
|
||||
[ -z "$mountpoint" ] && {
|
||||
logger -t "mergerfs" "mountpoint not set for $section"
|
||||
return 1
|
||||
}
|
||||
|
||||
# (
|
||||
printf "%s\n" "$paths" | while IFS= read -r p; do
|
||||
case "$p" in
|
||||
/*)
|
||||
if [ ! -d "$p" ]; then
|
||||
logger -t "mergerfs" "source path $p does not exist for $mountpoint"
|
||||
return 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done || return 1
|
||||
|
||||
# 只保留以 / 开头的路径,拼接为冒号分隔的字符串
|
||||
srcs=$(
|
||||
# (
|
||||
printf "%s\n" "$paths" | while IFS= read -r p; do
|
||||
case "$p" in
|
||||
/*) printf ':%s' "$p" ;;
|
||||
esac
|
||||
done
|
||||
)
|
||||
srcs="${srcs#:}"
|
||||
|
||||
[ -z "$srcs" ] && {
|
||||
logger -t "mergerfs" "no valid source paths for $mountpoint"
|
||||
return 1
|
||||
}
|
||||
|
||||
local opts
|
||||
opts="category.create=${createpolicy},minfreespace=${minfreespace},fsname=mergerfs:${mountpoint}"
|
||||
[ -n "$options" ] && opts="${opts},${options}"
|
||||
|
||||
mkdir -p "$mountpoint"
|
||||
# mountpoint -q "$mountpoint" && umount "$mountpoint"
|
||||
|
||||
logger -t "mergerfs" "mergerfs -o $opts \"$srcs\" \"$mountpoint\""
|
||||
|
||||
procd_open_instance "$section"
|
||||
procd_set_param command /usr/bin/mergerfs -f -o "$opts" "$srcs" "$mountpoint"
|
||||
procd_close_instance
|
||||
# close flock fd, or the script will hangs next time it runs
|
||||
# ( exec 1000>&- ; mergerfs -o "$opts" "$srcs" "$mountpoint" )
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
config_load mergerfs
|
||||
config_foreach stop_pool pool
|
||||
}
|
||||
|
||||
stop_pool() {
|
||||
local section="$1"
|
||||
local mountpoint
|
||||
config_get mountpoint "$section" mountpoint
|
||||
[ -n "$mountpoint" ] && umount "$mountpoint"
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "mergerfs"
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
restart
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
diff --git a/libfuse/lib/fmt/format.h b/libfuse/lib/fmt/format.h
|
||||
index 7c607dbd..c08d6ca5 100644
|
||||
--- a/libfuse/lib/fmt/format.h
|
||||
+++ b/libfuse/lib/fmt/format.h
|
||||
@@ -1604,10 +1604,10 @@ auto snprintf_float(T value, int precision, float_specs specs,
|
||||
abort_fuzzing_if(precision > 100000);
|
||||
// Suppress the warning about a nonliteral format string.
|
||||
// Cannot use auto because of a bug in MinGW (#1532).
|
||||
- int (*snprintf_ptr)(char*, size_t, const char*, ...) = FMT_SNPRINTF;
|
||||
+ //int (*snprintf_ptr)(char*, size_t, const char*, ...) = FMT_SNPRINTF;
|
||||
int result = precision >= 0
|
||||
- ? snprintf_ptr(begin, capacity, format, precision, value)
|
||||
- : snprintf_ptr(begin, capacity, format, value);
|
||||
+ ? snprintf(begin, capacity, format, precision, value)
|
||||
+ : snprintf(begin, capacity, format, value);
|
||||
if (result < 0) {
|
||||
// The buffer will grow exponentially.
|
||||
buf.try_reserve(buf.capacity() + 1);
|
||||
@@ -0,0 +1,15 @@
|
||||
diff --git a/libfuse/Makefile b/libfuse/Makefile
|
||||
index a20b0742..53959713 100644
|
||||
--- a/libfuse/Makefile
|
||||
+++ b/libfuse/Makefile
|
||||
@@ -136,8 +136,8 @@ strip:
|
||||
install-utils: mergerfs-fusermount mount.mergerfs strip
|
||||
install -D build/mergerfs-fusermount "$(INSTALLBINDIR)/mergerfs-fusermount"
|
||||
install -D build/mount.mergerfs "$(INSTALLSBINDIR)/mount.mergerfs"
|
||||
- chown root "$(INSTALLBINDIR)/mergerfs-fusermount"
|
||||
- chmod u+s "$(INSTALLBINDIR)/mergerfs-fusermount"
|
||||
+# chown root "$(INSTALLBINDIR)/mergerfs-fusermount"
|
||||
+# chmod u+s "$(INSTALLBINDIR)/mergerfs-fusermount"
|
||||
|
||||
install: $(INSTALLUTILS)
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
From eebe9562d62e990dd80e7b5550492a2b4175cb44 Mon Sep 17 00:00:00 2001
|
||||
From: jjm2473 <jjm2473@gmail.com>
|
||||
Date: Thu, 7 Aug 2025 21:35:54 +0800
|
||||
Subject: [PATCH] fix build on openwrt arm64 target
|
||||
|
||||
let openwrt handles stripping
|
||||
---
|
||||
libfuse/Makefile | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/libfuse/Makefile b/libfuse/Makefile
|
||||
index 53959713..04e03396 100644
|
||||
--- a/libfuse/Makefile
|
||||
+++ b/libfuse/Makefile
|
||||
@@ -130,8 +130,8 @@ clean:
|
||||
distclean: clean
|
||||
|
||||
strip:
|
||||
- strip --strip-all build/mount.mergerfs
|
||||
- strip --strip-all build/mergerfs-fusermount
|
||||
+# strip --strip-all build/mount.mergerfs
|
||||
+# strip --strip-all build/mergerfs-fusermount
|
||||
|
||||
install-utils: mergerfs-fusermount mount.mergerfs strip
|
||||
install -D build/mergerfs-fusermount "$(INSTALLBINDIR)/mergerfs-fusermount"
|
||||
--
|
||||
2.46.0
|
||||
|
||||
Reference in new issue
Block a user