From 4f24ccb86c8a9d8b73bbcb2d2d4ba4bfceb5c96b Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Wed, 23 May 2018 21:56:11 +0200 Subject: testing/ocfs2-tools: rewrite aport and upgrade to 1.8.5 Note: We use the same ("unofficial"?) upstream as Fedora. --- testing/ocfs2-tools/APKBUILD | 142 ++++++++------- testing/ocfs2-tools/build.patch | 32 ---- testing/ocfs2-tools/cluster.conf | 17 ++ .../ocfs2-tools/fix-operations-include-ioctl.patch | 10 ++ .../ocfs2-tools/fix-unknown-type-errcode_t.patch | 82 +++++++++ .../musl-libocfs2-__bswap_constant_32.patch | 29 ++++ testing/ocfs2-tools/musl-o2info-atimensec.patch | 35 ++++ testing/ocfs2-tools/musl-sys-raw.h.patch | 37 ++++ testing/ocfs2-tools/o2cb.confd | 38 ++++ testing/ocfs2-tools/o2cb.initd | 193 +++++++++++++++++++++ ...cfs2-tools-1.6-operations-missing-include.patch | 10 -- .../ocfs2-tools/ocfs2-tools-1.6.4-umode_t.patch | 12 -- testing/ocfs2-tools/ocfs2-tools.cluster-conf | 17 -- testing/ocfs2-tools/ocfs2-tools.confd | 38 ---- testing/ocfs2-tools/ocfs2-tools.initd | 193 --------------------- ...nsole-explicitly-specified-link-libraries.patch | 48 +++++ testing/ocfs2-tools/tunefs-remove-op_query.patch | 55 ++++++ 17 files changed, 621 insertions(+), 367 deletions(-) delete mode 100644 testing/ocfs2-tools/build.patch create mode 100644 testing/ocfs2-tools/cluster.conf create mode 100644 testing/ocfs2-tools/fix-operations-include-ioctl.patch create mode 100644 testing/ocfs2-tools/fix-unknown-type-errcode_t.patch create mode 100644 testing/ocfs2-tools/musl-libocfs2-__bswap_constant_32.patch create mode 100644 testing/ocfs2-tools/musl-o2info-atimensec.patch create mode 100644 testing/ocfs2-tools/musl-sys-raw.h.patch create mode 100644 testing/ocfs2-tools/o2cb.confd create mode 100644 testing/ocfs2-tools/o2cb.initd delete mode 100644 testing/ocfs2-tools/ocfs2-tools-1.6-operations-missing-include.patch delete mode 100644 testing/ocfs2-tools/ocfs2-tools-1.6.4-umode_t.patch delete mode 100644 testing/ocfs2-tools/ocfs2-tools.cluster-conf delete mode 100644 testing/ocfs2-tools/ocfs2-tools.confd delete mode 100644 testing/ocfs2-tools/ocfs2-tools.initd create mode 100644 testing/ocfs2-tools/ocfs2console-explicitly-specified-link-libraries.patch create mode 100644 testing/ocfs2-tools/tunefs-remove-op_query.patch (limited to 'testing') diff --git a/testing/ocfs2-tools/APKBUILD b/testing/ocfs2-tools/APKBUILD index 8567e40d68..f5ee901e97 100644 --- a/testing/ocfs2-tools/APKBUILD +++ b/testing/ocfs2-tools/APKBUILD @@ -1,86 +1,98 @@ -# Maintainer: Leonardo Arena +# Contributor: Leonardo Arena +# Contributor: Jakub Jirutka +# Maintainer: Jakub Jirutka +# +# TODO: Fix init script (remove bashisms) pkgname=ocfs2-tools -pkgver=1.6.4 -pkgrel=2 -pkgdesc="Oracle Cluster File System 2 utilities" -url="http://oss.oracle.com/projects/ocfs2-tools" -arch="" -license="GPL-2.0" -depends= -depends_dev="e2fsprogs-dev glib-dev ncurses-dev readline-dev" -makedepends="$depends_dev" -install= -subpackages="$pkgname-dev $pkgname-doc" -source="http://oss.oracle.com/projects/ocfs2-tools/dist/files/source/v${pkgver%.*}/$pkgname-$pkgver.tar.gz - build.patch - $pkgname.initd - $pkgname.confd - $pkgname.cluster-conf - ocfs2-tools-1.6-operations-missing-include.patch - ocfs2-tools-1.6.4-umode_t.patch" - -_builddir="$srcdir"/$pkgname-$pkgver +pkgver=1.8.5 +pkgrel=0 +pkgdesc="Oracle Cluster File System 2 Core Tools" +url="https://oss.oracle.com/projects/ocfs2-tools" +arch="all" +license="GPL-2.0-only" +depends_dev="$pkgname=$pkgver-r$pkgrel glib-dev" +makedepends="$depends_dev autoconf automake e2fsprogs-dev libaio-dev libtool + libtirpc-dev python2-dev py-gtk-dev readline-dev" +subpackages="$pkgname-dev $pkgname-doc ocfs2-console:_console" +source="$pkgname-$pkgver.tar.gz::https://github.com/markfasheh/$pkgname/archive/$pkgname-$pkgver.tar.gz + o2cb.initd + o2cb.confd + cluster.conf + musl-libocfs2-__bswap_constant_32.patch + musl-o2info-atimensec.patch + musl-sys-raw.h.patch + fix-unknown-type-errcode_t.patch + fix-operations-include-ioctl.patch + ocfs2console-explicitly-specified-link-libraries.patch + tunefs-remove-op_query.patch + " +builddir="$srcdir/$pkgname-$pkgname-$pkgver" prepare() { - cd "$_builddir" - update_config_sub || return 1 - local i - for i in ../*.patch - do - msg "Applying patch $i" - patch -p1 -i $i || return 1 - done + cd "$builddir" + + update_config_guess + update_config_sub + default_prepare - sed -i 's%sys/raw.h%linux/raw.h%' fswreck/include/main.h || return 1 - sed -i 's%sys/raw.h%linux/raw.h%' debugfs.ocfs2/include/main.h || return 1 - sed -i 's%sys/raw.h%linux/raw.h%' o2info/operations.c || return 1 + ./autogen.sh } build() { - cd "$_builddir" + cd "$builddir" + + # _GNU_SOURCE is needed for loff_t from fcntl.h; it's already defined + # in many ocfs2-tools' sources, but after fcntl.h is included. + export CFLAGS="$CFLAGS -D_GNU_SOURCE $(pkgconf --cflags libtirpc)" + export LDFLAGS="$LDFLAGS $(pkgconf --cflags libtirpc)" + ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --sysconfdir=/etc \ --mandir=/usr/share/man \ - --infodir=/usr/share/info \ - --enable-ocfs2console=yes \ - --enable-dynamic-fsck=yes \ - --enable-dynamic-ctl=yes \ --disable-glibtest \ - || return 1 - make -j1 || return 1 + --enable-ocfs2console=yes + make -j1 } package() { - cd "$_builddir" + cd "$builddir" + make DESTDIR="$pkgdir" install - # remove the 2 lines below (and this) if there is no init.d script - install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/o2cb - install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/o2cb - install -m644 -D "$srcdir"/$pkgname.cluster-conf "$pkgdir"/etc/ocfs2/cluster.conf + find "$pkgdir"/usr/lib/python*/site-packages -name '*.so' -exec chmod +x {} + + + # FIXME: remove bashisms + #install -m 755 -D "$srcdir"/o2cb.initd "$pkgdir"/etc/init.d/o2cb + #install -m 644 -D "$srcdir"/o2cb.confd "$pkgdir"/etc/conf.d/o2cb + install -m 644 -D "$srcdir"/cluster.conf "$pkgdir"/etc/ocfs2/cluster.conf +} + +_console() { + pkgdesc="GUI frontend for OCFS2 management" + depends="$pkgname=$pkgver-r$pkgrel" + + cd "$pkgdir" + _mv usr/sbin/ocfs2console "$subpkgdir"/usr/sbin/ + _mv usr/lib/python* "$subpkgdir"/usr/lib/ +} + +_mv() { + local dest; for dest; do true; done # get last argument + mkdir -p "$dest" + mv $@ } -md5sums="2e94423507b63fcc08f93c094e789be8 ocfs2-tools-1.6.4.tar.gz -c938040f0e77a4bb23e952c8f99b6cc5 build.patch -bf827283ab0c5de69df2eacbcb598b79 ocfs2-tools.initd -d81b6ab068ec92a137b58c9ad56c4637 ocfs2-tools.confd -189e433cf001465f1565faae2e6e10ac ocfs2-tools.cluster-conf -f1d6bd7f02e69b31b8a103d18c7209f6 ocfs2-tools-1.6-operations-missing-include.patch -cd4710efdb07660459fda1b514cfa8a6 ocfs2-tools-1.6.4-umode_t.patch" -sha256sums="dda9db208312e3e5f4f55ee77e66e7b35b9cc10421bc02065a6c168e42b24755 ocfs2-tools-1.6.4.tar.gz -8e6a51ff12f1f08945102af0008c83e843aa20b25649adc157be92f27c2a3a42 build.patch -c8852f8434c27d34996891fe404c495eaacc06b6e1df0f07fbf2b1675bda1b26 ocfs2-tools.initd -9e090d955f51cdb32f9dd7eb20fec326b793daa90fd7df02a6e437fa00d269b7 ocfs2-tools.confd -5e79d4eaac95fd81f833ca9e08f19f741e88f6c86ebf1b5c91465974b6a8b11f ocfs2-tools.cluster-conf -f82b6d5f5a97b9ae139ca041a60c3553a07dcf1f3821a12ae1d8c17492eff1f9 ocfs2-tools-1.6-operations-missing-include.patch -a4ba2f4aaa16018a08da9cea689c1f7d9d890691a53b74ceb3eddd6a8bebbc41 ocfs2-tools-1.6.4-umode_t.patch" -sha512sums="3b5b834e23467736b2fc522449f3d86b9a4b4764a66ec6812e4ecf497f8d43c2fb1aba1955c6030336d88463e720a5ace0b7cde48853cf3b482c6727ed86a649 ocfs2-tools-1.6.4.tar.gz -6a6b872fe0bb9ef8f3866881619145551ac4b77811082b24be08ecf351d22cd9dd6b239a2c6c962606a0282c5cb16e96ff5aac30a18c04fdf1bc0d1945841018 build.patch -e6fd44358ba5a38446a8bea60c493f4ef9b7a2d7c0076116e91f0edabb66da1fd90be884a46052592f69e338887d4df5c7b7c0b01fadf837fdbc7906a96de52a ocfs2-tools.initd -e510f08a9adc2d7c07e7b8a4d2c503c5a130a156ab1bf1cf45d8480dd94490968f718e966d0bae090a883ff36768e17971415f9905bd5dcf8632f16f7c0b931e ocfs2-tools.confd -f844e5389e0b42d6f91a1335bd2ef4d2666e5b883c999d05acd3bc63ad901bc5838aa4da35bb1d069463d7cc7dcfa277dbaa938b5953e8d420a37cfbb30f24f3 ocfs2-tools.cluster-conf -41b5e0d2eae738a8e05b6377e6dd4fc79592c6fc7b62dbc1ea6d7bd1fdb80122bc2f915748e64e30c9e964a1ebc73a65d81b5409fd499a959b3015d8c0683ead ocfs2-tools-1.6-operations-missing-include.patch -7ec59c84a64d4e4cae0318a77e652d0172155fe4693c9dece0058ee1f92794bd3ed9c0ede230e98c3d635bd735b9bd83bd63a657db25575f1a6de7a50c407a4f ocfs2-tools-1.6.4-umode_t.patch" +sha512sums="94153af0570dafd60c4f6eb31d53ad222ec1e001acb1b29333cef3eafd0a134921566b8dcbd148b4b4af8067dd7419d5bd8d8cd3fef87ab0efcc6c8fb304d22d ocfs2-tools-1.8.5.tar.gz +e6fd44358ba5a38446a8bea60c493f4ef9b7a2d7c0076116e91f0edabb66da1fd90be884a46052592f69e338887d4df5c7b7c0b01fadf837fdbc7906a96de52a o2cb.initd +e510f08a9adc2d7c07e7b8a4d2c503c5a130a156ab1bf1cf45d8480dd94490968f718e966d0bae090a883ff36768e17971415f9905bd5dcf8632f16f7c0b931e o2cb.confd +f844e5389e0b42d6f91a1335bd2ef4d2666e5b883c999d05acd3bc63ad901bc5838aa4da35bb1d069463d7cc7dcfa277dbaa938b5953e8d420a37cfbb30f24f3 cluster.conf +87ea579ddb4a6ae34c5b815fe9015dc0168cb267312f9ef3dccfd16cd65a1f13ef1275dda72308d952ca844e42a486c891340210c4757866f2caacd0d6d3a916 musl-libocfs2-__bswap_constant_32.patch +d1eb24086f71f22e0333f4c246389ce82c9b4540bb0a2d091f6deee7f563c7e5457a838937cd07f1b90359e9c215639aebcbc54c551fb0e9e3617f29c03d49a1 musl-o2info-atimensec.patch +b471c21f30f7ebba05ed8e4c63ff00b4ddad7e6095d256929472d61368dcb7566296201ad0af382a21f0a16c47f23cfa256ad91e6629f17595034e4807c96f3b musl-sys-raw.h.patch +5c30855802132ab4aa3495d0e81de1f2ecfece457f008ed7c9570edd7fc8b33b741cfd891d7bdb2c825199a4468a522db9538a84106470e93ac8dd6280a6912c fix-unknown-type-errcode_t.patch +41b5e0d2eae738a8e05b6377e6dd4fc79592c6fc7b62dbc1ea6d7bd1fdb80122bc2f915748e64e30c9e964a1ebc73a65d81b5409fd499a959b3015d8c0683ead fix-operations-include-ioctl.patch +3f1bf02eaa0f26f800cd18445cab32c72a93b7b6bc60ed5940fcd9b36d9e0d4458c73133fa1de55d81b49367ce228c829cbf9eaef7590189b67c3fa11d1e45df ocfs2console-explicitly-specified-link-libraries.patch +c614235c98426a60d484203b47c44643833496de9864f2f6b1bedec206de33231878799d0b16ad2462c7ed2920cd0d8f9fd41fd7b1fff5b644e8be4b31ed815d tunefs-remove-op_query.patch" diff --git a/testing/ocfs2-tools/build.patch b/testing/ocfs2-tools/build.patch deleted file mode 100644 index c0e9e503ab..0000000000 --- a/testing/ocfs2-tools/build.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff -Nuard ocfs2-tools-1.4.3.orig/ocfs2_controld/Makefile ocfs2-tools-1.4.3/ocfs2_controld/Makefile ---- ocfs2-tools-1.4.3.orig/ocfs2_controld/Makefile 2009-04-14 00:10:40.000000000 +0200 -+++ ocfs2-tools-1.4.3/ocfs2_controld/Makefile 2009-09-30 08:22:04.000000000 +0200 -@@ -17,7 +17,7 @@ - PCMK_INCLUDES = -I/usr/include/pacemaker -I/usr/include/heartbeat/ $(GLIB_CFLAGS) - endif - --INCLUDES = -I$(TOPDIR)/include -I. $(PCMK_INCLUDES) -+INCLUDES = -I/usr/include/libxml2 -I$(TOPDIR)/include -I. $(PCMK_INCLUDES) - LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb - LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a - LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2 -diff -Nuard ocfs2-tools-1.4.3.orig/ocfs2_controld/pacemaker.c ocfs2-tools-1.4.3/ocfs2_controld/pacemaker.c ---- ocfs2-tools-1.4.3.orig/ocfs2_controld/pacemaker.c 2009-05-06 03:36:57.000000000 +0200 -+++ ocfs2-tools-1.4.3/ocfs2_controld/pacemaker.c 2009-09-30 08:22:22.000000000 +0200 -@@ -22,6 +22,7 @@ - - #include - -+#include - #include - /* heartbeat support is irrelevant here */ - #undef SUPPORT_HEARTBEAT -@@ -155,7 +156,7 @@ - crm_log_init("ocfs2_controld", LOG_INFO, FALSE, TRUE, 0, NULL); - - if(init_ais_connection(NULL, NULL, NULL, &local_node_uname, &our_nodeid) == FALSE) { -- log_error("Connection to our AIS plugin (%d) failed", CRM_SERVICE); -+ log_error("Connection to our AIS plugin (%d) failed", PCMK_SERVICE); - return -1; - } - diff --git a/testing/ocfs2-tools/cluster.conf b/testing/ocfs2-tools/cluster.conf new file mode 100644 index 0000000000..0d39f1839f --- /dev/null +++ b/testing/ocfs2-tools/cluster.conf @@ -0,0 +1,17 @@ +node: + ip_port = 7777 + ip_address = 10.0.0.1 + number = 0 + name = ocfs2-node1 + cluster = ocfs2 + +node: + ip_port = 7777 + ip_address = 10.0.0.2 + number = 1 + name = ofcs2-node2 + cluster = ocfs2 + +cluster: + node_count = 2 + name = ocfs2 diff --git a/testing/ocfs2-tools/fix-operations-include-ioctl.patch b/testing/ocfs2-tools/fix-operations-include-ioctl.patch new file mode 100644 index 0000000000..c4e63122e3 --- /dev/null +++ b/testing/ocfs2-tools/fix-operations-include-ioctl.patch @@ -0,0 +1,10 @@ +--- a/o2info/operations.c ++++ b/o2info/operations.c +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + + #include "ocfs2/ocfs2.h" + #include "ocfs2/bitops.h" diff --git a/testing/ocfs2-tools/fix-unknown-type-errcode_t.patch b/testing/ocfs2-tools/fix-unknown-type-errcode_t.patch new file mode 100644 index 0000000000..7ad9d94e69 --- /dev/null +++ b/testing/ocfs2-tools/fix-unknown-type-errcode_t.patch @@ -0,0 +1,82 @@ +From 0ffd58b223e24779420130522ea8ee359505f493 Mon Sep 17 00:00:00 2001 +From: Gang He +Date: Mon, 4 Sep 2017 14:08:59 +0800 +Subject: [PATCH] fsck.ocfs2: fix compile error when glibc upgrade + +When glibc upgrade to glibc-2.26.90-14, there was a compile error in fsck.ocfs2, +the compile error messages like, + +In file included from /usr/include/string.h:431:0, + from ../include/ocfs2/ocfs2.h:41, + from pass4.c:32: +include/strings.h:37:1: error: unknown type name ‘errcode_t’; did you mean ‘mode_t’? + errcode_t o2fsck_strings_insert(o2fsck_strings *strings, char *string, + ^~~~~~~~~ + mode_t + +Patch-Source: https://github.com/markfasheh/ocfs2-tools/commit/0ffd58b223e24779420130522ea8ee359505f493 +--- + fsck.ocfs2/Makefile | 2 +- + fsck.ocfs2/include/{strings.h => o2fsck_strings.h} | 0 + fsck.ocfs2/pass2.c | 2 +- + fsck.ocfs2/pass5.c | 2 +- + fsck.ocfs2/strings.c | 2 +- + 5 files changed, 4 insertions(+), 4 deletions(-) + rename fsck.ocfs2/include/{strings.h => o2fsck_strings.h} (100%) + +diff --git a/fsck.ocfs2/Makefile b/fsck.ocfs2/Makefile +index 051ed742..baf1994d 100644 +--- a/fsck.ocfs2/Makefile ++++ b/fsck.ocfs2/Makefile +@@ -64,7 +64,7 @@ HFILES = include/fsck.h \ + include/problem.h \ + include/refcount.h \ + include/slot_recovery.h \ +- include/strings.h \ ++ include/o2fsck_strings.h \ + include/util.h + + +diff --git a/fsck.ocfs2/include/strings.h b/fsck.ocfs2/include/o2fsck_strings.h +similarity index 100% +rename from fsck.ocfs2/include/strings.h +rename to fsck.ocfs2/include/o2fsck_strings.h +diff --git a/fsck.ocfs2/pass2.c b/fsck.ocfs2/pass2.c +index 181febb9..a48a50b5 100644 +--- a/fsck.ocfs2/pass2.c ++++ b/fsck.ocfs2/pass2.c +@@ -43,7 +43,7 @@ + #include "fsck.h" + #include "pass2.h" + #include "problem.h" +-#include "strings.h" ++#include "o2fsck_strings.h" + #include "util.h" + + static const char *whoami = "pass2"; +diff --git a/fsck.ocfs2/pass5.c b/fsck.ocfs2/pass5.c +index 5c2d899f..bfad1b72 100644 +--- a/fsck.ocfs2/pass5.c ++++ b/fsck.ocfs2/pass5.c +@@ -40,7 +40,7 @@ + #include "fsck.h" + #include "pass5.h" + #include "problem.h" +-#include "strings.h" ++#include "o2fsck_strings.h" + #include "util.h" + + static const char *whoami = "pass5"; +diff --git a/fsck.ocfs2/strings.c b/fsck.ocfs2/strings.c +index 4ad37822..8a7a8d9d 100644 +--- a/fsck.ocfs2/strings.c ++++ b/fsck.ocfs2/strings.c +@@ -31,7 +31,7 @@ + #include "ocfs2/ocfs2.h" + + #include "fsck.h" +-#include "strings.h" ++#include "o2fsck_strings.h" + #include "util.h" + + struct string_entry { diff --git a/testing/ocfs2-tools/musl-libocfs2-__bswap_constant_32.patch b/testing/ocfs2-tools/musl-libocfs2-__bswap_constant_32.patch new file mode 100644 index 0000000000..e813db4743 --- /dev/null +++ b/testing/ocfs2-tools/musl-libocfs2-__bswap_constant_32.patch @@ -0,0 +1,29 @@ +From: Jakub Jirutka +Date: Wed, 23 May 2018 19:56:00 +0200 +Subject: [PATCH] Ensure compatibility with other libcs + +The musl libc does not provide __bswap_constant_32. + +--- a/libocfs2/crc32table.h ++++ b/libocfs2/crc32table.h +@@ -6,11 +6,18 @@ + */ + #include + #include ++ ++#ifndef __bswap_constant_32 ++#define __bswap_constant_32(x) \ ++ ((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >> 8) \ ++ | (((x) & 0x0000ff00u) << 8) | (((x) & 0x000000ffu) << 24)) ++#endif ++ + #if __BYTE_ORDER == __LITTLE_ENDIAN + # define tole(x) ((uint32_t)(x)) +-# define tobe(x) ((uint32_t)__bswap_constant_32(x)) ++# define tobe(x) ((uint32_t)__builtin_bswap32(x)) + #elif __BYTE_ORDER == __BIG_ENDIAN +-# define tole(x) ((uint32_t)__bswap_constant_32(x)) ++# define tole(x) ((uint32_t)__builtin_bswap32(x)) + # define tobe(x) ((uint32_t)(x)) + #else + # error Invalid byte order __BYTE_ORDER diff --git a/testing/ocfs2-tools/musl-o2info-atimensec.patch b/testing/ocfs2-tools/musl-o2info-atimensec.patch new file mode 100644 index 0000000000..3e9dcaca3b --- /dev/null +++ b/testing/ocfs2-tools/musl-o2info-atimensec.patch @@ -0,0 +1,35 @@ +From: Jakub Jirutka +Date: Wed, 23 May 2018 21:01:00 +0200 +Subject: [PATCH] Ensure compatibility with musl + +The musl libc does not define macros st_{atim,mtim,ctim}ensec. + +--- a/o2info/utils.c ++++ b/o2info/utils.c +@@ -334,7 +334,7 @@ + #else + struct timespec t; + t.tv_sec = st->st_atime; +- t.tv_nsec = st->st_atimensec; ++ t.tv_nsec = st->st_atim.tv_nsec; + return t; + #endif + } +@@ -346,7 +346,7 @@ + #else + struct timespec t; + t.tv_sec = st->st_mtime; +- t.tv_nsec = st->st_mtimensec; ++ t.tv_nsec = st->st_mtim.tv_nsec; + return t; + #endif + } +@@ -358,7 +358,7 @@ + #else + struct timespec t; + t.tv_sec = st->st_ctime; +- t.tv_nsec = st->st_ctimensec; ++ t.tv_nsec = st->st_ctim.tv_nsec; + return t; + #endif + } diff --git a/testing/ocfs2-tools/musl-sys-raw.h.patch b/testing/ocfs2-tools/musl-sys-raw.h.patch new file mode 100644 index 0000000000..d29210d433 --- /dev/null +++ b/testing/ocfs2-tools/musl-sys-raw.h.patch @@ -0,0 +1,37 @@ +From: Jakub Jirutka +Date: Wed, 23 May 2018 21:18:00 +0200 +Subject: [PATCH] Replace include sys/raw.h with linux/raw.h + +--- a/debugfs.ocfs2/include/main.h ++++ b/debugfs.ocfs2/include/main.h +@@ -45,7 +45,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include +--- a/fswreck/include/main.h ++++ b/fswreck/include/main.h +@@ -43,7 +43,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + +--- a/o2info/operations.c ++++ b/o2info/operations.c +@@ -22,7 +22,7 @@ + #define _GNU_SOURCE /* Because libc really doesn't want us using O_DIRECT? */ + + #include +-#include ++#include + #include + + #include "ocfs2/ocfs2.h" diff --git a/testing/ocfs2-tools/o2cb.confd b/testing/ocfs2-tools/o2cb.confd new file mode 100644 index 0000000000..29bc08406a --- /dev/null +++ b/testing/ocfs2-tools/o2cb.confd @@ -0,0 +1,38 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/ocfs2-tools/files/ocfs2.conf,v 1.1 2006/07/20 05:13:14 dberkholz Exp $ + +# Put your cluster names here, separated by space, ie. +# OCFS2_CLUSTER="cluster1 admincluster cluster2" +OCFS2_CLUSTER="ocfs2" + +# Some heartbeat tweaks to prevent self-fencing quite so much during heavy load. +# http://oss.oracle.com/projects/ocfs2/dist/documentation/ocfs2_faq.html + +# How long to wait before a node is considered dead from lack of network activity. +OCFS2_IDLE_TIMEOUT_MS="30000" +# How often we should attempt to send heartbeats. +OCFS2_KEEPALIVE_DELAY_MS="2000" +OCFS2_RECONNECT_DELAY_MS="2000" +# How often we should attempt to send heartbeats. +# How many interations before a node is considered dead from lack of IO activity. +# (dead_threshold - 1) * 2s +OCFS2_DEAD_THRESHOLD="31" + +# Default: "-fy" (force check on double-unmounted boot). I beleave this is best. +# Native way is "-y", but once I have twice reboot/powerOFF with bad result... +# Affected only fstab. +OCFS2_FSCK="-fy" + +# http://oss.oracle.com/projects/ocfs2-tools/news/article_8.html +# starting from 1.4.3, fsck.ocfs2 "aggressively cache the metadata blocks" +# this is useful on lots of free memory, but I have heavy slowdown on x86_64 +# with 1G of RAM. +# "yes" will "swapoff -a" & "swapon -a" around fsck to avoid caching over swap +OCFS2_FSCK_SWAPOFF="yes" + +# Signal to kill processes on stop/umount on busy device (empty to not kill) +#OCFS2_UMOUNT_KILL="KILL" + +# "yes" to force stop +#OCFS2_FORCE_STOP="no" diff --git a/testing/ocfs2-tools/o2cb.initd b/testing/ocfs2-tools/o2cb.initd new file mode 100644 index 0000000000..b6d43ddc13 --- /dev/null +++ b/testing/ocfs2-tools/o2cb.initd @@ -0,0 +1,193 @@ +#!/sbin/openrc-run + +: ${OCFS2_FSCK:="-fy"} + +depend() { + need net localmount + before netmount + after drbd +} + +pseudofs() { + [ -n "`mount -t $1`" ] && return 0 + ewarn "OCFS2: Pseudo-filesystem $1 are not mounted." + ewarn "Make sure you have following lines in your /etc/fstab:" + ewarn "none $2 $1 defaults 0 0" + + # Why not? + ebegin "Mounting $1" + mount -t $1 none $2 && [ -n "`mount -t $1`" ] + eend $? || return 1 +} + +fmod() { + [[ -e "$1" ]] && return 0 + modprobe -s $2 && [[ -e "$1" ]] && return 0 + eerror "OCFS2: Module '$2' failed, '$1' not found" + return 1 +} + +# unsure about possibility to keep heartbeat unclean after correct umount +# but Oracle do so +clean_heartbeat(){ + local err=0 id + for i in "/sys/kernel/config/cluster/$1/heartbeat"/*; do + [[ -d "$i" ]] || continue + id="${i##*/}" + ebegin "Cleaning OCFS2 heartbeat region $1/$id" + [[ "`/sbin/ocfs2_hb_ctl -I -u "$id" | grep -o " [0-9]* refs$"`" == " 0 refs" ]] && /sbin/ocfs2_hb_ctl -K -u "$id" || ! [[ -d "$i" ]] + eend $? || err=1 + done + return $err +} + +UUID(){ + local dev fs stack uuid label + /sbin/mounted.ocfs2 -d|while read dev fs stack uuid label; do + [[ "$stack" == "o2cb" ]] && echo "$uuid" + done|sort -u +} + +clusters(){ + [[ -z "${OCFS2_CLUSTER}" ]] && for i in /sys/kernel/config/cluster/*; do + OCFS2_CLUSTER="${OCFS2_CLUSTER} ${i##*/}" + done + echo "${OCFS2_CLUSTER}" +} + +stop_cluster(){ + if clean_heartbeat $1 || [[ "${OCFS2_FORCE_STOP}" == yes ]]; then + ebegin "Stopping OCFS2 cluster '$1'" + /sbin/o2cb_ctl -H -n $1 -t cluster -a online=no >/dev/null + eend $? || return 1 + else + return 1 + fi +} + +online(){ + local cluster + for cluster in ${*:-$(clusters)}; do + grep -q "^1\$" /sys/kernel/config/cluster/$cluster/node/*/local 2>/dev/null || return 1 + done + return 0 +} + +start() { + ( fmod /sys/fs/ocfs2 ocfs2 && + fmod /sys/fs/ocfs2/cluster_stack ocfs2_stackglue && + pseudofs configfs /sys/kernel/config && + pseudofs ocfs2_dlmfs /dlm + ) || return 1 + echo o2cb >/sys/fs/ocfs2/cluster_stack 2>/dev/null + if [[ "`cat /sys/fs/ocfs2/cluster_stack`" != "o2cb" ]]; then + eerror "OCFS2: Stack 'o2cb' not loaded. Check your kernel config." + return 1 + fi + + # autodetect + : ${OCFS2_CLUSTER:=$(UUID)} + + for cluster in $(clusters); do + ebegin "Starting OCFS2 cluster '${cluster}'" + online $cluster || /sbin/o2cb_ctl -H -n ${cluster} -t cluster -a online=yes >/dev/null + if ! eend $? ; then + local OCFS2_FORCE_STOP=no + stop_cluster $cluster + return 1 + fi + + # Some heartbeat tweaks to prevent self-fencing quite so much during heavy load. + # http://oss.oracle.com/projects/ocfs2/dist/documentation/ocfs2_faq.html + + # How long to wait before a node is considered dead from lack of network activity. + echo $OCFS2_IDLE_TIMEOUT_MS > /sys/kernel/config/cluster/${cluster}/idle_timeout_ms + # How often we should attempt to send heartbeats. + echo $OCFS2_KEEPALIVE_DELAY_MS > /sys/kernel/config/cluster/${cluster}/keepalive_delay_ms + echo $OCFS2_RECONNECT_DELAY_MS > /sys/kernel/config/cluster/${cluster}/reconnect_delay_ms + # How many interations before a node is considered dead from lack of IO activity. + # (dead_threshold - 1) * 2s + echo $OCFS2_DEAD_THRESHOLD > /sys/kernel/config/cluster/${cluster}/heartbeat/dead_threshold + done + + local i + for i in 9 8 7 6 5 4 3 2 1 0; do + online && break + echo -n "$i" + sleep 1 + done + # usure: IMHO locking not starts here +# let i=OCFS2_RECONNECT_DELAY_MS*2/1000 +# sleep $i + + # Voluntary fsck. Will be happened only ondemand - + # on both unmounted/double fault, placed in fstab. + [[ "$OCFS2_FSCK_SWAPOFF" == "yes" ]] && swapoff -a + for i in `mount -invfat ocfs2 2>/dev/null|sed -e 's: .*::g'` ; do + [[ -e "$i" ]] || continue + einfo "OCFS2: Trying 'fsck.ocfs2 $OCFS2_FSCK $i' (fs check if possible)" + /sbin/fsck.ocfs2 $OCFS2_FSCK "$i" 2>/dev/null + done + [[ "$OCFS2_FSCK_SWAPOFF" == "yes" ]] && swapon -a + + # Any behaviour + ebegin "Mounting OCFS2 filesystems" + mount -at ocfs2 + eend $? + return $? +} + +_fuser(){ + fuser -"${OCFS2_UMOUNT_KILL}" -v"${OCFS2_UMOUNT_KILL:+k}" $* + return $? +} + +_umount(){ + local i m + i=`umount $* 2>&1` && { + echo -n "$i" + return 0 + } + echo "$i" + _fuser -mM `echo "$i"|grep "^umount: .* device is busy\.\$"|sed -e 's%^umount: \([^ ]*\): device is busy\.$%\1%g'` || return 1 + [[ -z "${OCFS2_UMOUNT_KILL}" ]] && return 1 + umount $* && return 0 + sleep 1 + umount $* + return $? +} + +stop() { + local ret=0 dev m i + # now umount only clusters - under heartbeat. others later +# ebegin "Unmounting OCFS2 filesystems" +# _umount -at ocfs2 +# eend $? +# ret=$? + + for cluster in $(clusters); do + for dev in `cat /sys/kernel/config/cluster/$cluster/heartbeat/*/dev 2>/dev/null`; do + m=`grep "/dev/$dev " /proc/mounts|sed -e 's:^[^ ]* \([^ ]*\) .*$:\1:g'` + [[ -z "$m" ]] && continue + ebegin "Unmounting OCFS2 cluster '$cluster' filesystems '$dev' from '$m'" + if _umount $m; then + eend 0 + continue + elif umount $m; then + einfon "Lazy unmounted. Waiting " + for i in 9 8 7 6 5 4 3 2 1 0; do + ( /sbin/ocfs2_hb_ctl -I -d /dev/$dev || break ) | grep -q " 0 refs\$" && break + echo -n "$i" + _fuser $m + sleep 1 + done + echo + [[ "$i" != 0 ]] && continue + fi + eend 1 + ret=1 + done + stop_cluster $cluster || ret=1 + done + return $ret +} diff --git a/testing/ocfs2-tools/ocfs2-tools-1.6-operations-missing-include.patch b/testing/ocfs2-tools/ocfs2-tools-1.6-operations-missing-include.patch deleted file mode 100644 index c4e63122e3..0000000000 --- a/testing/ocfs2-tools/ocfs2-tools-1.6-operations-missing-include.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/o2info/operations.c -+++ b/o2info/operations.c -@@ -24,6 +24,7 @@ - #include - #include - #include -+#include - - #include "ocfs2/ocfs2.h" - #include "ocfs2/bitops.h" diff --git a/testing/ocfs2-tools/ocfs2-tools-1.6.4-umode_t.patch b/testing/ocfs2-tools/ocfs2-tools-1.6.4-umode_t.patch deleted file mode 100644 index fb8b714082..0000000000 --- a/testing/ocfs2-tools/ocfs2-tools-1.6.4-umode_t.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- ocfs2-tools-1.6.4/include/ocfs2-kernel/ocfs2_fs.h 2010-12-29 07:30:55.000000000 +0100 -+++ ocfs2-tools-1.6.4.n/include/ocfs2-kernel/ocfs2_fs.h 2012-04-23 19:13:46.402253336 +0200 -@@ -1638,7 +1638,7 @@ - } - - static inline void ocfs2_set_de_type(struct ocfs2_dir_entry *de, -- umode_t mode) -+ unsigned short mode) - { - de->file_type = ocfs2_type_by_mode[(mode & S_IFMT)>>S_SHIFT]; - } - diff --git a/testing/ocfs2-tools/ocfs2-tools.cluster-conf b/testing/ocfs2-tools/ocfs2-tools.cluster-conf deleted file mode 100644 index 0d39f1839f..0000000000 --- a/testing/ocfs2-tools/ocfs2-tools.cluster-conf +++ /dev/null @@ -1,17 +0,0 @@ -node: - ip_port = 7777 - ip_address = 10.0.0.1 - number = 0 - name = ocfs2-node1 - cluster = ocfs2 - -node: - ip_port = 7777 - ip_address = 10.0.0.2 - number = 1 - name = ofcs2-node2 - cluster = ocfs2 - -cluster: - node_count = 2 - name = ocfs2 diff --git a/testing/ocfs2-tools/ocfs2-tools.confd b/testing/ocfs2-tools/ocfs2-tools.confd deleted file mode 100644 index 29bc08406a..0000000000 --- a/testing/ocfs2-tools/ocfs2-tools.confd +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/ocfs2-tools/files/ocfs2.conf,v 1.1 2006/07/20 05:13:14 dberkholz Exp $ - -# Put your cluster names here, separated by space, ie. -# OCFS2_CLUSTER="cluster1 admincluster cluster2" -OCFS2_CLUSTER="ocfs2" - -# Some heartbeat tweaks to prevent self-fencing quite so much during heavy load. -# http://oss.oracle.com/projects/ocfs2/dist/documentation/ocfs2_faq.html - -# How long to wait before a node is considered dead from lack of network activity. -OCFS2_IDLE_TIMEOUT_MS="30000" -# How often we should attempt to send heartbeats. -OCFS2_KEEPALIVE_DELAY_MS="2000" -OCFS2_RECONNECT_DELAY_MS="2000" -# How often we should attempt to send heartbeats. -# How many interations before a node is considered dead from lack of IO activity. -# (dead_threshold - 1) * 2s -OCFS2_DEAD_THRESHOLD="31" - -# Default: "-fy" (force check on double-unmounted boot). I beleave this is best. -# Native way is "-y", but once I have twice reboot/powerOFF with bad result... -# Affected only fstab. -OCFS2_FSCK="-fy" - -# http://oss.oracle.com/projects/ocfs2-tools/news/article_8.html -# starting from 1.4.3, fsck.ocfs2 "aggressively cache the metadata blocks" -# this is useful on lots of free memory, but I have heavy slowdown on x86_64 -# with 1G of RAM. -# "yes" will "swapoff -a" & "swapon -a" around fsck to avoid caching over swap -OCFS2_FSCK_SWAPOFF="yes" - -# Signal to kill processes on stop/umount on busy device (empty to not kill) -#OCFS2_UMOUNT_KILL="KILL" - -# "yes" to force stop -#OCFS2_FORCE_STOP="no" diff --git a/testing/ocfs2-tools/ocfs2-tools.initd b/testing/ocfs2-tools/ocfs2-tools.initd deleted file mode 100644 index b6d43ddc13..0000000000 --- a/testing/ocfs2-tools/ocfs2-tools.initd +++ /dev/null @@ -1,193 +0,0 @@ -#!/sbin/openrc-run - -: ${OCFS2_FSCK:="-fy"} - -depend() { - need net localmount - before netmount - after drbd -} - -pseudofs() { - [ -n "`mount -t $1`" ] && return 0 - ewarn "OCFS2: Pseudo-filesystem $1 are not mounted." - ewarn "Make sure you have following lines in your /etc/fstab:" - ewarn "none $2 $1 defaults 0 0" - - # Why not? - ebegin "Mounting $1" - mount -t $1 none $2 && [ -n "`mount -t $1`" ] - eend $? || return 1 -} - -fmod() { - [[ -e "$1" ]] && return 0 - modprobe -s $2 && [[ -e "$1" ]] && return 0 - eerror "OCFS2: Module '$2' failed, '$1' not found" - return 1 -} - -# unsure about possibility to keep heartbeat unclean after correct umount -# but Oracle do so -clean_heartbeat(){ - local err=0 id - for i in "/sys/kernel/config/cluster/$1/heartbeat"/*; do - [[ -d "$i" ]] || continue - id="${i##*/}" - ebegin "Cleaning OCFS2 heartbeat region $1/$id" - [[ "`/sbin/ocfs2_hb_ctl -I -u "$id" | grep -o " [0-9]* refs$"`" == " 0 refs" ]] && /sbin/ocfs2_hb_ctl -K -u "$id" || ! [[ -d "$i" ]] - eend $? || err=1 - done - return $err -} - -UUID(){ - local dev fs stack uuid label - /sbin/mounted.ocfs2 -d|while read dev fs stack uuid label; do - [[ "$stack" == "o2cb" ]] && echo "$uuid" - done|sort -u -} - -clusters(){ - [[ -z "${OCFS2_CLUSTER}" ]] && for i in /sys/kernel/config/cluster/*; do - OCFS2_CLUSTER="${OCFS2_CLUSTER} ${i##*/}" - done - echo "${OCFS2_CLUSTER}" -} - -stop_cluster(){ - if clean_heartbeat $1 || [[ "${OCFS2_FORCE_STOP}" == yes ]]; then - ebegin "Stopping OCFS2 cluster '$1'" - /sbin/o2cb_ctl -H -n $1 -t cluster -a online=no >/dev/null - eend $? || return 1 - else - return 1 - fi -} - -online(){ - local cluster - for cluster in ${*:-$(clusters)}; do - grep -q "^1\$" /sys/kernel/config/cluster/$cluster/node/*/local 2>/dev/null || return 1 - done - return 0 -} - -start() { - ( fmod /sys/fs/ocfs2 ocfs2 && - fmod /sys/fs/ocfs2/cluster_stack ocfs2_stackglue && - pseudofs configfs /sys/kernel/config && - pseudofs ocfs2_dlmfs /dlm - ) || return 1 - echo o2cb >/sys/fs/ocfs2/cluster_stack 2>/dev/null - if [[ "`cat /sys/fs/ocfs2/cluster_stack`" != "o2cb" ]]; then - eerror "OCFS2: Stack 'o2cb' not loaded. Check your kernel config." - return 1 - fi - - # autodetect - : ${OCFS2_CLUSTER:=$(UUID)} - - for cluster in $(clusters); do - ebegin "Starting OCFS2 cluster '${cluster}'" - online $cluster || /sbin/o2cb_ctl -H -n ${cluster} -t cluster -a online=yes >/dev/null - if ! eend $? ; then - local OCFS2_FORCE_STOP=no - stop_cluster $cluster - return 1 - fi - - # Some heartbeat tweaks to prevent self-fencing quite so much during heavy load. - # http://oss.oracle.com/projects/ocfs2/dist/documentation/ocfs2_faq.html - - # How long to wait before a node is considered dead from lack of network activity. - echo $OCFS2_IDLE_TIMEOUT_MS > /sys/kernel/config/cluster/${cluster}/idle_timeout_ms - # How often we should attempt to send heartbeats. - echo $OCFS2_KEEPALIVE_DELAY_MS > /sys/kernel/config/cluster/${cluster}/keepalive_delay_ms - echo $OCFS2_RECONNECT_DELAY_MS > /sys/kernel/config/cluster/${cluster}/reconnect_delay_ms - # How many interations before a node is considered dead from lack of IO activity. - # (dead_threshold - 1) * 2s - echo $OCFS2_DEAD_THRESHOLD > /sys/kernel/config/cluster/${cluster}/heartbeat/dead_threshold - done - - local i - for i in 9 8 7 6 5 4 3 2 1 0; do - online && break - echo -n "$i" - sleep 1 - done - # usure: IMHO locking not starts here -# let i=OCFS2_RECONNECT_DELAY_MS*2/1000 -# sleep $i - - # Voluntary fsck. Will be happened only ondemand - - # on both unmounted/double fault, placed in fstab. - [[ "$OCFS2_FSCK_SWAPOFF" == "yes" ]] && swapoff -a - for i in `mount -invfat ocfs2 2>/dev/null|sed -e 's: .*::g'` ; do - [[ -e "$i" ]] || continue - einfo "OCFS2: Trying 'fsck.ocfs2 $OCFS2_FSCK $i' (fs check if possible)" - /sbin/fsck.ocfs2 $OCFS2_FSCK "$i" 2>/dev/null - done - [[ "$OCFS2_FSCK_SWAPOFF" == "yes" ]] && swapon -a - - # Any behaviour - ebegin "Mounting OCFS2 filesystems" - mount -at ocfs2 - eend $? - return $? -} - -_fuser(){ - fuser -"${OCFS2_UMOUNT_KILL}" -v"${OCFS2_UMOUNT_KILL:+k}" $* - return $? -} - -_umount(){ - local i m - i=`umount $* 2>&1` && { - echo -n "$i" - return 0 - } - echo "$i" - _fuser -mM `echo "$i"|grep "^umount: .* device is busy\.\$"|sed -e 's%^umount: \([^ ]*\): device is busy\.$%\1%g'` || return 1 - [[ -z "${OCFS2_UMOUNT_KILL}" ]] && return 1 - umount $* && return 0 - sleep 1 - umount $* - return $? -} - -stop() { - local ret=0 dev m i - # now umount only clusters - under heartbeat. others later -# ebegin "Unmounting OCFS2 filesystems" -# _umount -at ocfs2 -# eend $? -# ret=$? - - for cluster in $(clusters); do - for dev in `cat /sys/kernel/config/cluster/$cluster/heartbeat/*/dev 2>/dev/null`; do - m=`grep "/dev/$dev " /proc/mounts|sed -e 's:^[^ ]* \([^ ]*\) .*$:\1:g'` - [[ -z "$m" ]] && continue - ebegin "Unmounting OCFS2 cluster '$cluster' filesystems '$dev' from '$m'" - if _umount $m; then - eend 0 - continue - elif umount $m; then - einfon "Lazy unmounted. Waiting " - for i in 9 8 7 6 5 4 3 2 1 0; do - ( /sbin/ocfs2_hb_ctl -I -d /dev/$dev || break ) | grep -q " 0 refs\$" && break - echo -n "$i" - _fuser $m - sleep 1 - done - echo - [[ "$i" != 0 ]] && continue - fi - eend 1 - ret=1 - done - stop_cluster $cluster || ret=1 - done - return $ret -} diff --git a/testing/ocfs2-tools/ocfs2console-explicitly-specified-link-libraries.patch b/testing/ocfs2-tools/ocfs2console-explicitly-specified-link-libraries.patch new file mode 100644 index 0000000000..4441d0bf99 --- /dev/null +++ b/testing/ocfs2-tools/ocfs2console-explicitly-specified-link-libraries.patch @@ -0,0 +1,48 @@ +From e686b8013a14b9b28e77bf08457d426f45689e9d Mon Sep 17 00:00:00 2001 +From: Robin Lee +Date: Mon, 29 Jan 2018 15:01:32 +0800 +Subject: [PATCH] ocfs2console: explicitly specified link libraries + +Patch-Source: https://src.fedoraproject.org/rpms/ocfs2-tools/blob/f28/f/0001-ocfs2console-explicitly-specified-link-libraries.patch +--- + ocfs2console/ocfs2interface/Makefile | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/ocfs2console/ocfs2interface/Makefile b/ocfs2console/ocfs2interface/Makefile +index 54094559..7c7c9b1c 100644 +--- a/ocfs2console/ocfs2interface/Makefile ++++ b/ocfs2console/ocfs2interface/Makefile +@@ -19,6 +19,9 @@ LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -ldlm_lt + else + LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb + endif ++ifneq ($(BUILD_CMAP_SUPPORT),) ++LIBO2CB_LIBS += -lcmap ++endif + LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a + + ifdef HAVE_BLKID +@@ -94,16 +97,16 @@ INSTALL_RULES = install-pylib + DIST_FILES = $(PLIST_CFILES) $(PLIST_HFILES) $(GIDLE_CFILES) $(OCFS2_CFILES) $(O2CB_CFILES) $(PYSRC) $(addsuffix .in,$(BUILT_PYSRC)) + + plistmodule.so: $(PLIST_OBJS) $(LIBOCFS2_DEPS) $(LIBO2DLM_DEPS) $(LIBO2CB_DEPS) $(BLKID_DEPS) +- $(LINK) -shared $(LIBOCFS2_LIBS) $(LIBO2DLM_LIBS) $(LIBO2CB_LIBS) $(BLKID_LIBS) $(COM_ERR_LIBS) $(GLIB_LIBS) ++ $(LINK) -shared $(LIBOCFS2_LIBS) $(LIBO2DLM_LIBS) $(LIBO2CB_LIBS) $(BLKID_LIBS) $(COM_ERR_LIBS) $(GLIB_LIBS) $(shell python-config --libs) + + gidlemodule.so: $(GIDLE_OBJS) +- $(LINK) -shared $(GLIB_LIBS) ++ $(LINK) -shared $(GLIB_LIBS) $(shell python-config --libs) + + ocfs2module.so: $(OCFS2_OBJS) $(LIBOCFS2_DEPS) $(LIBO2DLM_DEPS) $(LIBO2CB_DEPS) +- $(LINK) -shared $(LIBOCFS2_LIBS) $(LIBO2DLM_LIBS) $(LIBO2CB_LIBS) $(COM_ERR_LIBS) $(UUID_LIBS) ++ $(LINK) -shared $(LIBOCFS2_LIBS) $(LIBO2DLM_LIBS) $(LIBO2CB_LIBS) $(COM_ERR_LIBS) $(UUID_LIBS) $(shell python-config --libs) + + o2cbmodule.so: $(O2CB_OBJS) $(LIBO2CB_DEPS) +- $(LINK) -shared $(LIBO2CB_LIBS) $(COM_ERR_LIBS) ++ $(LINK) -shared $(LIBOCFS2_LIBS) $(LIBO2CB_LIBS) $(COM_ERR_LIBS) $(shell python-config --libs) + + install-pylib: + $(SHELL) $(TOPDIR)/mkinstalldirs $(DESTDIR)$(pyexecdir)/ocfs2interface +-- +2.13.6 + diff --git a/testing/ocfs2-tools/tunefs-remove-op_query.patch b/testing/ocfs2-tools/tunefs-remove-op_query.patch new file mode 100644 index 0000000000..f3b35e7d21 --- /dev/null +++ b/testing/ocfs2-tools/tunefs-remove-op_query.patch @@ -0,0 +1,55 @@ +From: Jakub Jirutka +Date: Wed, 23 May 2018 21:14:00 +0200 +Subject: [PATCH] Remove query operation from tunefs + +tunefs.ocfs2/op_query.c uses glibc's printf extensions that are not +available in the musl libc. I didn't find any standalone implementation +and it's not trivial to implement them, so we must remove this feature +for now. + +--- a/tunefs.ocfs2/Makefile ++++ b/tunefs.ocfs2/Makefile +@@ -42,7 +42,6 @@ + op_cloned_volume \ + op_features \ + op_list_sparse_files \ +- op_query \ + op_reset_uuid \ + op_resize_volume \ + op_set_label \ +--- a/tunefs.ocfs2/ocfs2ne.c ++++ b/tunefs.ocfs2/ocfs2ne.c +@@ -89,7 +89,6 @@ + + + extern struct tunefs_operation list_sparse_op; +-extern struct tunefs_operation query_op; + extern struct tunefs_operation reset_uuid_op; + extern struct tunefs_operation features_op; + extern struct tunefs_operation resize_volume_op; +@@ -498,17 +497,6 @@ + .opt_handle = handle_answer, + }; + +-static struct tunefs_option query_option = { +- .opt_option = { +- .name = "query", +- .val = 'Q', +- .has_arg = 1, +- }, +- .opt_help = "-Q|--query ", +- .opt_handle = &generic_handle_arg, +- .opt_op = &query_op, +-}; +- + static struct tunefs_option list_sparse_option = { + .opt_option = { + .name = "list-sparse", +@@ -652,7 +640,6 @@ + &resize_volume_option, + &reset_uuid_option, + &journal_option, +- &query_option, + &list_sparse_option, + &mount_type_option, + &backup_super_option, -- cgit v1.2.3