summaryrefslogtreecommitdiff
path: root/sys-fs/ocfs2-tools
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-fs/ocfs2-tools
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-fs/ocfs2-tools')
-rw-r--r--sys-fs/ocfs2-tools/Manifest9
-rw-r--r--sys-fs/ocfs2-tools/files/ocfs2-tools-1.6.4-asneeded.patch78
-rw-r--r--sys-fs/ocfs2-tools/files/ocfs2-tools-recent-kernels.patch19
-rw-r--r--sys-fs/ocfs2-tools/files/ocfs2.confd37
-rw-r--r--sys-fs/ocfs2-tools/files/ocfs2.initd124
-rw-r--r--sys-fs/ocfs2-tools/metadata.xml11
-rw-r--r--sys-fs/ocfs2-tools/ocfs2-tools-1.8.2-r2.ebuild83
7 files changed, 361 insertions, 0 deletions
diff --git a/sys-fs/ocfs2-tools/Manifest b/sys-fs/ocfs2-tools/Manifest
new file mode 100644
index 000000000000..ef7ff15baa9e
--- /dev/null
+++ b/sys-fs/ocfs2-tools/Manifest
@@ -0,0 +1,9 @@
+AUX ocfs2-tools-1.6.4-asneeded.patch 2606 SHA256 c5b46b7ab225181aa0cd1e4b04450811bc7c3dede5cb7d9afc610ee128dbca37 SHA512 d39c0e73672cd2e7810155690c89da6fae55aa4798dd6e02d3aa0bdb7642bc88d43733ea992262c9fd5c10d40d5ffed7ca7abae6d3114ebdc6915251d43a9a7d WHIRLPOOL 93ea8b89929053e41b63ea2c74347f47c70a8faaf8c3567e1c923223c271503291978782b586b331e8ecade5f0424b9b2b63c9db5f52db5d14bc388c22c6c448
+AUX ocfs2-tools-recent-kernels.patch 650 SHA256 23da66f6f13392b552ff345daa1748e9b1385cd0a2052250d952dee104c550ef SHA512 4e5f5f5fa3a8cbde6f937e574b97c1d6a76d4cec5b9df16a094527c5ca59ed37857f54c4687dfd4557ef4c0fd701825d5ee2091d76eabbecd2b029b5fdf27b1e WHIRLPOOL 086d4387be582f1b496bc4ee25698c363af7926077454f84bf998e57942b13a81fd169814d713b49942906de2745e3f10d6622c47f65b020df0902ed832656eb
+AUX ocfs2.confd 1494 SHA256 5210d1652ab09feac81bedccdedd0d729d209eafd02219c15894d55895132d12 SHA512 7cb63e889fad081d41283534032f41413bbb37202391d7a0f08f590170dc7a11c45bd90946910ba7680e401e4cb80eeb70fe85eb55ecbe9c16507e4d3d0b08c9 WHIRLPOOL eb128d4ba720d56f65ae723b309dc75e0763d5055368431e6b074b019b783cec1dc381a78496ea1be9c09cbf054991163aae1d3afb770904a17f461d00c249dc
+AUX ocfs2.initd 4004 SHA256 d9b52e1aa6c5a545221f395a32e402c2bb6edcbce38a02c5d4a65a0458260e1b SHA512 ab35d6916871eed469c3e05470dec6913b96bf806fd67d090f5a6af9eb28e4cd648707d768c0a47f6d2926f969421837adf9ef714b336c929b73df785dbfae1b WHIRLPOOL b5e9e760ccb0f4efc461a9826b83c35552709d8bca787ad876a16ee23e78396c0f68962da72fe6aadf903fb6f9d9b824d14fb3cefe7c7d00b4a48f183eae88e3
+DIST ocfs2-tools-1.8.2.tar.xz 963132 SHA256 3af5e43695bf780531208b5b058741320c1f03fe54568390bf74cba5066f315b SHA512 b1354730a1e51117497b56e0a1fd79667d608cdf2ccdfa9eb7355f9f40684e64c0787722fa8e6046b35dd00c2ff7a822719b47d059f23253f0bab64e181875ee WHIRLPOOL 88621b43622635dbc4e02b3f5a0c9ff2a411e0481459abc13850f33456fad5ebdc23d5bd3f3fe541ab83cb404fe49bd7814f9f6199dc7f258a8432a12302174a
+EBUILD ocfs2-tools-1.8.2-r2.ebuild 1838 SHA256 6fbe971e3163ceef84854a01f3d71247e62d4c84c4b956acbed1ff26cbfb7491 SHA512 091df2c69adff025e1399f19ef601649f0279efa4a5e4311e5a2e7cb1e4b49ae5c49d34464cc20c325c5f615f243c9f56d2880524235e106e36c3d642a953b05 WHIRLPOOL bfd9280a9788a63d81d1be72ea9297207153335f54e37d1495a4159ef34bef8415f590d9a1327e0525bada0ab0f35b83db5a1e264fcc9fe036acc1ca1507b7c6
+MISC ChangeLog 3121 SHA256 627cd020be16c9420c61c7fd14e44ef108a7b399bcf65f10c5fa52d4a0dbe93d SHA512 03deb7ed27aca4a6e1215142c2800fa0559e4f222328d7846a1dc4f6e0ddfe41eb7d4cbdc2fe39001e782a1eaadceed5be654c546c20be3826888e21ee4ed6c7 WHIRLPOOL 8eee9822f17707b0c2f2dcb9503c58516e8d0fca8842ddb11042cee49b476d51037f782667b11a285ecf63a78b36e07ca2c4cf4c5d218694a3cca7ebe77c4e9c
+MISC ChangeLog-2015 2221 SHA256 012e27d3fcecf2a058a94f8bd3758649a458c8e3972d57f7f26e529bd3893908 SHA512 824f0c496c87a68f0eaaf2a15c0aac61431ec7cc69e1636bf2830158fc94814993ab2b3774df21ea3918e4ff2911d5e74b2bd4a819be9ab2e22c427fb8c829fc WHIRLPOOL d482bd1bec42f2e46cc9b86886499c8081c58d78fb8c91d6cefbd692846568c78c8c1abae11becbe6c40f8cb1a5f57531a22a1757bb00db0ace93532e599c65f
+MISC metadata.xml 320 SHA256 b2fc85066d63ee32fdb4ea3f8310bbb9cb6efeb5e5d8fb77f270e531b2015788 SHA512 281f53acb3439cc8881e8fa0d8b314107fc17bb56e63f8fd51548fccc3e9cd95098cf0199decaa8813a55ab234cf8a1147f94689cb993d3c7ea79df9e3372a1f WHIRLPOOL 0075f0a5c330992944176dd6e6a44a03f61346ef79348130ae42629cddccd76a691d7275c54344f55bb8ff4d95229684a4641854577b2cf657a3af6ea4081be0
diff --git a/sys-fs/ocfs2-tools/files/ocfs2-tools-1.6.4-asneeded.patch b/sys-fs/ocfs2-tools/files/ocfs2-tools-1.6.4-asneeded.patch
new file mode 100644
index 000000000000..8920e773004b
--- /dev/null
+++ b/sys-fs/ocfs2-tools/files/ocfs2-tools-1.6.4-asneeded.patch
@@ -0,0 +1,78 @@
+--- a/configure.in 2011-01-19 20:43:35.000000000 +0100
++++ b/configure.in 2012-02-21 11:14:51.047974999 +0100
+@@ -265,7 +265,6 @@
+ cpg_package=openais
+ fi
+ TRY_PATH="$AIS_TRY_PATH"
+- AC_MSG_CHECKING([for cpg_initialize in -lcpg])
+ while test "x$TRY_PATH" != "x"; do
+ TRY="`echo $TRY_PATH | cut -f1 -d:`"
+ NEW_TRY_PATH="`echo $TRY_PATH | cut -f2- -d:`"
+@@ -281,9 +280,8 @@
+ # TRY="$TRY"
+
+ saved_LDFLAGS="$LDFLAGS"
+- LDFLAGS="$LDFLAGS $TRY -lcpg"
+- AC_LINK_IFELSE([AC_LANG_CALL([], [cpg_initialize])],
+- cpg_found=yes)
++ LDFLAGS="$LDFLAGS $TRY"
++ AC_SEARCH_LIBS([cpg_initialize], [cpg], [cpg_found=yes], [], [])
+ LDFLAGS="$saved_LDFLAGS"
+
+ if test "x$cpg_found" = "xyes"; then
+@@ -292,10 +290,7 @@
+ fi
+ done
+ fi
+-if test "x$cpg_found" = "xyes"; then
+- AC_MSG_RESULT(yes)
+-else
+- AC_MSG_RESULT(no)
++if test "x$cpg_found" = "xno"; then
+ AC_MSG_WARN([libcpg not found, ocfs2_controld will not be built])
+ fi
+ AC_SUBST(CPG_LDFLAGS)
+@@ -309,7 +304,6 @@
+ if test "x$ckpt_found" = "xyes"; then
+ ckpt_found=
+ TRY_PATH="$AIS_TRY_PATH"
+- AC_MSG_CHECKING([for saCkptInitialize in -lSaCkpt])
+ while test "x$TRY_PATH" != "x"; do
+ TRY="`echo $TRY_PATH | cut -f1 -d:`"
+ NEW_TRY_PATH="`echo $TRY_PATH | cut -f2- -d:`"
+@@ -325,9 +319,8 @@
+ # TRY="$TRY"
+
+ saved_LDFLAGS="$LDFLAGS"
+- LDFLAGS="$LDFLAGS $TRY -lSaCkpt"
+- AC_LINK_IFELSE([AC_LANG_CALL([], [saCkptInitialize])],
+- ckpt_found=yes)
++ LDFLAGS="$LDFLAGS $TRY"
++ AC_SEARCH_LIBS([saCkptInitialize], [SaCkpt], [ckpt_found=yes], [], [])
+ LDFLAGS="$saved_LDFLAGS"
+
+ if test "x$ckpt_found" = "xyes"; then
+@@ -336,10 +329,7 @@
+ fi
+ done
+ fi
+-if test "x$ckpt_found" = "xyes"; then
+- AC_MSG_RESULT(yes)
+-else
+- AC_MSG_RESULT(no)
++if test "x$ckpt_found" = "xno"; then
+ AC_MSG_WARN([libSaCkpt not found, ocfs2_controld will not be built])
+ fi
+ AC_SUBST(AIS_LDFLAGS)
+
+--- a/ocfs2_controld/Makefile 2012-02-21 11:49:36.248974932 +0100
++++ b/ocfs2_controld/Makefile 2012-02-21 11:49:47.943974980 +0100
+@@ -14,7 +14,7 @@
+ ifneq ($(BUILD_PCMK_SUPPORT),)
+ SBIN_PROGRAMS += ocfs2_controld.pcmk
+ # Some pacemaker headers which pacemaker.c includes want this.
+-PCMK_INCLUDES = -I/usr/include/pacemaker -I/usr/include/heartbeat/ $(GLIB_CFLAGS)
++PCMK_INCLUDES = -I/usr/include/pacemaker -I/usr/include/heartbeat/ `pkg-config --cflags libxml-2.0` $(GLIB_CFLAGS)
+ endif
+
+ INCLUDES = -I$(TOPDIR)/include -I. $(PCMK_INCLUDES)
diff --git a/sys-fs/ocfs2-tools/files/ocfs2-tools-recent-kernels.patch b/sys-fs/ocfs2-tools/files/ocfs2-tools-recent-kernels.patch
new file mode 100644
index 000000000000..24bc40dcd09f
--- /dev/null
+++ b/sys-fs/ocfs2-tools/files/ocfs2-tools-recent-kernels.patch
@@ -0,0 +1,19 @@
+# git diff include/ocfs2-kernel/ocfs2_fs.h
+diff --git a/include/ocfs2-kernel/ocfs2_fs.h b/include/ocfs2-kernel/ocfs2_fs.h
+index 3eafb07..7bb954a 100644
+--- a/include/ocfs2-kernel/ocfs2_fs.h
++++ b/include/ocfs2-kernel/ocfs2_fs.h
+@@ -1681,11 +1681,11 @@ static inline int ocfs2_sprintf_system_inode_name(char *buf, int len,
+ return chars;
+ }
+
+-static inline void ocfs2_set_de_type(struct ocfs2_dir_entry *de,
++/*static inline void ocfs2_set_de_type(struct ocfs2_dir_entry *de,
+ umode_t mode)
+ {
+ de->file_type = ocfs2_type_by_mode[(mode & S_IFMT)>>S_SHIFT];
+-}
++}*/
+
+ static inline int ocfs2_gd_is_discontig(struct ocfs2_group_desc *gd)
+ { \ No newline at end of file
diff --git a/sys-fs/ocfs2-tools/files/ocfs2.confd b/sys-fs/ocfs2-tools/files/ocfs2.confd
new file mode 100644
index 000000000000..89f7a983ea38
--- /dev/null
+++ b/sys-fs/ocfs2-tools/files/ocfs2.confd
@@ -0,0 +1,37 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# Put your cluster names here, separated by space, ie.
+# OCFS2_CLUSTER="cluster1 admincluster cluster2"
+OCFS2_CLUSTER="home"
+
+# 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="61"
+
+# 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/sys-fs/ocfs2-tools/files/ocfs2.initd b/sys-fs/ocfs2-tools/files/ocfs2.initd
new file mode 100644
index 000000000000..32ff2e0bd67f
--- /dev/null
+++ b/sys-fs/ocfs2-tools/files/ocfs2.initd
@@ -0,0 +1,124 @@
+#!/sbin/openrc-run
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need net localmount
+ before netmount
+}
+
+check_modules_config() {
+ local MODULES=$1
+ local CONFIGS=$2
+ local MODULE
+ local retval=0
+
+ for MODULE in ${MODULES}; do
+ if ! ls -1 /sys/module | egrep -q "^${MODULE}$"; then
+ retval=1
+ fi
+ done
+ if [ ${retval} -eq 1 ] && [ -e /proc/config.gz ]; then
+ retval=0
+ for MODULE in ${CONFIGS}; do
+ if ! gzip -dc /proc/config.gz | egrep -q "^CONFIG_${MODULE}=y$"; then
+ retval=1
+ fi
+ done
+ fi
+ return ${retval}
+}
+
+check_modules() {
+ check_modules_config "ocfs2_dlmfs ocfs2 ocfs2_dlm ocfs2_nodemanager" "OCFS2_FS OCFS2_FS_O2CB" && check_modules_config configfs CONFIGFS_FS && return 0
+ if ! egrep -q '\s*ocfs2\s*$' /proc/filesystems || ! egrep -q '\s*ocfs2_dlmfs\s*$' /proc/filesystems; then
+ ewarn "One or more required modules are not loaded."
+ ewarn "Make sure you have "
+ ewarn " - placed ocfs, dlmfs and configfs into /etc/modules.autoload.d/kernel-2.6 or built directly into the kernel."
+ ewarn "For a (in)complete documentation, read /usr/share/doc/ocfs-<version>/INSTALL.GENTOO.bz2"
+ fi
+ return 1
+}
+
+check_pseudofs() {
+ local retval=0
+ local HASMOUNT="mount -l -t"
+ if [ -z "`${HASMOUNT} configfs`" ] ; then
+ retval=1
+ fi
+ if [ -z "`${HASMOUNT} ocfs2_dlmfs`" ] ; then
+ retval=1
+ fi
+
+ if [ ${retval} -eq 1 ]; then
+ ewarn "One or more pseudo-filesystes are not mounted."
+ ewarn "Make sure you have following lines in your /etc/fstab:"
+ ewarn "none /sys/kernel/config configfs defaults 0 0"
+ ewarn "none /sys/kernel/dlm ocfs2_dlmfs defaults 0 0"
+ fi
+ return ${retval}
+}
+
+
+
+start() {
+ check_modules || return $?
+ check_pseudofs || return $?
+
+ einfo "Starting OCFS2 cluster"
+ for cluster in ${OCFS2_CLUSTER}; do
+ ebegin " - ${cluster}"
+ /sbin/o2cb_ctl -H -n ${cluster} -t cluster -a online=yes >/dev/null 2>&1
+ eend $?
+
+ # 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
+ sleep 2
+}
+
+stop() {
+ # Shamelesly stolen from netmount
+ local ret
+ ebegin "Unmounting OCFS2 filesystems"
+ [ -z "$(umount -art ocfs2 2>&1)" ]
+ ret=$?
+ eend ${ret} "Failed to simply unmount filesystems"
+ [ ${ret} -eq 0 ] && return 0
+
+ declare -a siglist=( "TERM" "KILL" "KILL" )
+ local retry=0
+ local remaining="go"
+
+ while [ -n "${remaining}" -a ${retry} -lt 3 ]
+ do
+ remaining="$(awk '$3 ~ /'ocfs2'/ { if ($2 != "/") print $2 }' /proc/mounts | sort -r)"
+ IFS=$'\n'
+ set -- ${remaining//\\040/ }
+ unset IFS
+ [ -z "${remaining}" ] && break
+
+ ebegin $'\t'"Unmounting ocfs2 filesystems (retry #$((retry+1)))"
+ /bin/fuser -k -${siglist[$((retry++))]} -m "$@" &>/dev/null
+ sleep 5
+ umount "$@" &>/dev/null
+ eend $? $'\t'"Failed to unmount filesystems"
+ done
+
+
+ einfo "Stopping OCFS2 cluster"
+ for cluster in ${OCFS_CLUSTERS}; do
+ ebegin " - ${cluster}"
+ /sbin/o2cb_ctl -H -n ${cluster} -t cluster -a online=no >/dev/null 2>&1
+ eend $?
+ done
+}
diff --git a/sys-fs/ocfs2-tools/metadata.xml b/sys-fs/ocfs2-tools/metadata.xml
new file mode 100644
index 000000000000..7bc09f148256
--- /dev/null
+++ b/sys-fs/ocfs2-tools/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>cluster@gentoo.org</email>
+ <name>Gentoo Cluster Project</name>
+</maintainer>
+<use>
+ <flag name="external">Enable external locking</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-fs/ocfs2-tools/ocfs2-tools-1.8.2-r2.ebuild b/sys-fs/ocfs2-tools/ocfs2-tools-1.8.2-r2.ebuild
new file mode 100644
index 000000000000..1db9772faead
--- /dev/null
+++ b/sys-fs/ocfs2-tools/ocfs2-tools-1.8.2-r2.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 )
+inherit autotools python-single-r1
+
+DESCRIPTION="Support programs for the Oracle Cluster Filesystem 2"
+HOMEPAGE="http://oss.oracle.com/projects/ocfs2-tools/"
+SRC_URI="https://dev.gentoo.org/~alexxy/distfiles/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug external gtk"
+
+RDEPEND="
+ dev-libs/libaio:=
+ sys-apps/util-linux:=
+ sys-cluster/libcman
+ external? (
+ sys-cluster/libdlm
+ sys-cluster/pacemaker[-heartbeat]
+ )
+ sys-fs/e2fsprogs
+ sys-libs/e2fsprogs-libs:=
+ sys-libs/ncurses:0=
+ sys-libs/readline:0=
+ sys-process/psmisc
+ gtk? (
+ ${PYTHON_DEPS}
+ dev-python/pygtk[${PYTHON_USEDEP}]
+ )
+"
+# 99% of deps this thing has is automagic
+# specialy cluster things corosync/pacemaker
+DEPEND="${RDEPEND}"
+
+REQUIRED_USE="gtk? ( ${PYTHON_REQUIRED_USE} )"
+
+DOCS=(
+ "${S}/documentation/samples/cluster.conf"
+ "${S}/documentation/users_guide.txt"
+)
+
+MAKEOPTS+=" -j1"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-1.6.4-asneeded.patch"
+ "${FILESDIR}/${PN}-recent-kernels.patch"
+)
+
+pkg_setup() {
+ use gtk && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ sed -e 's/ncurses, tgetstr/ncurses, printw/g' -i configure.in || die
+ # gentoo uses /sys/kernel/dlm as dlmfs mountpoint
+ sed -e 's:"/dlm/":"/sys/kernel/dlm":g' \
+ -i libo2dlm/o2dlm_test.c \
+ -i libocfs2/dlm.c || die "sed failed"
+ default
+ rm -f aclocal.m4 || die
+ AT_M4DIR=. eautoreconf
+ use gtk && python_fix_shebang .
+}
+
+src_configure() {
+ econf \
+ $(use_enable debug debug) \
+ $(use_enable debug debugexe) \
+ $(use_enable gtk ocfs2console) \
+ --enable-dynamic-fsck \
+ --enable-dynamic-ctl
+}
+
+src_install() {
+ default
+ use gtk && python_optimize
+ newinitd "${FILESDIR}/ocfs2.initd" ocfs2
+ newconfd "${FILESDIR}/ocfs2.confd" ocfs2
+}