From 503928a334e1900d28a876f03ea1b71e996e78b2 Mon Sep 17 00:00:00 2001 From: Tomasz Duda Date: Fri, 14 Mar 2025 17:05:25 +0100 Subject: [PATCH] addpkg(root/thin-provisioning-tools): add 0.9.0 To allow lvm2 use thin pools on 4.19 kernel. --- .../thin-provisioning-tools/build.patch | 19 ++++++++++++++ .../thin-provisioning-tools/build.sh | 18 +++++++++++++ .../thin-provisioning-tools/file_utils.patch | 25 +++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 root-packages/thin-provisioning-tools/build.patch create mode 100644 root-packages/thin-provisioning-tools/build.sh create mode 100644 root-packages/thin-provisioning-tools/file_utils.patch diff --git a/root-packages/thin-provisioning-tools/build.patch b/root-packages/thin-provisioning-tools/build.patch new file mode 100644 index 00000000000..0c5517c2512 --- /dev/null +++ b/root-packages/thin-provisioning-tools/build.patch @@ -0,0 +1,19 @@ +diff --git a/Makefile.in b/Makefile.in +index b1fd4aa5..e5d9a1bf 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -185,13 +185,10 @@ else + CXXLIB+=-lstdc++ + endif + +-ifeq ("@STATIC@", "yes") +-LDFLAGS+=-static +-endif + + INSTALL:=@INSTALL@ + PREFIX:=@prefix@ +-BINDIR:=$(DESTDIR)$(PREFIX)/sbin ++BINDIR:=$(DESTDIR)$(PREFIX)/bin + DATADIR:=$(DESTDIR)$(PREFIX)/share + MANPATH:=$(DATADIR)/man + diff --git a/root-packages/thin-provisioning-tools/build.sh b/root-packages/thin-provisioning-tools/build.sh new file mode 100644 index 00000000000..5735e40e993 --- /dev/null +++ b/root-packages/thin-provisioning-tools/build.sh @@ -0,0 +1,18 @@ +TERMUX_PKG_HOMEPAGE=https://github.com/jthornber/thin-provisioning-tools +TERMUX_PKG_DESCRIPTION="A suite of tools for manipulating the metadata of the dm-thin, dm-cache and dm-era device-mapper targets." +TERMUX_PKG_LICENSE="GPL-3.0" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION="0.9.0" +TERMUX_PKG_SRCURL=https://github.com/jthornber/thin-provisioning-tools/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz +TERMUX_PKG_SHA256=a2508d9933ed8a3f6c8d302280d838d416668a1d914a83c4bd0fb01eaf0676e8 +TERMUX_PKG_DEPENDS="libexpat, libaio, boost" +TERMUX_PKG_BUILD_DEPENDS="boost-headers" +TERMUX_PKG_BUILD_IN_SRC=true +TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-optimisation=-O3" +TERMUX_PKG_AUTO_UPDATE=false + +termux_step_pre_configure() { + CFLAGS+=" -I$TERMUX_PREFIX/include" + CXXFLAGS+=" -I$TERMUX_PREFIX/include" + autoconf +} diff --git a/root-packages/thin-provisioning-tools/file_utils.patch b/root-packages/thin-provisioning-tools/file_utils.patch new file mode 100644 index 00000000000..5198ffe1631 --- /dev/null +++ b/root-packages/thin-provisioning-tools/file_utils.patch @@ -0,0 +1,25 @@ +diff --git a/base/file_utils.cc b/base/file_utils.cc +index e4f37228..14ae277a 100644 +--- a/base/file_utils.cc ++++ b/base/file_utils.cc +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + + //---------------------------------------------------------------- + +@@ -150,9 +151,9 @@ file_utils::zero_superblock(std::string const &path) + unsigned const SUPERBLOCK_SIZE = 4096; + file_descriptor fd = open_block_file(path, SUPERBLOCK_SIZE, true, true); + +- buffer = reinterpret_cast(aligned_alloc(SUPERBLOCK_SIZE, SUPERBLOCK_SIZE)); +- if (!buffer) +- throw runtime_error("out of memory"); ++ if (posix_memalign(reinterpret_cast(&buffer), SUPERBLOCK_SIZE, SUPERBLOCK_SIZE) != 0) { ++ throw runtime_error("out of memory"); ++ } + + memset(buffer, 0, SUPERBLOCK_SIZE); + if (::write(fd.fd_, buffer, SUPERBLOCK_SIZE) != SUPERBLOCK_SIZE)