diff options
author | Achim Gottinger <achim@gentoo.org> | 2001-06-01 02:39:08 +0000 |
---|---|---|
committer | Achim Gottinger <achim@gentoo.org> | 2001-06-01 02:39:08 +0000 |
commit | 869ac65245d3972ea7ae56c63b995dca84219af8 (patch) | |
tree | 6db084d7d57879af9fbc2fab16e0b2c15cfc499f /net-fs | |
parent | fixed pkg_preinst to work on an empty fs (such as when merging w/ a different... (diff) | |
download | gentoo-2-869ac65245d3972ea7ae56c63b995dca84219af8.tar.gz gentoo-2-869ac65245d3972ea7ae56c63b995dca84219af8.tar.bz2 gentoo-2-869ac65245d3972ea7ae56c63b995dca84219af8.zip |
*** empty log message ***
Diffstat (limited to 'net-fs')
-rw-r--r-- | net-fs/openafs/files/CellServDB | 2 | ||||
-rw-r--r-- | net-fs/openafs/files/ThisCell | 1 | ||||
-rw-r--r-- | net-fs/openafs/files/afs.rc | 184 | ||||
-rw-r--r-- | net-fs/openafs/files/digest-openafs-1.0.4-r1 | 2 | ||||
-rw-r--r-- | net-fs/openafs/openafs-1.0.4-r1.ebuild | 102 |
5 files changed, 291 insertions, 0 deletions
diff --git a/net-fs/openafs/files/CellServDB b/net-fs/openafs/files/CellServDB new file mode 100644 index 000000000000..24b2f7251c8f --- /dev/null +++ b/net-fs/openafs/files/CellServDB @@ -0,0 +1,2 @@ +>netlabs #Cell name +10.0.0.1 #storage diff --git a/net-fs/openafs/files/ThisCell b/net-fs/openafs/files/ThisCell new file mode 100644 index 000000000000..618723244591 --- /dev/null +++ b/net-fs/openafs/files/ThisCell @@ -0,0 +1 @@ +netlabs
\ No newline at end of file diff --git a/net-fs/openafs/files/afs.rc b/net-fs/openafs/files/afs.rc new file mode 100644 index 000000000000..780bf7f1d135 --- /dev/null +++ b/net-fs/openafs/files/afs.rc @@ -0,0 +1,184 @@ +#! /bin/sh +# Copyright 2000, International Business Machines Corporation and others. +# All Rights Reserved. +# +# This software has been released under the terms of the IBM Public +# License. For details, see the LICENSE file in the top-level source +# directory or online at http://www.openafs.org/dl/license10.html + +# AFS Start and stop AFS components +# +# +# chkconfig: 345 60 20 +# description: AFS is a distributed file system which provides location +# transparency, caching and secure authentication. +# Additional configuration can be done in the /etc/sysconfig/afs +# file. Read the documentation in that file for more information. +# +# Note that AFS does not use a pid file in /var/run. It is turned off by +# unmounting /afs. + + +# Gather up options and post startup script name, if present +if [ -f /etc/afs/afs.conf ]; then + . /etc/afs/afs.conf +fi + +# is_on returns 1 if value of arg is "on" +is_on() { + if test "$1" = "on" ; then return 0 + else return 1 + fi +} + +# If choose_client can't correctly determine which client to use, set +# LIBAFS manually. +choose_client() { + + # Use the second field of the uname -v output instead of just + # doing a match on the whole thing to protect against matching + # a timezone named SMP -- I don't know of one, but let's be + # paranoid. + + set X `uname -v`; shift + case $2 in + SMP) MP=.mp ;; # MP system + *) MP= ;; # SP system + esac + + # For now, just use uname -r to get the module version. + VERSION=`uname -r` + + LIBAFS=libafs-$VERSION$MP.o +} + +# +# Find prefix symbol to use with insmod. We find the unregister_filesystem +# string from /proc/ksyms since we know it's there. If /proc/ksyms does not +# exist, we print that info to the console and use the uname -v output to +# decide on a prefix. +# unregister_filesystem_Rsmp_b240cad8 is a typcial SMP version string from +# a kernel built from ftp.kernel.org +# + +KSYMS_FILE=/proc/ksyms +SEARCH_STR="unregister_filesystem" +DEFAULT_SMP_PREFIX="smp_" # Redhat kernels need "smp" instead +PREFIX="" # none needed for UP with <= 1Gig memory + +set_prefix() +{ + h='[0-9a-fA-F]' + h8="$h$h$h$h$h$h$h$h" + prefix_set=0 + + set X `fgrep $SEARCH_STR $KSYMS_FILE 2> /dev/null`; shift + str=$2 + case $str in + ${SEARCH_STR}_R$h8) + # No prefix required + ;; + $SEARCH_STR) + # No versioning in kernel symbols + ;; + ${SEARCH_STR}_R*$h8) + suffix=${str#${SEARCH_STR}_R} + PREFIX=${suffix%$h8} + ;; + *) + case $str in + '') + echo afsd: Cannot find \"$SEARCH_STR\" in file $KSYMS_FILE + ;; + *) + echo afsd: Malformed kernel version symbol \"$str\" + ;; + esac + + echo Guessing prefix from output of uname -v + set X `uname -v`; shift + case $2 in + SMP) + PREFIX=$DEFAULT_SMP_PREFIX + ;; + esac + ;; + esac +} + + +MODLOADDIR=/usr/vice/etc/modload +# load_client loads the AFS client module if it's not already loaded. +load_client() { + # If LIBAFS is set, use it. + if [ -z "$LIBAFS" ] ; then + # Try to determine the right client. + choose_client + fi + + if [ ! -f $MODLOADDIR/$LIBAFS ] ; then + echo AFS module $MODLOADDIR/$LIBAFS does not exist. Not starting AFS. + exit 1 + fi + + # use the prefix command if required + set_prefix + /sbin/insmod ${PREFIX:+-P $PREFIX} -f -m $MODLOADDIR/$LIBAFS > $MODLOADDIR/libafs.map 2>&1 +} + +case "$1" in + start) + # Load kernel extensions + if load_client ; then : + else + echo Failed to load AFS client, not starting AFS services. + exit 1 + fi + + echo "Starting AFS services..... " + # Start bosserver, it if exists + if is_on $AFS_SERVER && test -x /usr/afs/bin/bosserver ; then + /usr/afs/bin/bosserver + fi + + # Start AFS client + if is_on $AFS_CLIENT && test -x /usr/vice/etc/afsd ; then + /usr/vice/etc/afsd ${OPTIONS} + + # Start AFS version of inetd.conf if present. + if test -f /usr/afsws/etc/inetd.conf -a -x /usr/afsws/etc/inetd.afs ; then + /usr/afsws/etc/inetd.afs /usr/afsws/etc/inetd.conf + fi + $AFS_POST_INIT + fi + + ;; + + stop) + # Stop AFS + echo "Stopping AFS services..... " + + if is_on $AFS_CLIENT ; then + killall inetd.afs + umount /afs + fi + + if is_on $AFS_SERVER && test -x /usr/afs/bin/bos ; then + echo "Stopping AFS bosserver" + /usr/afs/bin/bos shutdown localhost -localauth -wait + killall -HUP bosserver + fi + + LIBAFS=`/sbin/lsmod | fgrep libafs` + if [ -n "$LIBAFS" ] ; then + LIBAFS=`echo $LIBAFS | awk 'BEGIN { FS = " " } { print $1 }'` + /sbin/rmmod $LIBAFS + fi + + ;; + + *) + echo Usage: 'afs <start|stop>' + +esac + diff --git a/net-fs/openafs/files/digest-openafs-1.0.4-r1 b/net-fs/openafs/files/digest-openafs-1.0.4-r1 new file mode 100644 index 000000000000..e8195d857203 --- /dev/null +++ b/net-fs/openafs/files/digest-openafs-1.0.4-r1 @@ -0,0 +1,2 @@ +MD5 524fda5be5b0506bb0b96e1e5574e0ba afs-3.6-doc.tar.gz +MD5 e8ef5ad75b8c1cc3f73f1ecc943c40f7 openafs-1.0.4-src.tar.bz2 diff --git a/net-fs/openafs/openafs-1.0.4-r1.ebuild b/net-fs/openafs/openafs-1.0.4-r1.ebuild new file mode 100644 index 000000000000..87837523f0b8 --- /dev/null +++ b/net-fs/openafs/openafs-1.0.4-r1.ebuild @@ -0,0 +1,102 @@ +# Copyright 1999-2000 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later +# Author Holger Brueckner <darks@fet.org> + +S=${WORKDIR}/${P} +DESCRIPTION="The AFS 3 distributed file system targets the issues critical to +distributed computing environments. AFS performs exceptionally well, +both within small, local work groups of machines and across wide-area +configurations in support of large, collaborative efforts. AFS provides +an architecture geared towards system management, along with the tools +to perform important management tasks. For a user, AFS is a familiar yet +extensive UNIX environment for accessing files easily and quickly." + +SRC_URI="http://www.openafs.org/dl/openafs/1.0.4/openafs-1.0.4-src.tar.bz2" +HOMEPAGE="http://www.openafs.org/" + +DEPEND="virtual/glibc + >=sys-libs/ncurses-5.2" + + +src_compile() { + + KERNELVERSION=`grep "UTS_RELEASE" /usr/src/linux/include/linux/version.h | awk '{print $3}'` + KERNELSHORT=`echo $KERNELVERSION | cut -c1-3 | sed "s/\.//"` + SYSTEM="linux" + SYSARCH="i386" + CELLNAME=`cat ${FILESDIR}/ThisCell` + + # should be around 90% of actual free space + CACHESIZE=200000 + + try mkdir ${SYSARCH}_${SYSTEM}${KERNELSHORT} + try mkdir ${SYSARCH}_${SYSTEM}${KERNELSHORT}/dest + try mkdir ${SYSARCH}_${SYSTEM}${KERNELSHORT}/obj + ln -s "@sys/dest" dest + ln -s "@sys/obj" obj + ln -s ${SYSARCH}_${SYSTEM}${KERNELSHORT} @sys + ln -s src/Makefile Makefile + try make links + try make SYS_NAME="${SYSARCH}_${SYSTEM}${KERNELSHORT}" \ + LINUX_VERS="${KERNELVERSION}" TXLIBS=/lib/libncurses.so \ + OPTMZ=\"$CFLAGS\" XCFLAGS=\"$CFLAGS\" \ + PAM_CFLAGS=\"$CFLAGS -Dlinux -DLINUX_PAM -fPIC\" +} + +src_install () { + + + # Client + + cd ${S}/dest/root.client/usr/vice + + insinto /etc/afs/modload + doins etc/modload/* + insinto /etc/afs/C + doins etc/C/* + + insinto /etc/afs + doins ${FILESDIR}/{ThisCell,CellServDB} + doins etc/afs.conf + + dodir /afs + + exeinto /etc/rc.d/init.d + newexe ${FILESDIR}/afs.rc afs + + dosbin etc/afsd + + # Client Bin + cd ${S}/dest + exeinto /usr/afsws/bin + doexe bin/* + + exeinto /etc/afsws + doexe etc/* + + cp -a include lib ${D}/usr/afsws + dosym /usr/afswf/lib/afs/libtermlib.a /usr/afsws/lib/afs/libnull.a + + # Server + cd ${S}/dest/root.server/usr/afs + exeinto /usr/afs/bin + doexe bin/* + + dodir /usr/vice + dosym /etc/afs /usr/vice/etc + dosym /etc/afsws /usr/afsws/etc + +} + +pkg_postinst () { + if [ "$PN" = "openafs_client" ] + then + echo ">>> UPDATE CellServDB and ThisCell to your needs !!" + elif [ "$PN" = "openafs_client_bin" ] + then + echo ">>> UPDATE CellServDB and ThisCell to your needs !!" + else + echo ">>> FOLLOW THE INSTRUCTIONS IN AFS QUICK BEGINNINGS" + echo ">>> PAGE >45 TO DO INITIAL SERVER SETUP" + fi +} |