[Lunar-commits] r23845 - in moonbase/trunk: filesys/openafs filesys/openafs/init.d kernel/openafs-driver

Stefan Wold ratler at lunar-linux.org
Thu Mar 29 09:58:55 CEST 2007


Author: ratler
Date: 2007-03-29 09:58:55 +0200 (Thu, 29 Mar 2007)
New Revision: 23845

Added:
   moonbase/trunk/filesys/openafs/init.d/
   moonbase/trunk/filesys/openafs/init.d/afs
Modified:
   moonbase/trunk/filesys/openafs/BUILD
   moonbase/trunk/filesys/openafs/DEPENDS
   moonbase/trunk/filesys/openafs/DETAILS
   moonbase/trunk/filesys/openafs/POST_INSTALL
   moonbase/trunk/kernel/openafs-driver/BUILD
   moonbase/trunk/kernel/openafs-driver/DETAILS
   moonbase/trunk/kernel/openafs-driver/POST_INSTALL
Log:
Big make over.
Openafs is now fully FHS compliant.


Modified: moonbase/trunk/filesys/openafs/BUILD
===================================================================
--- moonbase/trunk/filesys/openafs/BUILD	2007-03-28 20:40:42 UTC (rev 23844)
+++ moonbase/trunk/filesys/openafs/BUILD	2007-03-29 07:58:55 UTC (rev 23845)
@@ -1,7 +1,5 @@
 (
   patch_it $SOURCE4 1	&&
-  patch_it $SOURCE5 1	&&
-  patch_it $SOURCE6 1	&&
   ./regen.sh		&& 
 
   case `uname -r` in
@@ -19,26 +17,24 @@
 
   case `arch` in
     x86_64)
-      OPTS="$OPTS --with-afs-sysname=amd64_linux${kv}"
+      OPTS+=" --with-afs-sysname=amd64_linux${kv}"
       ;;
     i386|i486|i586|i686|athlon)
-      OPTS="$OPTS --with-afs-sysname=i386_linux${kv}"
+      OPTS+=" --with-afs-sysname=i386_linux${kv}"
       ;;
     *)
-      OPTS="$OPTS --with-afs-sysname=`arch`_linux${kv}"
+      OPTS+=" --with-afs-sysname=`arch`_linux${kv}"
       ;;
   esac
 
-  if [ ! -e /lib/modules/`uname -r`/build/include/linux/version.h ]; then
-    message "Can't find '/lib/modules/`uname -r`/build/include/linux/version.h'!"
-    message "You need to have the source for your running kernel online and configured!"
-    exit -1
+  if module_installed Linux-PAM; then
+      OPTS+=" --enable-pam"
+  else
+      OPTS+=" --disable-pam"
   fi
-  OPTS="$OPTS --with-linux-kernel-headers=/lib/modules/`uname -r`/build"
-
+	
   ./configure 	--prefix=/usr			\
-		--sysconfdir=/usr/vice/etc	\
-		--localstatedir=/var		\
+		--sysconfdir=/etc	        \
 		--infodir=/usr/share/info	\
 		--mandir=/usr/share/man		\
 		--enable-largefile-fileserver   \
@@ -46,16 +42,17 @@
 		$OPTS				&&
   make all_nolibafs				&&
   prepare_install				&&
+  
+  if [ ! -d /etc/openafs ]; then
+      mkdir -p /etc/openafs/server
+  fi &&
+  
   make install_nolibafs				&&
 
   # Creating needed dirs if not existing
-  if [ ! -d /usr/vice ]; then
-	mkdir -p /usr/vice/etc
-  fi &&
-
-  if [ ! -d /usr/vice/cache ]; then
-	mkdir -p /usr/vice/cache &&
- 	chmod 0700 /usr/vice/cache
+   if [ ! -d /var/cache/openafs ]; then
+	mkdir -p /var/cache/openafs &&
+ 	chmod 0700 /var/cache/openafs
   fi &&	
 
   if [ ! -d /afs ]; then
@@ -64,18 +61,25 @@
   fi &&	
 
   # Installing some db files
-  install -p -m 644 $SOURCE_CACHE/CellServDB /usr/vice/etc/CellServDB &&
-  install -p -m 755 $SOURCE_CACHE/$SOURCE3 /usr/vice/etc/killafs &&
-  install -p -m 644 $SOURCE_DIRECTORY/src/packaging/RedHat/openafs-cacheinfo /usr/vice/etc/cacheinfo &&
-  touch /usr/vice/etc/SuidCells &&
+  install -p -m 644 $SOURCE_CACHE/CellServDB /etc/openafs/CellServDB &&
+  install -p -m 755 $SOURCE_CACHE/$SOURCE3 /usr/sbin/killafs &&
+  touch /etc/openafs/SuidCells &&
 
