diff options
author | Matti Bickel <mabi@gentoo.org> | 2007-10-05 14:03:13 +0000 |
---|---|---|
committer | Matti Bickel <mabi@gentoo.org> | 2007-10-05 14:03:13 +0000 |
commit | 26cf0502cfa81963c1ad8dafee0581f54b1e89f2 (patch) | |
tree | 273619c337da6c54641da246ebe20fc09844e7e2 /sys-cluster/pvfs2 | |
parent | DRDB package splitted in drbd + drbd-kernel, conversion to linux-mod, drbd-0... (diff) | |
download | gentoo-2-26cf0502cfa81963c1ad8dafee0581f54b1e89f2.tar.gz gentoo-2-26cf0502cfa81963c1ad8dafee0581f54b1e89f2.tar.bz2 gentoo-2-26cf0502cfa81963c1ad8dafee0581f54b1e89f2.zip |
revbump + cvs backport of kmem fix
(Portage version: 2.1.3.11)
Diffstat (limited to 'sys-cluster/pvfs2')
-rw-r--r-- | sys-cluster/pvfs2/ChangeLog | 13 | ||||
-rw-r--r-- | sys-cluster/pvfs2/files/2.6.3-as-needed.patch | 20 | ||||
-rw-r--r-- | sys-cluster/pvfs2/files/2.6.3-kmem-and-dtor-fix.patch | 265 | ||||
-rw-r--r-- | sys-cluster/pvfs2/files/2.6.3-link-librt-properly.patch | 12 | ||||
-rw-r--r-- | sys-cluster/pvfs2/files/2.6.3-no-pointer-sign.patch | 15 | ||||
-rw-r--r-- | sys-cluster/pvfs2/files/2.6.3-register_sysctl_table.patch | 11 | ||||
-rw-r--r-- | sys-cluster/pvfs2/files/2.6.3-soname.patch | 11 | ||||
-rw-r--r-- | sys-cluster/pvfs2/files/digest-pvfs2-2.6.3 | 3 | ||||
-rw-r--r-- | sys-cluster/pvfs2/files/pvfs2-client-init.d | 76 | ||||
-rw-r--r-- | sys-cluster/pvfs2/files/pvfs2-client.conf | 15 | ||||
-rw-r--r-- | sys-cluster/pvfs2/files/pvfs2-server.conf | 29 | ||||
-rw-r--r-- | sys-cluster/pvfs2/files/pvfs2-server.rc | 107 | ||||
-rw-r--r-- | sys-cluster/pvfs2/pvfs2-2.6.3.ebuild | 113 |
13 files changed, 689 insertions, 1 deletions
diff --git a/sys-cluster/pvfs2/ChangeLog b/sys-cluster/pvfs2/ChangeLog index f8f8448c356b..a112ea8708bf 100644 --- a/sys-cluster/pvfs2/ChangeLog +++ b/sys-cluster/pvfs2/ChangeLog @@ -1,6 +1,17 @@ # ChangeLog for sys-cluster/pvfs2 # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-cluster/pvfs2/ChangeLog,v 1.5 2007/04/26 06:18:11 dberkholz Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/pvfs2/ChangeLog,v 1.6 2007/10/05 14:03:12 mabi Exp $ + +*pvfs2-2.6.3 (05 Oct 2007) + + 05 Oct 2007; Matti Bickel <mabi@gentoo.org> +files/2.6.3-as-needed.patch, + +files/2.6.3-kmem-and-dtor-fix.patch, + +files/2.6.3-link-librt-properly.patch, + +files/2.6.3-no-pointer-sign.patch, + +files/2.6.3-register_sysctl_table.patch, +files/2.6.3-soname.patch, + +files/pvfs2-client.conf, +files/pvfs2-client-init.d, + +files/pvfs2-server.conf, +files/pvfs2-server.rc, +pvfs2-2.6.3.ebuild: + revbump to 2.6.3 + backported kmem fix 26 Apr 2007; Donnie Berkholz <dberkholz@gentoo.org>; metadata.xml: Update for cluster herd split to hp-cluster and ha-cluster. diff --git a/sys-cluster/pvfs2/files/2.6.3-as-needed.patch b/sys-cluster/pvfs2/files/2.6.3-as-needed.patch new file mode 100644 index 000000000000..01cff1e2ef76 --- /dev/null +++ b/sys-cluster/pvfs2/files/2.6.3-as-needed.patch @@ -0,0 +1,20 @@ +--- maint/config/openssl.m4~ 2007-04-16 04:17:53.000000000 +0200 ++++ maint/config/openssl.m4 2007-04-16 04:17:53.000000000 +0200 +@@ -12,7 +12,7 @@ + LDFLAGS="$LDFLAGS -L${opensslpath}/lib64 -L${opensslpath}/lib" + SERVER_LDFLAGS="$SERVER_LDFLAGS -L${opensslpath}/lib64 -L${opensslpath}/lib" + fi +- LIBS="$LIBS -lcrypt -lssl" ++ LIBS="$LIBS -lcrypt -lcrypto -lssl" + + AC_COMPILE_IFELSE( + [#include "openssl/bio.h"], +@@ -36,7 +36,7 @@ + [ + AC_MSG_CHECKING([for openssl library]) + TMPLIBS=${LIBS} +- LIBS="$LIBS -lcrypt -lssl" ++ LIBS="$LIBS -lcrypt -lcrypto -lssl" + + AC_COMPILE_IFELSE( + [#include "openssl/bio.h"], diff --git a/sys-cluster/pvfs2/files/2.6.3-kmem-and-dtor-fix.patch b/sys-cluster/pvfs2/files/2.6.3-kmem-and-dtor-fix.patch new file mode 100644 index 000000000000..9ad531578767 --- /dev/null +++ b/sys-cluster/pvfs2/files/2.6.3-kmem-and-dtor-fix.patch @@ -0,0 +1,265 @@ +diff -u -r pvfs-2.6.3/src/kernel/linux-2.6/pvfs2-cache.c pvfs-2.6.3-new/src/kernel/linux-2.6/pvfs2-cache.c +--- pvfs-2.6.3/src/kernel/linux-2.6/pvfs2-cache.c 2007-10-02 14:54:45.000000000 +0200 ++++ pvfs-2.6.3-new/src/kernel/linux-2.6/pvfs2-cache.c 2007-10-02 14:49:10.000000000 +0200 +@@ -203,14 +203,7 @@ + pvfs2_kmem_cache_t * cachep, + unsigned long flags) + { +- if (flags & SLAB_CTOR_CONSTRUCTOR) +- { +- memset(req, 0, sizeof(MAX_ALIGNED_DEV_REQ_DOWNSIZE)); +- } +- else +- { +- gossip_err("WARNING!! devreq_ctor called without ctor flag\n"); +- } ++ memset(req, 0, sizeof(MAX_ALIGNED_DEV_REQ_DOWNSIZE)); + } + + int dev_req_cache_initialize(void) +@@ -269,45 +262,24 @@ + { + pvfs2_inode_t *pvfs2_inode = (pvfs2_inode_t *)new_pvfs2_inode; + +- if (flags & SLAB_CTOR_CONSTRUCTOR) +- { +- memset(pvfs2_inode, 0, sizeof(pvfs2_inode_t)); +- ClearInitFlag(pvfs2_inode); ++ memset(pvfs2_inode, 0, sizeof(pvfs2_inode_t)); ++ ClearInitFlag(pvfs2_inode); + +- pvfs2_inode_initialize(pvfs2_inode); ++ pvfs2_inode_initialize(pvfs2_inode); + + #ifndef PVFS2_LINUX_KERNEL_2_4 +- /* +- inode_init_once is from 2.6.x's inode.c; it's normally run +- when an inode is allocated by the system's inode slab +- allocator. we call it here since we're overloading the +- system's inode allocation with this routine, thus we have +- to init vfs inodes manually +- */ +- inode_init_once(&pvfs2_inode->vfs_inode); +- pvfs2_inode->vfs_inode.i_version = 1; ++ /* ++ inode_init_once is from 2.6.x's inode.c; it's normally run ++ when an inode is allocated by the system's inode slab ++ allocator. we call it here since we're overloading the ++ system's inode allocation with this routine, thus we have ++ to init vfs inodes manually ++ */ ++ inode_init_once(&pvfs2_inode->vfs_inode); ++ pvfs2_inode->vfs_inode.i_version = 1; + #endif +- /* Initialize the reader/writer semaphore */ +- init_rwsem(&pvfs2_inode->xattr_sem); +- } +- else +- { +- gossip_err("WARNING!! inode_ctor called without ctor flag\n"); +- } +-} +- +-static void pvfs2_inode_cache_dtor( +- void *old_pvfs2_inode, +- pvfs2_kmem_cache_t * cachep, +- unsigned long flags) +-{ +- pvfs2_inode_t *pvfs2_inode = (pvfs2_inode_t *)old_pvfs2_inode; +- +- if (pvfs2_inode && pvfs2_inode->link_target) +- { +- kfree(pvfs2_inode->link_target); +- pvfs2_inode->link_target = NULL; +- } ++ /* Initialize the reader/writer semaphore */ ++ init_rwsem(&pvfs2_inode->xattr_sem); + } + + static inline void add_to_pinode_list(pvfs2_inode_t *pvfs2_inode) +@@ -330,8 +302,7 @@ + { + pvfs2_inode_cache = kmem_cache_create( + "pvfs2_inode_cache", sizeof(pvfs2_inode_t), 0, +- PVFS2_CACHE_CREATE_FLAGS, pvfs2_inode_cache_ctor, +- pvfs2_inode_cache_dtor); ++ PVFS2_CACHE_CREATE_FLAGS, pvfs2_inode_cache_ctor, NULL); + + if (!pvfs2_inode_cache) + { +@@ -403,14 +374,7 @@ + pvfs2_kmem_cache_t * cachep, + unsigned long flags) + { +- if (flags & SLAB_CTOR_CONSTRUCTOR) +- { +- memset(req, 0, sizeof(pvfs2_kiocb)); +- } +- else +- { +- gossip_err("WARNING!! kiocb_ctor called without ctor flag\n"); +- } ++ memset(req, 0, sizeof(pvfs2_kiocb)); + } + + +diff -u -r pvfs-2.6.3/src/kernel/linux-2.6/pvfs2-kernel.h pvfs-2.6.3-new/src/kernel/linux-2.6/pvfs2-kernel.h +--- pvfs-2.6.3/src/kernel/linux-2.6/pvfs2-kernel.h 2007-10-02 14:54:45.000000000 +0200 ++++ pvfs-2.6.3-new/src/kernel/linux-2.6/pvfs2-kernel.h 2007-10-02 14:49:10.000000000 +0200 +@@ -47,6 +47,7 @@ + #include <linux/statfs.h> + #include <linux/buffer_head.h> + #include <linux/backing-dev.h> ++#include <linux/device.h> + #include <linux/mpage.h> + #include <linux/namei.h> + #include <linux/errno.h> +@@ -363,7 +364,7 @@ + typedef struct + { + PVFS_object_ref refn; +- char *link_target; ++ char link_target[PVFS_NAME_MAX]; + /* + * Reading/Writing Extended attributes need to acquire the appropriate + * reader/writer semaphore on the pvfs2_inode_t structure. +@@ -571,6 +572,15 @@ + + #endif + ++typedef struct pvfs2_stats { ++ unsigned long cache_hits; ++ unsigned long cache_misses; ++ unsigned long reads; ++ unsigned long writes; ++} pvfs2_stats; ++ ++extern pvfs2_stats g_pvfs2_stats; ++ + /* + NOTE: See Documentation/filesystems/porting for information + on implementing FOO_I and properly accessing fs private data +@@ -821,8 +831,8 @@ + * defined in devpvfs2-req.c + ****************************/ + +-int pvfs2_ioctl32_init(void); +-void pvfs2_ioctl32_cleanup(void); ++int pvfs2_dev_init(void); ++void pvfs2_dev_cleanup(void); + int is_daemon_in_service(void); + int fs_mount_pending(PVFS_fs_id fsid); + +@@ -1250,6 +1260,18 @@ + } + #endif + ++#ifndef HAVE_KZALLOC ++static void *kzalloc(size_t size, gfp_t mask) ++{ ++ void *ptr; ++ ptr = kmalloc(size, mask); ++ if (ptr) { ++ memset(ptr, 0, size); ++ } ++ return ptr; ++} ++#endif ++ + #endif /* PVFS2_LINUX_KERNEL_2_4 */ + + static inline unsigned int diff(struct timeval *end, struct timeval *begin) +@@ -1268,11 +1290,10 @@ + void * ptr; + + ptr = kmalloc(size, flags); +- if(!ptr) ++ if (ptr) + { +- return ptr; ++ memset(ptr, 0, size); + } +- memset(ptr, 0, size); + return ptr; + } + #endif +diff -u -r pvfs-2.6.3/src/kernel/linux-2.6/pvfs2-utils.c pvfs-2.6.3-new/src/kernel/linux-2.6/pvfs2-utils.c +--- pvfs-2.6.3/src/kernel/linux-2.6/pvfs2-utils.c 2007-10-02 14:54:45.000000000 +0200 ++++ pvfs-2.6.3-new/src/kernel/linux-2.6/pvfs2-utils.c 2007-10-02 15:04:12.000000000 +0200 +@@ -101,18 +101,24 @@ + static void pvfs2_set_inode_flags(struct inode *inode, + PVFS_sys_attr *attrs) + { +- if (attrs->flags & PVFS_IMMUTABLE_FL) ++ if (attrs->flags & PVFS_IMMUTABLE_FL) { + inode->i_flags |= S_IMMUTABLE; +- else ++ } ++ else { + inode->i_flags &= ~S_IMMUTABLE; +- if (attrs->flags & PVFS_APPEND_FL) ++ } ++ if (attrs->flags & PVFS_APPEND_FL) { + inode->i_flags |= S_APPEND; +- else ++ } ++ else { + inode->i_flags &= ~S_APPEND; +- if (attrs->flags & PVFS_NOATIME_FL) ++ } ++ if (attrs->flags & PVFS_NOATIME_FL) { + inode->i_flags |= S_NOATIME; +- else ++ } ++ else { + inode->i_flags &= ~S_NOATIME; ++ } + return; + } + +@@ -288,17 +294,7 @@ + /* copy link target to inode private data */ + if (pvfs2_inode && symname) + { +- if (pvfs2_inode->link_target) +- { +- kfree(pvfs2_inode->link_target); +- pvfs2_inode->link_target = NULL; +- } +- pvfs2_inode->link_target = kmalloc( +- (strlen(symname) + 1), PVFS2_GFP_FLAGS); +- if (pvfs2_inode->link_target) +- { +- strcpy(pvfs2_inode->link_target, symname); +- } ++ strncpy(pvfs2_inode->link_target, symname, PVFS_NAME_MAX); + gossip_debug(GOSSIP_UTILS_DEBUG, "Copied attr link target %s\n", + pvfs2_inode->link_target); + } +@@ -1791,7 +1787,8 @@ + { + void *buf; + +- buf = kmalloc(sizeof(pvfs2_opaque_handle_t), PVFS2_BUFMAP_GFP_FLAGS); ++ buf = kmalloc(sizeof(pvfs2_opaque_handle_t), ++ PVFS2_BUFMAP_GFP_FLAGS); + return buf; + } + +@@ -1956,7 +1953,7 @@ + pvfs2_inode->refn.handle = PVFS_HANDLE_NULL; + pvfs2_inode->refn.fs_id = PVFS_FS_ID_NULL; + pvfs2_inode->last_failed_block_index_read = 0; +- pvfs2_inode->link_target = NULL; ++ memset(pvfs2_inode->link_target, 0, sizeof(pvfs2_inode->link_target)); + pvfs2_inode->error_code = 0; + SetInitFlag(pvfs2_inode); + } +@@ -1964,7 +1961,6 @@ + + /* + this is called from super:pvfs2_destroy_inode. +- pvfs2_inode_cache_dtor frees the link_target if any + */ + void pvfs2_inode_finalize(pvfs2_inode_t *pvfs2_inode) + { diff --git a/sys-cluster/pvfs2/files/2.6.3-link-librt-properly.patch b/sys-cluster/pvfs2/files/2.6.3-link-librt-properly.patch new file mode 100644 index 000000000000..ac85f016924e --- /dev/null +++ b/sys-cluster/pvfs2/files/2.6.3-link-librt-properly.patch @@ -0,0 +1,12 @@ +diff -urN pvfs-2.6.0.orig/maint/config/rt.m4 pvfs-2.6.0/maint/config/rt.m4 +--- pvfs-2.6.0.orig/maint/config/rt.m4 2006-12-10 23:16:47.000000000 -0800 ++++ pvfs-2.6.0/maint/config/rt.m4 2006-12-10 23:36:17.000000000 -0800 +@@ -12,7 +12,7 @@ + [lio_listio(LIO_NOWAIT, NULL, 0, NULL);], + [AC_MSG_RESULT(no)], + [ +- LDFLAGS="$LDFLAGS -lrt" ++ LIBS="$LIBS -lrt" + AC_TRY_LINK( + [#include <stdlib.h> + #include <unistd.h> diff --git a/sys-cluster/pvfs2/files/2.6.3-no-pointer-sign.patch b/sys-cluster/pvfs2/files/2.6.3-no-pointer-sign.patch new file mode 100644 index 000000000000..39a12fecef0f --- /dev/null +++ b/sys-cluster/pvfs2/files/2.6.3-no-pointer-sign.patch @@ -0,0 +1,15 @@ +--- maint/config/kernel.m4.old 2007-04-30 16:46:16.000000000 +0200 ++++ maint/config/kernel.m4 2007-04-30 16:48:26.000000000 +0200 +@@ -348,11 +348,8 @@ + ) + fi + +- dnl we need the compiler to error on warnings about prototypes, but +- dnl certain Fedora FC5 kernel header files throw extra (spurious) +- dnl warnings, which -Wno-pointer-sign silences. ++ + tmp_cflags=$CFLAGS +- CFLAGS="$CFLAGS -Werror -Wno-pointer-sign" + dnl if this test passes, there is a struct dentry* argument + AC_MSG_CHECKING(if statfs callbacks' arguments in kernel has struct dentry argument) + dnl if this test passes, the kernel has it diff --git a/sys-cluster/pvfs2/files/2.6.3-register_sysctl_table.patch b/sys-cluster/pvfs2/files/2.6.3-register_sysctl_table.patch new file mode 100644 index 000000000000..11e8e2f81e21 --- /dev/null +++ b/sys-cluster/pvfs2/files/2.6.3-register_sysctl_table.patch @@ -0,0 +1,11 @@ +--- src/kernel/linux-2.6/pvfs2-proc.c.old 2007-04-30 10:02:55.000000000 +0200 ++++ src/kernel/linux-2.6/pvfs2-proc.c 2007-04-30 10:01:50.000000000 +0200 +@@ -337,7 +337,7 @@ + #ifdef CONFIG_SYSCTL + if (!fs_table_header) + { +- fs_table_header = register_sysctl_table(fs_table, 0); ++ fs_table_header = register_sysctl_table(fs_table); + } + #endif + diff --git a/sys-cluster/pvfs2/files/2.6.3-soname.patch b/sys-cluster/pvfs2/files/2.6.3-soname.patch new file mode 100644 index 000000000000..c6bea01ab4e1 --- /dev/null +++ b/sys-cluster/pvfs2/files/2.6.3-soname.patch @@ -0,0 +1,11 @@ +--- Makefile.in 2007-04-15 11:11:51.000000000 +0200 ++++ Makefile.in 2007-04-15 11:11:51.000000000 +0200 +@@ -591,7 +591,7 @@ + lib/libpvfs2.so: $(LIBPICOBJS) + $(Q) " LDSO $@" + $(E)$(INSTALL) -d lib +- $(E)$(LDSHARED) -o $@ $(LIBPICOBJS) ++ $(E)$(LDSHARED) -Wl,-soname,libpvfs2.so -o $@ $(LIBPICOBJS) + + # rule for building the pvfs2 _multithreaded_ library + lib/libpvfs2-threaded.so: $(LIBTHREADEDPICOBJS) diff --git a/sys-cluster/pvfs2/files/digest-pvfs2-2.6.3 b/sys-cluster/pvfs2/files/digest-pvfs2-2.6.3 new file mode 100644 index 000000000000..821ea2e0e1e1 --- /dev/null +++ b/sys-cluster/pvfs2/files/digest-pvfs2-2.6.3 @@ -0,0 +1,3 @@ +MD5 f7ba22bb0b4bdaadb69ca1c2d8e102a4 pvfs-2.6.3.tar.gz 3971014 +RMD160 a2dcfcf60bde46a3f99b1cc490e9148fdbaacda6 pvfs-2.6.3.tar.gz 3971014 +SHA256 e8468c277b8832ef26308400a41244fad6e98f38ffcfd417b42aae9f796c03f6 pvfs-2.6.3.tar.gz 3971014 diff --git a/sys-cluster/pvfs2/files/pvfs2-client-init.d b/sys-cluster/pvfs2/files/pvfs2-client-init.d new file mode 100644 index 000000000000..8ed8eea751ec --- /dev/null +++ b/sys-cluster/pvfs2/files/pvfs2-client-init.d @@ -0,0 +1,76 @@ +#!/sbin/runscript +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/pvfs2/files/pvfs2-client-init.d,v 1.1 2007/10/05 14:03:13 mabi Exp $ + + +depend() { + need net + need localmount + before pbs_mom + after pvfs2-server +} + +checkconfig() { + if [ ! -x "${PVFS2_CLIENT}" ] || [ ! -x "${PVFS2_CLIENT_CORE}" ]; then + eend 1 "pvfs-2 was not correctly installed." + return 1 + fi + + if [ ! -d "${PVFS2_MOUNTPOINT}" ]; then + ewarn "Creating ${PVFS2_MOUNTPOINT}" + mkdir -p ${PVFS2_MOUNTPOINT} || return 1 + fi + + local piddir=$(dirname ${PVFS2_CLIENT_PIDFILE}) + if [ ! -d "${piddir}" ]; then + ewarn "Creating ${piddir}" + mkdir -p ${piddir} || return 1 + fi + + return 0 +} + +start() { + ebegin "Starting pvfs2-client" + local rc=0 + + $(lsmod | egrep "^pvfs2 " &> /dev/null) || modprobe pvfs2 + if [[ $? -ne 0 ]]; then + eend 1 "Failed to load the pvfs2 module" + return 1 + fi + + # -f so start-stop-daemon can snag the pid. + start-stop-daemon --start -q -b -m -p ${PVFS2_CLIENT_PIDFILE} \ + --exec ${PVFS2_CLIENT} -- -f -p ${PVFS2_CLIENT_CORE} ${PVFS2_CLIENT_ARGS} + rc=$? + + if [[ $rc -ne 0 ]]; then + eend ${rc} "Failed to run pvfs2-client" + return ${rc} + fi + + mount -t pvfs2 tcp://${PVFS2_SERVER_HOST}:3334/pvfs2-fs "${PVFS2_MOUNTPOINT}" + rc=$? + if [[ $rc -ne 0 ]]; then + eend 1 "Failed to mount the pvfs2 filesystem on ${PVFS2_MOUNTPOINT}" + return 1 + fi + + eend ${rc} +} + +stop() { + ebegin "Stopping pvfs2-client" + if [ -n "$(mount | awk '{print $3}' | grep ${PVFS2_MOUNTPOINT})" ]; then + umount -f ${PVFS2_MOUNTPOINT} + fi + + start-stop-daemon --stop -p ${PVFS2_CLIENT_PIDFILE} + + modprobe -r pvfs2 + + eend $? +} + diff --git a/sys-cluster/pvfs2/files/pvfs2-client.conf b/sys-cluster/pvfs2/files/pvfs2-client.conf new file mode 100644 index 000000000000..72b8cc29a78b --- /dev/null +++ b/sys-cluster/pvfs2/files/pvfs2-client.conf @@ -0,0 +1,15 @@ +# Extra arguments to supply to the pvfs2-client daemon +#PVFS2_CLIENT_ARGS="-L /var/log/pvfs2-client.log" + +# Location of the pvfs2-client binaries. Defaults are shown +PVFS2_CLIENT="/usr/sbin/pvfs2-client" +PVFS2_CLIENT_CORE="/usr/sbin/pvfs2-client-core" + +# Location to mount the pvfs2 filesystem +PVFS2_MOUNTPOINT="/pfs" + +# A pvfs2 metadata server. +PVFS2_SERVER_HOST="localhost" + +# Location to store pid +PVFS2_CLIENT_PIDFILE="/var/run/pvfs2-client.pid" diff --git a/sys-cluster/pvfs2/files/pvfs2-server.conf b/sys-cluster/pvfs2/files/pvfs2-server.conf new file mode 100644 index 000000000000..1779a870bf97 --- /dev/null +++ b/sys-cluster/pvfs2/files/pvfs2-server.conf @@ -0,0 +1,29 @@ +# The three following variables set where pvfs2 will find the fs and server +# configuration files. If you don't set anything, these default to +# ${PVFS2_CONF_PATH}/pvfs2-<server/fs>.conf +PVFS2_FS_CONF="" + +# You can set either of the following. If PVFS2_SERVER_CONF is set, we +# look for that exact config file. If PVFS2_SERVER_CONF_BASE is set, +# we look for ${PVFS2_SERVER_CONF_BASE}-$(hostname -s). The latter +# is useful when distributing an image across multiple machines. When +# both are defined, preference is given to the the latter. +PVFS2_SERVER_CONF="" +PVFS2_SERVER_CONF_BASE="" + + +# your server binary, default is shown. +PVFS2SERVER=/usr/sbin/pvfs2-server + +# location of your config files +PVFS2_CONF_PATH=/etc + +# the server will record its PID in this file using the -p argument +PVFS2_PIDFILE=/var/run/pvfs2.pid + +#Additional options +PVFS2_OPTIONS="" + +# Automatically call pvfs2-server with --mkfs when we detect that the +# server is not continuing to run? +PVFS2_AUTO_MKFS=0 diff --git a/sys-cluster/pvfs2/files/pvfs2-server.rc b/sys-cluster/pvfs2/files/pvfs2-server.rc new file mode 100644 index 000000000000..4706159e166a --- /dev/null +++ b/sys-cluster/pvfs2/files/pvfs2-server.rc @@ -0,0 +1,107 @@ +#!/sbin/runscript +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/pvfs2/files/pvfs2-server.rc,v 1.1 2007/10/05 14:03:13 mabi Exp $ + +checkconfig() { + local piddir=$(dirname "${PVFS2_PIDFILE}") + if [ ! -d "${piddir}" ]; then + mkdir -p "${piddir}" || return 1 + fi + + # verify presence of server binary + if ! [ -x "${PVFS2SERVER}" ]; then + eerror "Error: could not find executable ${PVFS2SERVER}" + return 1 + fi + + # look for fs conf + if [ -n "${PVFS2_FS_CONF}" ]; then + PVFS2_FS_CONF="${PVFS2_CONF_PATH}/${PVFS2_FS_CONF}" + else + PVFS2_FS_CONF="${PVFS2_CONF_PATH}"/pvfs2-fs.conf + fi + + if ! [ -r "${PVFS2_FS_CONF}" ]; then + eerror "Error: could not read ${PVFS2_FS_CONF}" + return 1 + fi + + # look for server conf + if [ -n "${PVFS2_SERVER_CONF_BASE}" ]; then + local myhost=`hostname -s` + if [ "${myhost}" == "localhost" ]; then + ewarn "Warning: detected hostname as localhost, may confuse PVFS2 startup" + fi + PVFS2_SERVER_CONF="${PVFS2_CONF_PATH}/${PVFS2_SERVER_CONF_BASE}-${myhost}" + elif [ -n "${PVFS2_SERVER_CONF}" ]; then + PVFS2_SERVER_CONF="${PVFS2_CONF_PATH}/${PVFS2_SERVER_CONF}" + else + PVFS2_SERVER_CONF="${PVFS2_CONF_PATH}/pvfs2-server.conf" + fi + + if ! [ -r "${PVFS2_SERVER_CONF}" ]; then + eerror "Error: could not read ${PVFS2_SERVER_CONF}" + return 1 + fi +} + +depend() { + after localmount netmount nfsmount dns + use net +} + +start() { + ebegin "Starting PVFS2 server" + local rc + checkconfig || return 1 + + start-stop-daemon -b --start --quiet \ + --pidfile "${PVFS2_PIDFILE}" \ + --exec "${PVFS2SERVER}" -- -p "${PVFS2_PIDFILE}" ${PVFS2_OPTIONS} \ + "${PVFS2_FS_CONF}" "${PVFS2_SERVER_CONF}" + rc=$? + + # Optionally force pvfs2-server to generate the pvfs2 filesystem. + if [[ $PVFS2_AUTO_MKFS -ne 0 ]]; then + local test_pid + sleep 1 + test_pid=$(pidof pvfs2-server) + if [ -z "$test_pid" ] || [ ! -f "${PVFS2_PIDFILE}" ] || [[ $test_pid -ne `cat ${PVFS2_PIDFILE}` ]]; then + rm -f "${PVFS2_PIDFILE}" &>/dev/null + ewarn "Initializing the file system storage with --mkfs" + "${PVFS2SERVER}" --mkfs "${PVFS2_FS_CONF}" "${PVFS2_SERVER_CONF}" + rc=$? + if [[ $rc -ne 0 ]]; then + eerror "Failed to initialize the filesystem storage with --mkfs" + eend ${rc} + return 1 + fi + start-stop-daemon -b --start --quiet \ + --pidfile ${PVFS2_PIDFILE} \ + --exec ${PVFS2SERVER} -- -p "${PVFS2_PIDFILE}" ${PVFS2_OPTIONS} \ + "${PVFS2_FS_CONF}" "${PVFS2_SERVER_CONF}" + rc=$? + fi + fi + + if [[ $rc -ne 0 ]]; then + eend $rc "Error starting PVFS2 server" + return 1 + else + eend 0 + return 0 + fi +} + +stop() { + ebegin "Stopping PVFS2 server" + start-stop-daemon --stop --quiet --pidfile "${PVFS2_PIDFILE}" + eend $? "Error stopping PVFS2 server" +} + +restart() { + svc_stop + sleep 2 + svc_start +} diff --git a/sys-cluster/pvfs2/pvfs2-2.6.3.ebuild b/sys-cluster/pvfs2/pvfs2-2.6.3.ebuild new file mode 100644 index 000000000000..66a3574f20b3 --- /dev/null +++ b/sys-cluster/pvfs2/pvfs2-2.6.3.ebuild @@ -0,0 +1,113 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/pvfs2/pvfs2-2.6.3.ebuild,v 1.1 2007/10/05 14:03:12 mabi Exp $ + +inherit linux-mod autotools toolchain-funcs + +MY_PN="${PN%[0-9]*}" +MY_P="${MY_PN}-${PV}" +DESCRIPTION="Parallel Virtual File System version 2" +HOMEPAGE="http://www.pvfs.org/pvfs2/" +SRC_URI="ftp://ftp.parl.clemson.edu/pub/pvfs2/${MY_P}.tar.gz" +IUSE="gtk static doc" +RDEPEND="gtk? ( >=x11-libs/gtk+-2 ) + sys-libs/db" +DEPEND="${RDEPEND} + virtual/linux-sources" +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="~ppc ~x86" +S="${WORKDIR}/${MY_P}" + +#Without this, the make kmod_install in src_install() would fail. +#ARCH=$(tc-arch-kernel) + +pkg_setup() { + linux-mod_pkg_setup + + if kernel_is 2 4; then + BUILD_TARGETS="just_kmod24" + ECONF_PARAMS="--with-kernel24=${KV_DIR}" + MODULE_NAMES="pvfs2(fs::src/kernel/linux-2.4)" + else + BUILD_TARGETS="just_kmod" + ECONF_PARAMS="--with-kernel=${KV_DIR} --enable-verbose-build" + MODULE_NAMES="pvfs2(fs::src/kernel/linux-2.6)" + fi + + #Notice I don't include --disable-static because it makes the linker fail due to a missing library + #needed by LIBS_THREADED += -lpvfs2-threaded. However that library is only compiled if static is enabled. Anyway + #it is used to build pvfs2-client-core-threaded, which is not installed by make kmod_install (unstable perhaps?) + ECONF_PARAMS="${ECONF_PARAMS} --enable-mmap-racache $(use_enable !static shared)" + ECONF_PARAMS="${ECONF_PARAMS} $(use_enable gtk karma)" +} + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}"/${PN}-1.5.1-destdir.patch + epatch "${FILESDIR}"/${PV}-link-librt-properly.patch + epatch "${FILESDIR}"/${PV}-soname.patch + epatch "${FILESDIR}"/${PV}-as-needed.patch + + #Fix so we can install kernapps separate from kmod_install + sed -i '/^kmod_install: kmod/{ + s/\(kmod_install:.*kernapps\)\(.*\)/\1_install\2\n.PHONY: kernapps_install\nkernapps_install: kernapps/}' Makefile.in + sed -i '/^kmod24_install: kmod/{ + s/\(kmod24_install:.*kernapps\)\(.*\)/\1_install\2\n.PHONY: kernapps_install\nkernapps_install: kernapps/}' Makefile.in + + if kernel_is gt 2 6 20 ; then + epatch "${FILESDIR}"/${PV}-register_sysctl_table.patch + fi + + if kernel_is ge 2 6 22 ; then + epatch "${FILESDIR}"/${PV}-kmem-and-dtor-fix.patch + fi + + #This is needed when gcc doesn't support -Wno-pointer-sign. Now it will give us some warnings so it also removes -Werror. + #It's unsafe, not recommended + if [ "$(gcc-major-version)" -lt "4" ]; then + ewarn "It's recommended to use gcc >= 4.0 to avoid the following patch" + epatch "${FILESDIR}"/${PV}-no-pointer-sign.patch + fi + + AT_M4DIR="maint/config" eautoreconf +} + +src_compile() { + econf ${ECONF_PARAMS} || die "Unable to run econf ${ECONF_PARAMS}" + linux-mod_src_compile || die "Unable to linux-mod_src_compile" + emake kernapps || die "Unable to make kernapps." + emake all || die "Unable to make all." +} + +src_install() { + linux-mod_src_install || die "linux-mod_src_install failed" + emake DESTDIR="${D}" kernapps_install || die "kernapps_install failed" + emake DESTDIR="${D}" install || die "install failed" + newinitd "${FILESDIR}"/pvfs2-server.rc pvfs2-server + newconfd "${FILESDIR}"/pvfs2-server.conf pvfs2-server + newinitd "${FILESDIR}"/pvfs2-client-init.d pvfs2-client + newconfd "${FILESDIR}"/pvfs2-client.conf pvfs2-client + dodoc AUTHORS CREDITS ChangeLog INSTALL README + docinto examples + dodoc examples/{fs.conf,pvfs2-server.rc,server.conf-localhost} + # this is LARGE (~5mb) + if use doc; then + docdir="/usr/share/doc/${PF}/" + cp -pPR "${S}"/doc "${D}${docdir}" + rm -rf "${D}${docdir}"/man + fi +} + +pkg_preinst() { + linux-mod_pkg_preinst +} + +pkg_postinst() { + linux-mod_pkg_postinst + elog "To enable PVFS2 Server on boot you will have to add it to the" + elog "default profile, issue the following command as root to do so." + elog + elog "rc-update add pvfs2-server default" +} |