#!/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
+
# rc.afs: rc script for AFS on AIX platforms
#
# Install this script as /etc/rc.afs
RMTSYS=""
fi
+# find out whether we have 32 or 64 bit kernel
+
+kernel=32
+if [ -x /usr/sbin/bootinfo ]; then
+ kernel=`/usr/sbin/bootinfo -K`
+fi
+
# Load AFS into the kernel
+
+echo "$0: Loading $kernel bit kernel AFS modules"
cd /usr/vice/etc/dkload
-/usr/vice/etc/dkload/cfgexport -a /usr/vice/etc/dkload/export.ext${ExportExt}
-/usr/vice/etc/dkload/cfgafs -a /usr/vice/etc/dkload/afs.ext${AFSExt}
+if [ $kernel -eq 32 ]; then
+ ./cfgexport -a export.ext${ExportExt} && ./cfgafs -a afs.ext.32
+else
+ ./cfgexport64 -a export64.ext${ExportExt} && ./cfgafs64 -a afs.ext.64
+fi
if [ $? -ne 0 ]; then
/bin/echo "Unable to load AFS extensions into kernel. Not starting client."
exit 1
fi
done
+#
+# Make sure afs exists in /etc/name_to_sysnum
+#
+if grep -s "afs" /etc/vfs > /dev/null; then
+ echo "Entry for afs already exists in /etc/vfs"
+else
+ echo "Creating entry for afs in /etc/vfs"
+ cp /etc/vfs /etc/vfs.orig
+ sed '/cdrfs/i\
+afs 4 none none remote' /etc/vfs > /tmp/vfs
+ mv /tmp/vfs /etc/vfs
+fi
+
# Start afsd
/usr/vice/etc/afsd $OPTIONS $RMTSYS