+  # Default to openafs.org cell
+  if [ ! -f /etc/openafs/ThisCell ]; then
+      echo "openafs.org" > /etc/openafs/ThisCell
+  fi &&
+
+  # Create cacheinfo file, 200Mb size
+  if [ ! -f /etc/openafs/cacheinfo ]; then
+      echo "/afs:/var/cache/openafs:200000" > /etc/openafs/cacheinfo
+  fi
+  
   # Copy conf and rc files
-  sedit "s;^OPTIONS=.*;OPTIONS=\"\$MEDIUM -nosettime\";" $SOURCE_DIRECTORY/src/afsd/afs.conf.linux &&
+  sedit "s;^OPTIONS=.*;OPTIONS=\"-nosettime -fakestat\";" $SOURCE_DIRECTORY/src/afsd/afs.conf.linux &&
   if [ ! -f /etc/config.d/afs ]; then
       install -p -m 644 $SOURCE_DIRECTORY/src/afsd/afs.conf.linux /etc/config.d/afs
   fi &&
-  sedit "s;^SYSCNF=.*;SYSCNF=/etc/config.d/afs;" $SOURCE_DIRECTORY/src/afsd/afs.rc.linux &&
-  install -p -m 755 $SOURCE_DIRECTORY/src/afsd/afs.rc.linux /etc/init.d/afs
 
   # Ugly but we need a new cellservdb everytime we run lin
   rm -f $SOURCE_CACHE/$SOURCE2

Modified: moonbase/trunk/filesys/openafs/DEPENDS
===================================================================
--- moonbase/trunk/filesys/openafs/DEPENDS	2007-03-28 20:40:42 UTC (rev 23844)
+++ moonbase/trunk/filesys/openafs/DEPENDS	2007-03-29 07:58:55 UTC (rev 23845)
@@ -1,4 +1,9 @@
 depends autoconf	&&
 depends automake	&&
 depends Linux-PAM       &&
-depends lsof
+depends lsof		&&
+optional_depends "heimdal" \
+                 "--with-krb5-config=/usr/bin/krb5-config" \
+	         "" \
+                 "for kerberos support"
+

Modified: moonbase/trunk/filesys/openafs/DETAILS
===================================================================
--- moonbase/trunk/filesys/openafs/DETAILS	2007-03-28 20:40:42 UTC (rev 23844)
+++ moonbase/trunk/filesys/openafs/DETAILS	2007-03-29 07:58:55 UTC (rev 23845)
@@ -1,28 +1,24 @@
         MODULE=openafs
-       VERSION=1.4.2
+       VERSION=1.4.4
         SOURCE=openafs-$VERSION-src.tar.bz2
        SOURCE2=CellServDB
        SOURCE3=killafs-0.1
-       SOURCE4=openafs-1.4.2-paths.patch
-       SOURCE5=openafs-1.4.1-rename_pagsh.patch
-       SOURCE6=openafs-1.4.2-task_list.patch
+       SOURCE4=openafs-1.4.1-rename_pagsh.patch
     SOURCE_URL=http://www.openafs.org/dl/openafs/$VERSION/
    SOURCE2_URL=http://grand.central.org/dl/cellservdb/
-   SOURCE3_URL=$PATCH_URL
-   SOURCE4_URL=$PATCH_URL
-   SOURCE5_URL=$PATCH_URL
-   SOURCE6_URL=$PATCH_URL
+   SOURCE3_URL=$PATCH_URL/
+   SOURCE4_URL=$PATCH_URL/
       WEB_SITE=http://www.openafs.org/
-    SOURCE_VFY=sha1:062d78e3ee4237ab09fa3b01fed8b2fb35a7f3e5
+    SOURCE_VFY=sha1:07c2854d97fab807ee023c281ec7203f1e9ef723
    SOURCE3_VFY=sha1:5532084c54a79f77807ee8ae3cb09018b3e74c12
-   SOURCE4_VFY=sha1:625fcda8fac555603b62a48d5f2fbbff6cf14d32
-   SOURCE5_VFY=sha1:401b3ada4f9a2a60cd0f6ac60f7107f1fdca0638
-   SOURCE6_VFY=sha1:b9571e6a5be6cc21080d8f149c85c0b56106826c
+   SOURCE4_VFY=sha1:401b3ada4f9a2a60cd0f6ac60f7107f1fdca0638
        ENTERED=20031216
