diff options
Diffstat (limited to 'recipes-extended/glusterfs')
6 files changed, 339 insertions, 0 deletions
diff --git a/recipes-extended/glusterfs/files/0001-Fix-for-mount.glusterfs-not-accepting-version-argume.patch b/recipes-extended/glusterfs/files/0001-Fix-for-mount.glusterfs-not-accepting-version-argume.patch new file mode 100644 index 00000000..d89fde97 --- /dev/null +++ b/recipes-extended/glusterfs/files/0001-Fix-for-mount.glusterfs-not-accepting-version-argume.patch @@ -0,0 +1,33 @@ +From 960a101ab795fed1b7505ed9db61769cbdb9450e Mon Sep 17 00:00:00 2001 +From: Sebastian Lenartowicz <Sebastian.Lenartowicz@windriver.com> +Date: Wed, 4 Dec 2013 15:16:02 -0500 +Subject: [PATCH 1/1] Fix for mount.glusterfs not accepting --version argument + +The mount.glusterfs shell script serves as a convenient "gatekeeper" +for the glusterfs program itself, and performs a few setup tasks, +depending on the options it's given. However, an overzealous check +for the number of arguments (any number of arguments less than 2) +was preventing the --version and --help arguments from being usable +on their own. This patch solves that by dropping the check (the +glusterfs software itself can throw out commands with too few +arguments, which makes the check redundant in any event). +--- + xlators/mount/fuse/utils/mount.glusterfs.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in +index 2a8183c..ea18efb 100755 +--- a/xlators/mount/fuse/utils/mount.glusterfs.in ++++ b/xlators/mount/fuse/utils/mount.glusterfs.in +@@ -395,7 +395,7 @@ main () + pos_args=$((pos_args+1)) + fi + done +- if [ $in_opt = "yes" -o $pos_args -lt 2 ]; then ++ if [ $in_opt = "yes" ]; then + usage + exit 1 + fi +-- +1.7.9.7 + diff --git a/recipes-extended/glusterfs/files/glusterd-ovp b/recipes-extended/glusterfs/files/glusterd-ovp new file mode 100644 index 00000000..c0209286 --- /dev/null +++ b/recipes-extended/glusterfs/files/glusterd-ovp @@ -0,0 +1,93 @@ +#!/bin/bash +# +# chkconfig: 35 20 80 +# description: Gluster File System service for volume management +# + +# Get function from functions library +. /etc/init.d/functions + +BASE=glusterd +PIDFILE=/var/run/$BASE.pid +PID=`test -f $PIDFILE && cat $PIDFILE` +GLUSTERFSD=glusterfsd +GLUSTERFS=glusterfs +GLUSTERD_BIN=/usr/sbin/$BASE +GLUSTERD_OPTS="--pid-file=$PIDFILE" +GLUSTERD="$GLUSTERD_BIN $GLUSTERD_OPTS" +RETVAL=0 + +# Start the service $BASE +start() +{ + # Force creation of the log directory even on a tmpfs /var/log. + mkdir -p /var/log/glusterfs + + start-stop-daemon --stop --test --quiet --pidfile $PIDFILE + status=$? + if [ $status -eq 0 ]; then + echo "glusterd service is already running with pid $PID" + exit 1 + else + echo -n $"Starting $BASE:" + start-stop-daemon --start --pidfile $PIDFILE \ + --exec $GLUSTERD_BIN -- "$GLUSTERD_OPTS" + RETVAL=$? + echo + [ $RETVAL -ne 0 ] && exit $RETVAL + fi +} + +# Stop the service $BASE +stop() +{ + echo -n $"Stopping $BASE:" + start-stop-daemon --stop --test --quiet --pidfile $PIDFILE + status=$? + if [ $status -eq 0 ]; then + start-stop-daemon --stop --quiet --pidfile $PIDFILE + [ -w $PIDFILE ] && rm -f $PIDFILE + else + start-stop-daemon --stop --quiet --name $BASE + fi + + echo + pidof -c -o %PPID -x $GLUSTERFSD &> /dev/null + [ $? -eq 0 ] && start-stop-daemon --stop --quiet --name $GLUSTERFSD + + #pidof -c -o %PPID -x $GLUSTERFS &> /dev/null + #[ $? -eq 0 ] && start-stop-daemon --stop --quiet --name $GLUSTERFS + + if [ -f /etc/glusterd/nfs/run/nfs.pid ] ;then + pid=`cat /etc/glusterd/nfs/run/nfs.pid`; + cmd=`ps -p $pid -o comm=` + + if [ $cmd == "glusterfs" ]; then + start-stop-daemon --stop --quiet \ + --pidfile /etc/glusterd/nfs/run/nfs.pid + fi + fi +} + + +### service arguments ### +case $1 in + start) + start + ;; + stop) + stop + ;; + status) + status $BASE + ;; + restart | force-reload) + $0 stop + $0 start + ;; + *) + echo $"Usage: $0 {start|stop|status|restart}." + exit 1 +esac + +exit 0 diff --git a/recipes-extended/glusterfs/files/glusterfs-disable-default-startup-scripts.patch b/recipes-extended/glusterfs/files/glusterfs-disable-default-startup-scripts.patch new file mode 100644 index 00000000..4e0379ba --- /dev/null +++ b/recipes-extended/glusterfs/files/glusterfs-disable-default-startup-scripts.patch @@ -0,0 +1,25 @@ +The glusterfs code for installing start-up scripts checks for systemd +directories on the build host, and if it finds them, it chooses systemd +style scripts, otherwise init.d style scripts. This behavior might +conceivably be suitable for self-hosted builds, but it's grossly broken +for cross-build environments. Since we want to install custom WR scripts +regardless of which script style we support, we patch glusterfs so that +it doesn't install any of its default start-up scripts. + +Upstream-Status: Inappropriate [WR-specific change] +Signed-off-by: Donn Seeley <donn.seeley@windriver.com> +--- + extras/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/extras/Makefile.am ++++ b/extras/Makefile.am +@@ -2,7 +2,7 @@ + EditorModedir = $(docdir) + EditorMode_DATA = glusterfs-mode.el glusterfs.vim + +-SUBDIRS = init.d systemd benchmarking hook-scripts $(OCF_SUBDIR) LinuxRPM ++SUBDIRS = benchmarking hook-scripts $(OCF_SUBDIR) LinuxRPM + + confdir = $(sysconfdir)/glusterfs + conf_DATA = glusterfs-logrotate diff --git a/recipes-extended/glusterfs/files/xlator-host-contamination-3.4.patch b/recipes-extended/glusterfs/files/xlator-host-contamination-3.4.patch new file mode 100644 index 00000000..16cc47e0 --- /dev/null +++ b/recipes-extended/glusterfs/files/xlator-host-contamination-3.4.patch @@ -0,0 +1,44 @@ +Three of the translator makefiles in glusterfs add unnecessary +-L$(xlatordir) link options. This option causes the linker to check +the host's $(xlatordir) directory, resulting in contamination that gets +flagged by Yocto's QA rules. + +Upstream-Status: Pending +Signed-off-by: Donn Seeley <donn.seeley@windriver.com> +--- + xlators/mgmt/glusterd/src/Makefile.am | 2 -- + xlators/nfs/server/src/Makefile.am | 2 -- + xlators/system/posix-acl/src/Makefile.am | 2 -- + 3 files changed, 6 deletions(-) + +--- a/xlators/mgmt/glusterd/src/Makefile.am ++++ b/xlators/mgmt/glusterd/src/Makefile.am +@@ -33,8 +33,6 @@ AM_CPPFLAGS = $(GF_CPPFLAGS) -I$(top_src + + AM_CFLAGS = -Wall $(GF_CFLAGS) + +-AM_LDFLAGS = -L$(xlatordir) +- + CLEANFILES = + + install-data-hook: +--- a/xlators/nfs/server/src/Makefile.am ++++ b/xlators/nfs/server/src/Makefile.am +@@ -19,6 +19,4 @@ AM_CPPFLAGS = $(GF_CPPFLAGS) \ + + AM_CFLAGS = -Wall $(GF_CFLAGS) + +-AM_LDFLAGS = -L$(xlatordir) +- + CLEANFILES = +--- a/xlators/system/posix-acl/src/Makefile.am ++++ b/xlators/system/posix-acl/src/Makefile.am +@@ -10,8 +10,6 @@ AM_CPPFLAGS = $(GF_CPPFLAGS) -I$(top_src + + AM_CFLAGS = -Wall $(GF_CFLAGS) + +-AM_LDFLAGS = -L$(xlatordir) +- + CLEANFILES = + + access-control-compat: diff --git a/recipes-extended/glusterfs/glusterfs.inc b/recipes-extended/glusterfs/glusterfs.inc new file mode 100644 index 00000000..7a3f71a4 --- /dev/null +++ b/recipes-extended/glusterfs/glusterfs.inc @@ -0,0 +1,132 @@ +# +# Copyright (C) 2013 Wind River Systems, Inc. +# + +SUMMARY = "Glusterfs distributed filesystem" +DESCRIPTION = "\ + GlusterFS is an open source, distributed file system capable of scaling \ + to several petabytes (actually, 72 brontobytes!) and handling thousands \ + of clients. GlusterFS clusters together storage building blocks over \ + Infiniband RDMA or TCP/IP interconnect, aggregating disk and memory \ + resources and managing data in a single global namespace." +HOMEPAGE = "http://www.gluster.org/" +SECTION = "console/network" + +SRC_URI += "file://glusterd-ovp \ + file://xlator-host-contamination-3.4.patch \ + file://glusterfs-disable-default-startup-scripts.patch \ + file://0001-Fix-for-mount.glusterfs-not-accepting-version-argume.patch \ + " + +LICENSE = "(LGPLv3+ | GPLv2) & GPLv3+ & LGPLv3+ & GPLv2+ & LGPLv2+ & LGPLv2.1+ & Apache-2.0" +LIC_FILES_CHKSUM = "file://COPYING-GPLV2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://COPYING-LGPLV3;md5=e6a600fd5e1d9cbde2d983680233ad02 \ + file://contrib/fuse-util/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" + +inherit autotools update-rc.d pkgconfig + +DEPENDS += "bison-native flex-native fuse libaio libxml2 ncurses \ + openssl python readline zlib" + +EXTRA_OECONF = "ac_cv_file__etc_debian_version=no \ + ac_cv_file__etc_SuSE_release=no \ + ac_cv_file__etc_redhat_release=no \ + --with-mountutildir=${sbindir} \ + --disable-fusermount \ + PYTHON=${bindir}/python" + +PACKAGECONFIG ??= "georeplication" +PACKAGECONFIG[bd-xlator] = "--enable-bd-xlator,--disable-bd-xlator,lvm2," +PACKAGECONFIG[debug] = "--enable-debug,--disable-debug,," +PACKAGECONFIG[georeplication] = "--enable-georeplication,--disable-georeplication,,rsync" +PACKAGECONFIG[libibverbs] = "--enable-ibverbs,--disable-ibverbs,libibverbs librdmacm," +PACKAGECONFIG[ocf] = "--with-ocf,--without-ocf,," +PACKAGECONFIG[systemtap] = "--enable-systemtap,--disable-systemtap,systemtap," +PACKAGECONFIG[valgrind] = "--with-valgrind,--without-valgrind,valgrind," + +do_install_append() { + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/glusterd-ovp \ + ${D}${sysconfdir}/init.d/glusterd + + # Mount looks for mount.* plug-ins in /sbin; fix it with a symlink. + mkdir -p ${D}${base_sbindir} + (cd ${D}${base_sbindir}; ln -s ..${sbindir}/mount.glusterfs .) + + # These are plug-ins, so they don't need libtool configs. + find ${D}${libdir}/glusterfs/${PV} -name '*.la' -exec rm -f '{}' ';' + + # The RPM spec file creates these directories. + install -d ${D}${sysconfdir}/default/volatiles + cat > ${D}${sysconfdir}/default/volatiles/99_glusterfs << EOF +d root root 0755 ${localstatedir}/log/glusterfs none +d root root 0755 ${localstatedir}/run/gluster none +EOF +} + +INITSCRIPT_PACKAGES = "glusterfs-server" +INITSCRIPT_NAME = "glusterd" +INITSCRIPT_PARAMS = "start 20 5 3 2 . stop 80 0 1 6 ." + +# Allow plug-in symlinks. +INSANE_SKIP_${PN} += "dev-so" +INSANE_SKIP_${PN}-rdma += "dev-so" +INSANE_SKIP_${PN}-fuse += "dev-so" +INSANE_SKIP_${PN}-server += "dev-so" + +PACKAGES += "${PN}-rdma ${PN}-geo-replication ${PN}-fuse ${PN}-server \ + ${PN}-api ${PN}-ocf" + +FILES_${PN}-dbg += "${libdir}/glusterfs/${PV}/*/.debug \ + ${libdir}/glusterfs/${PV}/*/*/.debug \ + ${libdir}/glusterfs/${PV}/*/*/*/.debug \ + ${libexecdir}/glusterfs/.debug" + +FILES_${PN} = "${libdir}/glusterfs/${PV}/auth \ + ${libdir}/glusterfs/${PV}/rpc-transport/socket* \ + ${libdir}/glusterfs/${PV}/xlator/cluster \ + ${libdir}/glusterfs/${PV}/xlator/debug \ + ${libdir}/glusterfs/${PV}/xlator/encryption \ + ${libdir}/glusterfs/${PV}/xlator/features \ + ${libdir}/glusterfs/${PV}/xlator/performance \ + ${libdir}/glusterfs/${PV}/xlator/protocol/client* \ + ${libdir}/glusterfs/${PV}/xlator/system \ + ${libdir}/glusterfs/${PV}/xlator/testing \ + ${libdir}/libglusterfs.so.* \ + ${libdir}/libgfrpc.so.* \ + ${libdir}/libgfxdr.so.* \ + ${localstatedir} \ + ${sysconfdir}/default/volatiles \ + ${sbindir}/glusterfs \ + ${sbindir}/glusterfsd" + +FILES_${PN}-rdma = "${libdir}/glusterfs/${PV}/rpc-transport/rdma*" + +FILES_${PN}-geo-replication = "${libexecdir}/glusterfs/gsyncd \ + ${libexecdir}/glusterfs/python/syncdaemon" + +FILES_${PN}-fuse = "${bindir}/fusermount-glusterfs \ + ${libdir}/glusterfs/${PV}/xlator/mount \ + ${sbindir}/mount.glusterfs \ + ${base_sbindir}/mount.glusterfs" + +FILES_${PN}-server = "${libdir}/glusterfs/${PV}/xlator/mgmt \ + ${libdir}/glusterfs/${PV}/xlator/nfs \ + ${libdir}/glusterfs/${PV}/xlator/protocol/server* \ + ${libdir}/glusterfs/${PV}/xlator/storage \ + ${sbindir}/gluster \ + ${sbindir}/glusterd \ + ${sysconfdir}/glusterfs/glusterd.vol \ + ${sysconfdir}/glusterfs/glusterfs-logrotate \ + ${sysconfdir}/init.d/glusterd" + +# Note: Debian package renaming produces libgfapi[0-9]+-*.*.rpm. +FILES_${PN}-api = "${libdir}/libgfapi.so.*" + +FILES_${PN}-ocf = "${prefix}/lib/ocf" + +pkg_postinst_${PN}() { + if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ]; then + /etc/init.d/populate-volatile.sh update + fi +} diff --git a/recipes-extended/glusterfs/glusterfs_3.4.2.bb b/recipes-extended/glusterfs/glusterfs_3.4.2.bb new file mode 100644 index 00000000..b6ae856c --- /dev/null +++ b/recipes-extended/glusterfs/glusterfs_3.4.2.bb @@ -0,0 +1,12 @@ +# +# Copyright (C) 2013 Wind River Systems, Inc. +# + +PR = "r0" + +SRC_URI = "http://download.gluster.org/pub/gluster/glusterfs/3.4/${PV}/${BPN}-${PV}.tar.gz" + +SRC_URI[md5sum] = "7c05304a9aca3c85ff27458461783623" +SRC_URI[sha256sum] = "4fcd42b13b60a67587de98e60ff679803433bbb0c11aa2b40c4135e2358cedef" + +require glusterfs.inc |