-       UPDATED=20061121
+       UPDATED=20070329
     MAINTAINER="ratler at lunar-linux.org"
          SHORT="A distributed filesystem"
-         PSAFE="no"
+PSAFE=no
+LUNAR_RESTART_SERVICES=off
+
 cat << EOF
 OpenAFS distributed filesystem. AFS is a distributed filesystem
 allowing cross-platform sharing of files among multiple computers.

Modified: moonbase/trunk/filesys/openafs/POST_INSTALL
===================================================================
--- moonbase/trunk/filesys/openafs/POST_INSTALL	2007-03-28 20:40:42 UTC (rev 23844)
+++ moonbase/trunk/filesys/openafs/POST_INSTALL	2007-03-29 07:58:55 UTC (rev 23845)
@@ -2,7 +2,7 @@
 
 message "" &&
 message "Before starting AFS remember to add your AFS cell" &&
-message "to /usr/vice/etc/ThisCell. You might also want to" &&
-message "change the cache size which is by default 100Mb" &&
-message "in /usr/vice/etc/cacheinfo." &&
+message "to /etc/openafs/ThisCell. You might also want to" &&
+message "change the cache size which is by default 200Mb" &&
+message "in /etc/openafs/cacheinfo." &&
 message ""

Added: moonbase/trunk/filesys/openafs/init.d/afs
===================================================================
--- moonbase/trunk/filesys/openafs/init.d/afs	                        (rev 0)
+++ moonbase/trunk/filesys/openafs/init.d/afs	2007-03-29 07:58:55 UTC (rev 23845)
@@ -0,0 +1,151 @@
+#!/bin/sh
+#
+# afs client start script
+# 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/config.d/afs
+#              file. Read the documentation in that file for more information.
+
+
+ESC=`echo -en "\033"`
+RESULT_OK="${ESC}[\061;32m${ESC}[70G[\040\040\040OK\040\040\040]${ESC}[m"
+RESULT_FAIL="${ESC}[\061;31m${ESC}[70G[\040FAILED\040]${ESC}[m"
+RESULT_WARN="${ESC}[\061;33m${ESC}[70G[\040\040WARN\040\040]${ESC}[m"
+
+
+runcmd () {
+    echo -n "$1 "
+    shift
+    $* && echo -e $RESULT_OK || echo -e $RESULT_FAIL
+}
+
+
+SYSCNF=/etc/config.d/afs
+
+# Gather up options and post startup script name, if present
+if [ -f $SYSCNF ] ; then
+    . $SYSCNF
+fi
+
+CACHEINFO=${CACHEINFO:-/etc/openafs/cacheinfo}
+CACHE=${CACHEDIR:-/var/cache/openafs}
+AFS=${AFSDIR:-/afs}
+
+# is_on returns 1 if value of arg is "on"
+is_on () {
+    if  test "$1" = "on" ; then return 0
+    else return 1
+    fi
+}
+
+on_network() {
+    ADDRS=`LANG=C ifconfig -a | grep 'inet addr' | grep -v 127.0.0.1 | wc -l`
+    if [ "$ADDRS" = "" ]; then
+	echo afs: No interfaces with IP address 1>&2
+	return 1
+    elif [ $ADDRS = 0 ]; then
+	echo afs: No interfaces with IP address 1>&2
+	return 1
+    fi
+    return 0
+}
+
+choose_afsdoptions () {
+    if [ -z "$OPTIONS" -o "$OPTIONS" = "AUTOMATIC" ]; then
+	if [ $CACHESIZE -lt 131072 ]; then
+	    OPTIONS=$SMALL
+	elif [ $CACHESIZE -lt 524288 ]; then
+	    OPTIONS=$MEDIUM
+	elif [ $CACHESIZE -lt 1048576 ]; then
+	    OPTIONS=$LARGE
+	elif [ $CACHESIZE -lt 2097152 ]; then
+	    OPTIONS=$XLARGE
+	else
+	    OPTIONS=$XXLARGE
+	fi
+    fi
+    AFSD_OPTIONS="$OPTIONS $VERBOSE"
+    if is_on $ENABLE_AFSDB; then
+	AFSD_OPTIONS="$AFSD_OPTIONS -afsdb"
+    fi
+    if is_on $ENABLE_DYNROOT; then
+	AFSD_OPTIONS="$AFSD_OPTIONS -dynroot"
+    fi
+}
+
+start ()
+{
+    # Check network or die
+    on_network || exit 1
+    
+    # Load kernel extensions
+    if ! modprobe libafs ; then 
+	echo Failed to load AFS kernel module, not starting AFS services.
+	exit 1
+    fi
+    
+    # Start bosserver, it if exists
+    if is_on $AFS_SERVER && test -x /usr/sbin/bosserver  ; then
+	echo -n "Starting AFS server: "
+	/usr/sbin/bosserver -nofork ${BOSSERVER_OPTIONS} &&
+	echo -e $RESULT_OK || echo -e $RESULT_FAIL
+	if is_on $WAIT_FOR_SALVAGE; then
+            # wait for fileserver to finish salvaging
+	    sleep 10
+	    while /usr/bin/bos status localhost fs 2>&1 | grep 'Auxiliary.*salvaging'; do
+		echo "Waiting for salvager to finish..... "
+		sleep 10
+	    done
+	fi
+    fi
+    
+    # Start AFS client
+    if is_on $AFS_CLIENT && test -x /usr/sbin/afsd  ; then
+	echo -n "Starting  AFS client: "
+	choose_afsdoptions
+	/usr/sbin/afsd ${AFSD_OPTIONS} &&
+	echo -e $RESULT_OK || echo -e $RESULT_FAIL
+	$AFS_POST_INIT
+    fi
+}
+
+stop ()
+{
+    if is_on $AFS_CLIENT  ; then
+	if [ -x /usr/sbin/killafs ] ; then
+	    runcmd "Sending all processes using /afs the TERM signal ..." /usr/sbin/killafs TERM
+	    runcmd "Sending all processes using /afs the KILL signal ..." /usr/sbin/killafs KILL
+	fi
+	echo -n "Stopping AFS client: "
+	umount /afs
+	echo -e $RESULT_OK || echo -e $RESULT_FAIL
+    fi
+    
+    if is_on $AFS_SERVER && test -x /usr/bin/bos ; then
+	echo -n "Stopping AFS server: "
+	/usr/bin/bos shutdown localhost -localauth -wait &&
+	echo -e $RESULT_OK || echo -e $RESULT_FAIL
+	killall -HUP bosserver
+	
+    fi
+    echo -n "Unloading AFS kernel module: "
+    modprobe -r libafs &&
+    echo -e $RESULT_OK || echo -e $RESULT_FAIL
+    
+    rm -f /var/lock/subsys/afs
+}
+
+restart ()
+{
+        # Restart AFS
+	$0 stop
+	$0 start
+}
+
+case "$1" in
+	start|stop|restart)
+	$1
+	;;
+	*)	echo "Usage: $0 {start|stop|restart}"; exit 1 ;;
+esac

Modified: moonbase/trunk/kernel/openafs-driver/BUILD
===================================================================
--- moonbase/trunk/kernel/openafs-driver/BUILD	2007-03-28 20:40:42 UTC (rev 23844)
+++ moonbase/trunk/kernel/openafs-driver/BUILD	2007-03-29 07:58:55 UTC (rev 23845)
@@ -1,8 +1,4 @@
 (
-  patch_it $SOURCE2 1 &&
-  patch_it $SOURCE3 1 &&
-  patch_it $SOURCE4 1 &&
-
   ./regen.sh &&
   case `uname -r` in
     2.6.*) 
@@ -19,24 +15,16 @@
 
   case `arch` in
     x86_64)
-      OPTS="$OPTS --with-afs-sysname=amd64_linux${kv}"
+      OPTS+=" --with-afs-sysname=amd64_linux${kv}"
       ;;
     i386|i486|i586|i686|athlon)
-      OPTS="$OPTS --with-afs-sysname=i386_linux${kv}"
+      OPTS+=" --with-afs-sysname=i386_linux${kv}"
       ;;
     *)
-      OPTS="$OPTS --with-afs-sysname=`arch`_linux${kv}"
+      OPTS+=" --with-afs-sysname=`arch`_linux${kv}"
       ;;
   esac
-
    
-  # Bad idea, this causes a POST_INSTALL problem from kernel.
-  # In other words this cause openafs-driver to be built against old kernel
-  #if [ ! -e /lib/modules/`uname -r`/build/include/linux/version.h ]; then
-  #  message "Can't find '/lib/modules/`uname -r`/build/include/linux/version.h'!"
-  #  message "You need to have the source for your running kernel online and configured!"
-  #  exit -1
-  #fi
   OPTS="$OPTS --with-linux-kernel-headers=/usr/src/linux"
 
   ./configure 	--prefix=/usr			\
@@ -45,7 +33,7 @@
 		--infodir=/usr/share/info	\
 		--mandir=/usr/share/man		\
 		$OPTS				&&
-  make dest_only_libafs &&
+  make only_libafs &&
   prepare_install
 
 ) > $C_FIFO 2>&1

Modified: moonbase/trunk/kernel/openafs-driver/DETAILS
===================================================================
--- moonbase/trunk/kernel/openafs-driver/DETAILS	2007-03-28 20:40:42 UTC (rev 23844)
+++ moonbase/trunk/kernel/openafs-driver/DETAILS	2007-03-29 07:58:55 UTC (rev 23845)
@@ -1,21 +1,12 @@
           MODULE=openafs-driver
-         VERSION=1.4.2
+         VERSION=1.4.4
           SOURCE=openafs-$VERSION-src.tar.bz2
-         SOURCE2=openafs-1.4.2-paths.patch
-         SOURCE3=openafs-1.4.1-rename_pagsh.patch
-	 SOURCE4=openafs-1.4.2-task_list.patch
 SOURCE_DIRECTORY=$BUILD_DIRECTORY/openafs-$VERSION
       SOURCE_URL=http://www.openafs.org/dl/openafs/$VERSION/
-     SOURCE2_URL=$PATCH_URL
-     SOURCE3_URL=$PATCH_URL
-     SOURCE4_URL=$PATCH_URL
         WEB_SITE=http://www.openafs.org/
-      SOURCE_VFY=sha1:062d78e3ee4237ab09fa3b01fed8b2fb35a7f3e5
-     SOURCE2_VFY=sha1:625fcda8fac555603b62a48d5f2fbbff6cf14d32
-     SOURCE3_VFY=sha1:401b3ada4f9a2a60cd0f6ac60f7107f1fdca0638
-     SOURCE4_VFY=sha1:b9571e6a5be6cc21080d8f149c85c0b56106826c
+      SOURCE_VFY=sha1:07c2854d97fab807ee023c281ec7203f1e9ef723
          ENTERED=20031216
-         UPDATED=20061121
+         UPDATED=20070329
       MAINTAINER="ratler at lunar-linux.org"
            SHORT="OpenAFS kernel module"
 	 PROFILE="yes"

Modified: moonbase/trunk/kernel/openafs-driver/POST_INSTALL
===================================================================
--- moonbase/trunk/kernel/openafs-driver/POST_INSTALL	2007-03-28 20:40:42 UTC (rev 23844)
+++ moonbase/trunk/kernel/openafs-driver/POST_INSTALL	2007-03-29 07:58:55 UTC (rev 23845)
@@ -1,7 +1,3 @@
-if [ ! -d /usr/vice/etc/modload ]; then
-  mkdir -p /usr/vice/etc/modload
-fi
-
 case `uname -r` in
   2.6.*) 
     kv="26"
@@ -27,8 +23,22 @@
     ;;
 esac
 
+KVER=$(if [ -f /usr/src/linux/include/linux/utsrelease.h ] ; then
+  grep UTS_RELEASE /usr/src/linux/include/linux/utsrelease.h | cut -d'"' -f2
+else
+  grep UTS_RELEASE /usr/src/linux/include/linux/version.h | cut -d'"' -f2
+fi)
+
+MODDIR=$(expr $SOURCE_DIRECTORY/src/libafs/MODLOAD-*)
+
 if [ "$kv" == "26" ]; then
-  install -m 644 $SOURCE_DIRECTORY/${sysname}/dest/root.client/usr/vice/etc/modload/*.ko /usr/vice/etc/modload || exit -1
+  [ -f ${MODDIR}/libafs.ko ] || exit -1
+  mkdir -p /lib/modules/${KVER}/kernel/fs/openafs
+  install -m 644 $MODDIR/libafs.ko /lib/modules/${KVER}/kernel/fs/openafs || exit -1
 else
-  install -m 644 $SOURCE_DIRECTORy/${sysname}/dest/root.client/usr/vice/etc/modload/*.o /usr/vice/etc/modload || exit -1
+  [ -f ${MODDIR}/libafs.o ] || exit -1
+  mkdir -p /lib/modules/${KVER}/kernel/fs/openafs
+  install -m 644 $MODDIR/libafs.o /lib/modules/${KVER}/kernel/fs/openafs || exit -1
 fi
+
+depmod -a $KVER



More information about the Lunar-commits mailing list